[FFmpeg-devel] atrac1 decoder and aea demuxer rev 6

Vitor Sessak vitor1001
Sun Sep 6 22:22:59 CEST 2009


Benjamin Larsson wrote:
> Vitor Sessak wrote:
>> Benjamin Larsson wrote:
>>> Changes:
>>>
>>> Lots of cosmetics fixes.
>>> Optimized the mdct window use.
>>> Removed one memcopy.
>>> Changed some code.
>>>
>>> Did not do anything to the qmf routines that will be shared with atrac3
>>> as it will be a svn copy and I'll take comments on that when the code is
>>>  split out in it's own file.
>> [...]
>>
>>> +
>>> +    /* round, convert to 16bit and interleave */
>>> +    if (q->channels == 1) {
>>> +        /* mono */
>>> +        for (i = 0; i<AT1_SU_SAMPLES; i++)
>>> +            samples[i]     = av_clipf(q->out_samples[0][i],
>>> -32700./(1<<15), 32700./(1<<15));
>>> +    } else {
>>> +        /* stereo */
>>> +        for (i = 0; i < AT1_SU_SAMPLES; i++) {
>>> +            samples[i*2]   = av_clipf(q->out_samples[0][i],
>>> -32700./(1<<15), 32700./(1<<15));
>>> +            samples[i*2+1] = av_clipf(q->out_samples[1][i],
>>> -32700./(1<<15), 32700./(1<<15));
>>> +        }
>>> +    }
>> av_clipf() is slow...
>>
>> -Vitor
> 
> Yes I know but there is no stride argument in the vector clip routine
> and the destination has to be aligned which it is not. So I could only
> use it for the mono path. Thus I left it.

Is the following faster?

     /* round, convert to 16bit and interleave */
     if (q->channels == 1) {
         /* mono */
         q->dsp.vector_clipf(samples, q->out_samples[0], 
-32700./(1<<15), 32700./(1<<15), AT1_SU_SAMPLES);
     } else {
         /* stereo */
         for (i = 0; i < AT1_SU_SAMPLES; i++) {
             samples[i*2  ] = q->out_samples[0][i];
             samples[i*2+1] = q->out_samples[1][i];
         }
         q->dsp.vector_clipf(samples, samples, -32700./(1<<15), 
32700./(1<<15), 2*AT1_SU_SAMPLES);
     }

I suppose there is no problem them with alignment...

-Vitor



More information about the ffmpeg-devel mailing list