[FFmpeg-devel] [PATCH] add E-AC-3 support to AC-3 decoder

Justin Ruggles justinruggles
Tue Jun 17 23:39:18 CEST 2008


Hello,

Michael Niedermayer wrote:
> On Sat, Jun 07, 2008 at 10:30:31AM -0400, Justin Ruggles wrote:
>> Hi,
>>
>> Here is a patch set to incrementally add support for E-AC-3 to the AC-3
>> decoder.  There are 32 total patches.  I'm just attaching them all in
>> this email instead of doing the git-send-email thing.
>>
>> Commit log messages:
> [...]
>> [PATCH 29/32] add support for E-AC-3 block decoding
> [...]
>> diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
>> index e60a25b..efadf9e 100644
>> --- a/libavcodec/ac3dec.c
>> +++ b/libavcodec/ac3dec.c
>> @@ -744,19 +744,23 @@ static int ac3_parse_audio_block(AC3DecodeContext *s, int blk)
>>  
>>      /* block switch flags */
>>      different_transforms = 0;
>> +    if (!s->eac3 || s->block_switch_syntax) {
>>      for (ch = 1; ch <= fbw_channels; ch++) {
>>          s->block_switch[ch] = get_bits1(gbc);
>>          if(ch > 1 && s->block_switch[ch] != s->block_switch[1])
>>              different_transforms = 1;
>>      }
>> +    }
>>  
>>      /* dithering flags */
>> +    if (!s->eac3 || s->dither_flag_syntax) {
>>      s->dither_all = 1;
>>      for (ch = 1; ch <= fbw_channels; ch++) {
>>          s->dither_flag[ch] = get_bits1(gbc);
>>          if(!s->dither_flag[ch])
>>              s->dither_all = 0;
>>      }
>> +    }
> 
> do the things not implicate eac3 so that it doesnzt need to be checked
> explicitly? This also applies to most other s->eac3 checks

Hmmm. Good point. If those values are set appropriately during header
parsing, I can remove a lot of the explicit checks.

Thanks,
Justin




More information about the ffmpeg-devel mailing list