[FFmpeg-soc] [soc]: r1722 - in eac3: ac3.h ac3dec.c checkout.sh ffmpeg.patch

jbr subversion at mplayerhq.hu
Mon Dec 31 00:57:05 CET 2007


Author: jbr
Date: Mon Dec 31 00:57:04 2007
New Revision: 1722

Log:
do not read mix levels in ac3 parser. update patch and script to ffmpeg svn-r11360.

Modified:
   eac3/ac3.h
   eac3/ac3dec.c
   eac3/checkout.sh
   eac3/ffmpeg.patch

Modified: eac3/ac3.h
==============================================================================
--- eac3/ac3.h	(original)
+++ eac3/ac3.h	Mon Dec 31 00:57:04 2007
@@ -85,9 +85,6 @@ typedef struct {
     uint8_t bitstream_id;
     uint8_t bitstream_mode;
     uint8_t channel_mode;
-    uint8_t center_mix_level;
-    uint8_t surround_mix_level;
-    uint8_t dolby_surround_mode;
     uint8_t lfe_on;
     /** @} */
 

Modified: eac3/ac3dec.c
==============================================================================
--- eac3/ac3dec.c	(original)
+++ eac3/ac3dec.c	Mon Dec 31 00:57:04 2007
@@ -249,8 +249,6 @@ static int ac3_parse_header(AC3DecodeCon
     /* get decoding parameters from header info */
     s->bit_alloc_params.sr_code     = hdr.sr_code;
     s->channel_mode                 = hdr.channel_mode;
-    center_mix_level                = ff_ac3_mix_levels[center_levels[hdr.center_mix_level]];
-    surround_mix_level              = ff_ac3_mix_levels[surround_levels[hdr.surround_mix_level]];
     s->lfe_on                       = hdr.lfe_on;
     s->bit_alloc_params.sr_shift    = hdr.sr_shift;
     s->sample_rate                  = hdr.sample_rate;
@@ -266,6 +264,10 @@ static int ac3_parse_header(AC3DecodeCon
     if(s->lfe_on)
         s->output_mode |= AC3_OUTPUT_LFEON;
 
+    /* set default mix levels */
+    center_mix_level = LEVEL_MINUS_4POINT5DB;
+    surround_mix_level = LEVEL_MINUS_6DB;
+
     /* skip over portion of header which has already been read */
     skip_bits(gbc, 16); // skip the sync_word
     skip_bits(gbc, 16); // skip crc1
@@ -275,9 +277,9 @@ static int ac3_parse_header(AC3DecodeCon
         skip_bits(gbc, 2); // skip dsurmod
     } else {
         if((s->channel_mode & 1) && s->channel_mode != AC3_CHMODE_MONO)
-            skip_bits(gbc, 2); // skip cmixlev
+            center_mix_level = ff_ac3_mix_levels[center_levels[get_bits(gbc, 2)]];
         if(s->channel_mode & 4)
-            skip_bits(gbc, 2); // skip surmixlev
+            surround_mix_level = ff_ac3_mix_levels[surround_levels[get_bits(gbc, 2)]];
     }
     skip_bits1(gbc); // skip lfeon
 

Modified: eac3/checkout.sh
==============================================================================
--- eac3/checkout.sh	(original)
+++ eac3/checkout.sh	Mon Dec 31 00:57:04 2007
@@ -1,10 +1,10 @@
-FILES="ac3.c ac3.h ac3tab.c ac3tab.h eac3dec.c eac3.h ac3dec.c ac3dec.h"
+FILES="ac3.c ac3.h ac3tab.c ac3tab.h eac3dec.c ac3dec.c ac3dec.h"
 
 echo "checking out ffmpeg svn"
 for i in $FILES ac3_parser.c Makefile aac_ac3_parser.c aac_ac3_parser.h aac_parser.c allcodecs.c avcodec.h ../libavformat/allformats.h ../libavformat/raw.c allcodecs.h ac3enc.c ../ffmpeg.c; do
     rm -f ffmpeg/libavcodec/$i
 done
-svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk/ ffmpeg -r 11346
+svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk/ ffmpeg -r 11360
 echo "patching ffmpeg"
 cd ffmpeg
 patch -p0 <../ffmpeg.patch

Modified: eac3/ffmpeg.patch
==============================================================================
--- eac3/ffmpeg.patch	(original)
+++ eac3/ffmpeg.patch	Mon Dec 31 00:57:04 2007
@@ -1,6 +1,6 @@
 Index: libavcodec/aac_ac3_parser.c
 ===================================================================
---- libavcodec/aac_ac3_parser.c	(revision 11346)
+--- libavcodec/aac_ac3_parser.c	(revision 11360)
 +++ libavcodec/aac_ac3_parser.c	(working copy)
 @@ -50,7 +50,7 @@
  
@@ -22,7 +22,7 @@ Index: libavcodec/aac_ac3_parser.c
                          }
 Index: libavcodec/aac_ac3_parser.h
 ===================================================================
---- libavcodec/aac_ac3_parser.h	(revision 11346)
+--- libavcodec/aac_ac3_parser.h	(revision 11360)
 +++ libavcodec/aac_ac3_parser.h	(working copy)
 @@ -30,7 +30,7 @@
      uint8_t *inbuf_ptr;
@@ -35,7 +35,7 @@ Index: libavcodec/aac_ac3_parser.h
  } AACAC3ParseContext;
 Index: libavcodec/Makefile
 ===================================================================
---- libavcodec/Makefile	(revision 11346)
+--- libavcodec/Makefile	(revision 11360)
 +++ libavcodec/Makefile	(working copy)
 @@ -67,6 +67,7 @@
  OBJS-$(CONFIG_DVVIDEO_DECODER)         += dv.o
@@ -55,7 +55,7 @@ Index: libavcodec/Makefile
  OBJS-$(CONFIG_H264_PARSER)             += h264_parser.o
 Index: libavcodec/aac_parser.c
 ===================================================================
---- libavcodec/aac_parser.c	(revision 11346)
+--- libavcodec/aac_parser.c	(revision 11360)
 +++ libavcodec/aac_parser.c	(working copy)
 @@ -38,7 +38,7 @@
  };
