[Ffmpeg-devel] [PATCH] ac3 decoder

Justin Ruggles jruggle
Wed Oct 18 04:45:56 CEST 2006


Benjamin Larsson wrote:
> Hi.
> 
> Justin Ruggles skrev:
> 
>>Justin Ruggles wrote:
>>  
>>
>>>Fabrice Bellard wrote:
>>>
>>>    
>>>
>>>>Benjamin Larsson wrote:
>>>>
>>>>
>>>>      
>>>>
>>>>>Here is the patch with the ac3 decoder from SoC. Included is the patch
>>>>>to enable the sse imdct from Loren Merrit.
>>>>>
>>>>>MvH
>>>>>Benjamin Larsson
>>>>>        
>>>>
>>>>IMHO, the AC3 decoder bit allocation should be factorized with the 
>>>>encoder one (it should be by construction exactly the same function !).
>>>>
>>>>Regards,
>>>>
>>>>Fabrice.
>>>>      
>>>
>>>The decoder & encoder bit allocation functions definitely have identical
>>>results, but they are implemented slightly differently.  Unless someone
>>>else does it first, I'll make an attempt at a common version this
>>>weekend.  Also, there is some opportunity for optimization in both the
>>>encoder and decoder implementations.  For example, when exponents & bit
>>>allocation parameters are reused from the previous block, most of the
>>>bit allocation routine can be skipped.
>>>    
>>
>>I've been doing some work on this, and I've come to realize it will take
>>quite a bit of reworking to reduce code duplication since the decoder
>>passes the whole context into the bit allocation function.  Also, since
>>this is not my patch, I don't want to step on any toes here.  Is
>>Kartikey still working on this?  Should I submit my suggestions as an
>>alternate patch?  or a patch against the patched version?
>>
>>-Justin
>>  
> 
> 
> 
> I tried contacting Kartikey but he hasn't answered so feel free to 
> rework it as you see fit.

The solution I've come up with uses ac3_common.c & ac3_common.h for the
bit allocation routines & table initialization.  The alternative would
be to either define all the tables as const & set the values instead of
calculating at runtime or put table inits in both the encoder and
decoder...unless it would be okay to put the initialization in ac3tab.h
as static inline (not my favorite choice).  Any advice here?

Thanks,
Justin




More information about the ffmpeg-devel mailing list