[FFmpeg-soc] [soc]: r1724 - in eac3: ac3.h ac3_parser.c

jbr subversion at mplayerhq.hu
Mon Dec 31 02:16:05 CET 2007


Author: jbr
Date: Mon Dec 31 02:16:05 2007
New Revision: 1724

Log:
remove bitstream_mode and frame_size_code from AC3HeaderInfo

Modified:
   eac3/ac3.h
   eac3/ac3_parser.c

Modified: eac3/ac3.h
==============================================================================
--- eac3/ac3.h	(original)
+++ eac3/ac3.h	Mon Dec 31 02:16:05 2007
@@ -81,9 +81,7 @@ typedef struct {
     uint16_t sync_word;
     uint16_t crc1;
     uint8_t sr_code;
-    uint8_t frame_size_code;
     uint8_t bitstream_id;
-    uint8_t bitstream_mode;
     uint8_t channel_mode;
     uint8_t lfe_on;
     /** @} */

Modified: eac3/ac3_parser.c
==============================================================================
--- eac3/ac3_parser.c	(original)
+++ eac3/ac3_parser.c	Mon Dec 31 02:16:05 2007
@@ -37,6 +37,7 @@ static const uint8_t eac3_blocks[4] = {
 int ff_ac3_parse_header(const uint8_t buf[7], AC3HeaderInfo *hdr)
 {
     GetBitContext gbc;
+    int frame_size_code;
 
     memset(hdr, 0, sizeof(*hdr));
 
@@ -56,13 +57,13 @@ int ff_ac3_parse_header(const uint8_t bu
     if(hdr->sr_code == 3)
         return AC3_PARSE_ERROR_SAMPLE_RATE;
 
-    hdr->frame_size_code = get_bits(&gbc, 6);
-    if(hdr->frame_size_code > 37)
+    frame_size_code = get_bits(&gbc, 6);
+    if(frame_size_code > 37)
         return AC3_PARSE_ERROR_FRAME_SIZE;
 
     skip_bits(&gbc, 5); // skip bsid, already got it
 
-    hdr->bitstream_mode = get_bits(&gbc, 3);
+    skip_bits(&gbc, 3); // skip bitstream mode
     hdr->channel_mode = get_bits(&gbc, 3);
     if((hdr->channel_mode & 1) && hdr->channel_mode != AC3_CHMODE_MONO) {
         skip_bits(&gbc, 2); // skip center mix level
@@ -77,9 +78,9 @@ int ff_ac3_parse_header(const uint8_t bu
 
     hdr->sr_shift = FFMAX(hdr->bitstream_id, 8) - 8;
     hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code] >> hdr->sr_shift;
-    hdr->bit_rate = (ff_ac3_bitrate_tab[hdr->frame_size_code>>1] * 1000) >> hdr->sr_shift;
+    hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift;
     hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;
-    hdr->frame_size = ff_ac3_frame_size_tab[hdr->frame_size_code][hdr->sr_code] * 2;
+    hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2;
 
     return 0;
 }



More information about the FFmpeg-soc mailing list