aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ac3enc.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2010-12-16 21:09:08 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2010-12-16 21:09:08 +0000
commitcdedf7e6254024c643532d45ac7c68e84e50eb01 (patch)
tree3d574bfaef85991c89ceeaba8b6bc8a246995678 /libavcodec/ac3enc.c
parent27af78cf0ef2fe22a0f77f88f58eb6a449d0f89a (diff)
downloadffmpeg-cdedf7e6254024c643532d45ac7c68e84e50eb01.tar.gz
Convert a for() loop into a while() loop for the downward part of the exponent
delta limiting. Originally committed as revision 26035 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3enc.c')
-rw-r--r--libavcodec/ac3enc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 7d3666aaa1..212a221ff2 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -639,7 +639,8 @@ static void encode_exponents_blk_ch(uint8_t *exp,
differentially encoded */
for (i = 1; i <= nb_groups; i++)
exp[i] = FFMIN(exp[i], exp[i-1] + 2);
- for (i = nb_groups-1; i >= 0; i--)
+ i--;
+ while (--i >= 0)
exp[i] = FFMIN(exp[i], exp[i+1] + 2);
/* now we have the exponent values the decoder will see */