diff ac3_parser.c @ 6003:608c8e9ac412 libavcodec

cosmetics: rename ac3 bit allocation variables
author jbr
date Sun, 09 Dec 2007 03:23:04 +0000
parents 29635f7c3d9c
children 7d9dddd54817
line wrap: on
line diff
--- a/ac3_parser.c	Sun Dec 09 03:21:33 2007 +0000
+++ b/ac3_parser.c	Sun Dec 09 03:23:04 2007 +0000
@@ -52,8 +52,8 @@
         return AC3_PARSE_ERROR_BSID;
 
     hdr->crc1 = get_bits(&gbc, 16);
-    hdr->fscod = get_bits(&gbc, 2);
-    if(hdr->fscod == 3)
+    hdr->sr_code = get_bits(&gbc, 2);
+    if(hdr->sr_code == 3)
         return AC3_PARSE_ERROR_SAMPLE_RATE;
 
     hdr->frmsizecod = get_bits(&gbc, 6);
@@ -75,11 +75,11 @@
     }
     hdr->lfeon = get_bits1(&gbc);
 
-    hdr->halfratecod = FFMAX(hdr->bsid, 8) - 8;
-    hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->fscod] >> hdr->halfratecod;
-    hdr->bit_rate = (ff_ac3_bitrate_tab[hdr->frmsizecod>>1] * 1000) >> hdr->halfratecod;
+    hdr->sr_shift = FFMAX(hdr->bsid, 8) - 8;
+    hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code] >> hdr->sr_shift;
+    hdr->bit_rate = (ff_ac3_bitrate_tab[hdr->frmsizecod>>1] * 1000) >> hdr->sr_shift;
     hdr->channels = ff_ac3_channels_tab[hdr->acmod] + hdr->lfeon;
-    hdr->frame_size = ff_ac3_frame_size_tab[hdr->frmsizecod][hdr->fscod] * 2;
+    hdr->frame_size = ff_ac3_frame_size_tab[hdr->frmsizecod][hdr->sr_code] * 2;
 
     return 0;
 }
@@ -88,8 +88,8 @@
                     int *bit_rate, int *samples)
 {
     int err;
-    unsigned int fscod, acmod, bsid, lfeon;
-    unsigned int strmtyp, substreamid, frmsiz, fscod2, numblkscod;
+    unsigned int sr_code, acmod, bsid, lfeon;
+    unsigned int strmtyp, substreamid, frmsiz, sr_code2, numblkscod;
     GetBitContext bits;
     AC3HeaderInfo hdr;
 
@@ -117,19 +117,19 @@
         if(frmsiz*2 < AC3_HEADER_SIZE)
             return 0;
 
-        fscod = get_bits(&bits, 2);
-        if (fscod == 3) {
-            fscod2 = get_bits(&bits, 2);
+        sr_code = get_bits(&bits, 2);
+        if (sr_code == 3) {
+            sr_code2 = get_bits(&bits, 2);
             numblkscod = 3;
 
-            if(fscod2 == 3)
+            if(sr_code2 == 3)
                 return 0;
 
-            *sample_rate = ff_ac3_sample_rate_tab[fscod2] / 2;
+            *sample_rate = ff_ac3_sample_rate_tab[sr_code2] / 2;
         } else {
             numblkscod = get_bits(&bits, 2);
 
-            *sample_rate = ff_ac3_sample_rate_tab[fscod];
+            *sample_rate = ff_ac3_sample_rate_tab[sr_code];
         }
 
         acmod = get_bits(&bits, 3);