diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-07-09 10:42:52 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-07-19 13:26:46 -0400 |
commit | 6fd8a28b596760b4b0a2f227c54d7315e04c396a (patch) | |
tree | a124073b49deac3413173e056d0ef52c816665e4 | |
parent | a06fdadd97778fe50713c2762714cbd8b0eb81b6 (diff) | |
download | ffmpeg-6fd8a28b596760b4b0a2f227c54d7315e04c396a.tar.gz |
alac: adjust conditions for updating entropy decoder history
avoids some unnecessary arithmetic in certain situations
-rw-r--r-- | libavcodec/alac.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c index 84f7e42373..f27992d056 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -131,11 +131,11 @@ static void bastardized_rice_decompress(ALACContext *alac, sign_modifier = 0; /* now update the history */ - history += x_modified * rice_history_mult - - ((history * rice_history_mult) >> 9); - if (x_modified > 0xffff) history = 0xffff; + else + history += x_modified * rice_history_mult - + ((history * rice_history_mult) >> 9); /* special case: there may be compressed blocks of 0 */ if ((history < 128) && (output_count+1 < output_size)) { |