@@ -68,7 +68,7 @@ Index: libavcodec/aac_parser.c
      GetBitContext bits;
 Index: libavcodec/allcodecs.c
 ===================================================================
---- libavcodec/allcodecs.c	(revision 11346)
+--- libavcodec/allcodecs.c	(revision 11360)
 +++ libavcodec/allcodecs.c	(working copy)
 @@ -180,6 +180,7 @@
      REGISTER_DECODER (COOK, cook);
@@ -88,8 +88,25 @@ Index: libavcodec/allcodecs.c
      REGISTER_PARSER  (H264, h264);
 Index: libavcodec/ac3_parser.c
 ===================================================================
---- libavcodec/ac3_parser.c	(revision 11346)
+--- libavcodec/ac3_parser.c	(revision 11360)
 +++ libavcodec/ac3_parser.c	(working copy)
+@@ -65,13 +65,13 @@
+     hdr->bitstream_mode = get_bits(&gbc, 3);
+     hdr->channel_mode = get_bits(&gbc, 3);
+     if((hdr->channel_mode & 1) && hdr->channel_mode != AC3_CHMODE_MONO) {
+-        hdr->center_mix_level = get_bits(&gbc, 2);
++        skip_bits(&gbc, 2); // skip center mix level
+     }
+     if(hdr->channel_mode & 4) {
+-        hdr->surround_mix_level = get_bits(&gbc, 2);
++        skip_bits(&gbc, 2); // skip surround mix level
+     }
+     if(hdr->channel_mode == AC3_CHMODE_STEREO) {
+-        hdr->dolby_surround_mode = get_bits(&gbc, 2);
++        skip_bits(&gbc, 2); // skip dolby surround mode
+     }
+     hdr->lfe_on = get_bits1(&gbc);
+ 
 @@ -84,7 +84,7 @@
      return 0;
  }
@@ -130,7 +147,7 @@ Index: libavcodec/ac3_parser.c
 +};
 Index: libavcodec/avcodec.h
 ===================================================================
---- libavcodec/avcodec.h	(revision 11346)
+--- libavcodec/avcodec.h	(revision 11360)
 +++ libavcodec/avcodec.h	(working copy)
 @@ -276,6 +276,7 @@
      CODEC_ID_APE,
@@ -142,7 +159,7 @@ Index: libavcodec/avcodec.h
      CODEC_ID_DVD_SUBTITLE= 0x17000,
 Index: libavcodec/ac3enc.c
 ===================================================================
---- libavcodec/ac3enc.c	(revision 11346)
+--- libavcodec/ac3enc.c	(revision 11360)
 +++ libavcodec/ac3enc.c	(working copy)
 @@ -479,7 +479,8 @@
          for(ch=0;ch<s->nb_all_channels;ch++) {



More information about the FFmpeg-soc mailing list