diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-07-09 18:42:52 +0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-07-19 21:26:46 +0400 |
commit | 6fd8a28b596760b4b0a2f227c54d7315e04c396a (patch) | |
tree | a124073b49deac3413173e056d0ef52c816665e4 /libavcodec/alac.c | |
parent | a06fdadd97778fe50713c2762714cbd8b0eb81b6 (diff) |
alac: adjust conditions for updating entropy decoder history
avoids some unnecessary arithmetic in certain situations
Diffstat (limited to 'libavcodec/alac.c')
-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)) { |