[FFmpeg-cvslog] commit: Use a local variable in the inner loop of group_exponents() to simplify the (Justin Ruggles )

git at videolan.org git
Sat Jan 15 13:06:37 CET 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Sat Jan 15 01:59:04 2011 +0000| [4b90c35d74880b07c50b3392a338f0f00d10302f] | committer: Justin Ruggles 

Use a local variable in the inner loop of group_exponents() to simplify the
code.

Originally committed as revision 26355 to svn://svn.ffmpeg.org/ffmpeg/trunk

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b90c35d74880b07c50b3392a338f0f00d10302f
---

 libavcodec/ac3enc.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index fe93337..a955256 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -642,10 +642,11 @@ static void group_exponents(AC3EncodeContext *s)
     for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
         AC3Block *block = &s->blocks[blk];
         for (ch = 0; ch < s->channels; ch++) {
-            if (s->exp_strategy[ch][blk] == EXP_REUSE)
+            int exp_strategy = s->exp_strategy[ch][blk];
+            if (exp_strategy == EXP_REUSE)
                 continue;
-            group_size = s->exp_strategy[ch][blk] + (s->exp_strategy[ch][blk] == EXP_D45);
-            nb_groups = exponent_group_tab[s->exp_strategy[ch][blk]-1][s->nb_coefs[ch]];
+            group_size = exp_strategy + (exp_strategy == EXP_D45);
+            nb_groups = exponent_group_tab[exp_strategy-1][s->nb_coefs[ch]];
             bit_count += 4 + (nb_groups * 7);
             p = block->exp[ch];
 




More information about the ffmpeg-cvslog mailing list