[FFmpeg-soc] [soc]: r2453 - aacenc/aacenc.c

kostya subversion at mplayerhq.hu
Sun Jun 15 14:09:43 CEST 2008


Author: kostya
Date: Sun Jun 15 14:09:42 2008
New Revision: 2453

Log:
Factorize out (1 << bits)-1

Modified:
   aacenc/aacenc.c

Modified: aacenc/aacenc.c
==============================================================================
--- aacenc/aacenc.c	(original)
+++ aacenc/aacenc.c	Sun Jun 15 14:09:42 2008
@@ -415,6 +415,7 @@ static void encode_section_data(AVCodecC
 {
     int i, w;
     int bits = cpe->ch[channel].ics.num_windows == 1 ? 5 : 3;
+    int esc = (1 << bits) - 1;
     int count;
 
     for(w = 0; w < cpe->ch[channel].ics.num_windows; w++){
@@ -422,9 +423,9 @@ static void encode_section_data(AVCodecC
         for(i = 0; i < cpe->ch[channel].ics.max_sfb; i++){
             if(!i || cpe->ch[channel].cb[w][i] != cpe->ch[channel].cb[w][i-1]){
                 if(count){
-                    while(count >= (1 << bits) - 1){
-                        put_bits(&s->pb, bits, (1 << bits) - 1);
-                        count -= (1 << bits) - 1;
+                    while(count >= esc){
+                        put_bits(&s->pb, bits, esc);
+                        count -= esc;
                     }
                     put_bits(&s->pb, bits, count);
                 }
@@ -434,9 +435,9 @@ static void encode_section_data(AVCodecC
                 count++;
         }
         if(count){
-            while(count >= (1 << bits) - 1){
-                put_bits(&s->pb, bits, (1 << bits) - 1);
-                count -= (1 << bits) - 1;
+            while(count >= esc){
+                put_bits(&s->pb, bits, esc);
+                count -= esc;
             }
             put_bits(&s->pb, bits, count);
         }



More information about the FFmpeg-soc mailing list