[FFmpeg-cvslog] alac: adjust conditions for updating entropy decoder history
Justin Ruggles
git at videolan.org
Thu Jul 19 23:35:49 CEST 2012
ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Mon Jul 9 10:42:52 2012 -0400| [6fd8a28b596760b4b0a2f227c54d7315e04c396a] | committer: Justin Ruggles
alac: adjust conditions for updating entropy decoder history
avoids some unnecessary arithmetic in certain situations
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6fd8a28b596760b4b0a2f227c54d7315e04c396a
---
libavcodec/alac.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 84f7e42..f27992d 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)) {
More information about the ffmpeg-cvslog
mailing list