[FFmpeg-devel] [PATCH] E-AC-3 spectral extension

Justin Ruggles justin.ruggles
Sat Aug 15 19:24:07 CEST 2009


Justin Ruggles wrote:

> Michael Niedermayer wrote:
> 
>> On Mon, Aug 03, 2009 at 06:08:52PM -0400, Justin Ruggles wrote:
>>> Michael Niedermayer wrote:
>> [...]
>>>>> +    int8_t spx_atten_code[AC3_MAX_CHANNELS];    ///< spx attenuation code                   (spxattencod)
>>>>> +    int spx_start_subband;                      ///< spx beginning frequency band           (spxbegf)
>>>>> +    int spx_start_freq;                         ///< spx start frequency bin
>>>>> +    int spx_end_freq;                           ///< spx end frequency bin
>>>> what are frequency bins?
>>> MDCT coefficient index.  Frequency bin is the term that the (E-)AC-3
>>> spec uses throughout.
>> Please explain these terms somewhere, like at the top of the file.
>> And dont hesitate to add diagrams and ascii art to make all the relations
>> clear.
> 
> 
> I have added a summary of the bin/subband/band grouping of MDCT
> coefficients used in (E-)AC-3...with an ascii art diagram. :)
> 
>>
>>>>> +    int spx_copy_start_freq;                    ///< spx starting frequency for copying     (copystartmant)
>>>> frequency in hz ?
>>> bin number. fixed.
>> next clarify what starting frequency is
>> there surely is a source and a destination to every copy ...
> 
> the summary noted above defines what a frequency bin is.  i also added a
> comment here stating that the copy range ends at the start of the spx range.
> 
>>>>> +    int num_spx_bands;                          ///< number of spx bands                    (nspxbnds)
>>>>> +    uint8_t spx_band_struct[SPX_MAX_BANDS];     ///< spectral extension band structure      (spxbndstrc)
>>>> what is a spectral extension band structure?
>>> determines how many subbands are in each band.  for each subband, 1
>>> means combine with previous band, 0 means start new band.  this is the
>>> same format as the coupling band structure, hence the shared function to
>>> decode it.  I just added more information to the current documentation
>>> for decode_band_structure().
>> Could you please explain this in the doxy of the variable,
>> someone reading the code who sees "spx_band_struct" would look up
>> the doxy in the struct first and only if the doxy that is supposed
>> to explain does not do that at all would he read the code using the
>> variable
>> you dont have to write all the details in the doxy but
>> "spectral extension band structure" says nothing unless one happens to
>> know the ac3 spec by heart and id love to not require that.
>> A person knowing how MDCT+VLC/RLE based audio coding works should be
>> able to make sense of such decoders in lavc and not have to read
>> through each individual spec
> 
> I hope the recent changes I've made help this.  I removed all the
> *_band_struct[] from the AC3DecodeContext.  So what defines the band
> structure is the number of bands and size of each band, which is much
> more intuitive to someone not already knowing the spec.
> 
> New patch attached.
> 
> Thanks for the suggestions.

ping.


-Justin




More information about the ffmpeg-devel mailing list