[FFmpeg-devel] [PATCH] atrac decoder

Michael Niedermayer michaelni
Tue Jun 9 12:39:55 CEST 2009


On Tue, Jun 09, 2009 at 11:00:38AM +0200, Benjamin Larsson wrote:
> Michael Niedermayer wrote:
[...]
>>
>>   
>>> +
>>> +    ff_imdct_calc(mdct_context,out,spec);
>>>     
>>
>> cant imdct_half be used?
>>   
>
> If you/someone explain what imdct_half does. I need the complete output 
> from the imdct per my understanding.

the complete output is the half output twice
see ff_imdct_calc_c()


[...]
>>
>>   
>>> +
>>> +    return avctx->block_align;
>>> +}
>>> +
>>> +static av_cold void init_mdct_windows()
>>> +{
>>> +    int i;
>>> +    /* Generate the short window */
>>> +    ff_sine_window_init(short_window,32);
>>> +    for (i=0 ; i<32; i++)
>>> +        short_window[63-i] = short_window[i];
>>> +
>>> +    /** The mid and long windows uses the same sine window splitted
>>> +     *  in the middle and wrapped into zero/one regions as follows:
>>> +     *
>>> +     *                   region of "ones"
>>> +     *               ---------------------------
>>> +     *              /                           \
>>> +     *             / 1st half                    \ 2nd half
>>> +     *            / of the sine                   \ of the sine window
>>> +     *           /  window                         \
>>> +     * ---------/                                   \----------------
>>> +     * zero region                                      zero region
>>> +     */
>>> +
>>> +    /* Generate the mid window */
>>> +    memset(mid_window, 0, sizeof(mid_window));
>>> +    memcpy(&mid_window[48], short_window, sizeof(float) * 32);
>>> +    for (i = 0; i < 96; i++)
>>> +        mid_window[80 + i] = 1.0f;
>>> +    memcpy(&mid_window[176], &short_window[32], sizeof(float) * 32);
>>> +
>>> +    /* Generate the long window */
>>> +    memset(long_window, 0, sizeof(long_window));
>>> +    memcpy(&long_window[112], short_window, sizeof(float) * 32);
>>> +    for (i = 0; i < 224; i++)
>>> +        long_window[144 + i] = 1.0f;
>>>     
>>
>> please dont multiply by 1 or 0, its a waste of time
>>   
>
> So you want me to change one line of windowing
>
> dsp.vector_fmul(out, window, transf_size << 1);
>
> to 3 cases depending on the block size and replace it with
> memset, vector_fmul and vector_fmul_rev ?
>
>
> I thought about it but scrapped the idea as I wanted the code to be clear 
> and simple. But if you want it I'll change the code.

do what is faster please
you can always add the clear code in a comment if you think that is usefull
to the reader


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

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- 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/20090609/abbd0c51/attachment.pgp>



More information about the ffmpeg-devel mailing list