[FFmpeg-devel] [PATCH 1/2] Move float windowing code in mp3 decoder to dsputils

Michael Niedermayer michaelni
Sat Jun 19 01:27:47 CEST 2010


On Fri, Jun 18, 2010 at 03:54:15PM +0200, Vitor Sessak wrote:
> On 06/18/2010 02:45 PM, Michael Niedermayer wrote:
>> On Thu, Jun 17, 2010 at 05:34:48PM +0200, Vitor Sessak wrote:
>>> On 06/17/2010 04:50 PM, M?ns Rullg?rd wrote:
>>>> Vitor Sessak<vitor1001 at gmail.com>   writes:
>>>>
>>>>> $subj. It introduces some code duplication that I have no good idea
>>>>> how to avoid.
>>>>
>>>> Can we please not clutter dsputil with even more codec-specific stuff?
>>>
>>> As attached?
>> [...]
>>>   /* layer 3 huffman tables */
>>> @@ -178,7 +180,7 @@
>>>   void ff_mpa_synth_filter_float(MPA_INT *synth_buf_ptr, int 
>>> *synth_buf_offset,
>>>                            MPA_INT *window, int *dither_state,
>>>                            OUT_INT *samples, int incr,
>>> -                         INTFLOAT sb_samples[SBLIMIT]);
>>> +                         INTFLOAT sb_samples[SBLIMIT], MPADecodeContext 
>>> *s);
>>
>> whats the context needd for ?
>
> To get a pointer to the apply_window_mp3() function:
>
>> +/* 32 sub band synthesis filter. Input: 32 sub band samples, Output:
>> +   32 samples. */
>> +/* XXX: optimize by avoiding ring buffer usage */
>> +#if CONFIG_FLOAT
>> +void ff_mpa_synth_filter_float(float *synth_buf_ptr,
>> +                               int *synth_buf_offset,
>> +                               float *window, int *dither_state,
>> +                               float *samples, int incr,
>> +                               float sb_samples[SBLIMIT],
>> +                               MPADecodeContext *s)
>> +{
>> +    float *synth_buf;
>> +    int offset;
>> +
>> +    offset = *synth_buf_offset;
>> +    synth_buf = synth_buf_ptr + offset;
>> +
>> +    dct32(synth_buf, sb_samples);
>> +    s->apply_window_mp3(synth_buf, window, dither_state, samples, incr);
>        ^^^
>
> It will be also useful later to get a DCTContext for the asm-optimized 
> dct32()...

if its neeed for more than 1 thing then fine but please placeit
as first argument like in pretty much every other function.
at the end it looks just odd

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100619/98483f82/attachment.pgp>



More information about the ffmpeg-devel mailing list