summaryrefslogtreecommitdiff
path: root/libavcodec/alac.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-07-09 10:42:52 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-07-19 13:26:46 -0400
commit6fd8a28b596760b4b0a2f227c54d7315e04c396a (patch)
treea124073b49deac3413173e056d0ef52c816665e4 /libavcodec/alac.c
parenta06fdadd97778fe50713c2762714cbd8b0eb81b6 (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.c6
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)) {