[Ffmpeg-devel] [RFC] mdct window generation

Benjamin Larsson banan
Mon Jul 10 13:23:27 CEST 2006


Michael Niedermayer wrote:

>Hi
>
>On Mon, Jul 10, 2006 at 02:27:39AM +0200, Benjamin Larsson wrote:
>  
>
>>Michael Niedermayer wrote:
>>
>>    
>>
>>>Hi
>>>
>>>[...]
>>>
>>>      
>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>Ok, then we should do the same with the runtime generated fft and mdct
>>>>transform twiddle factors. How should it be implemented, is there some
>>>>code already that does this ?
>>>>   
>>>>
>>>>        
>>>>
>>>one possibility is:
>>>
>>>float window[Y][X];
>>>
>>>...
>>>
>>>   if(!window[needed_window][X-1])
>>>       init_window(needed_window);
>>> 
>>>
>>>      
>>>
>>So there is no good solution that only allocate the needed memory and
>>share that in a safe way ?
>>    
>>
>
>the OS will allocate the memory when it is first written to ...
>allocating the memory with malloc() would need some locking
>or you might end up loosing some memory
>and if you are so terribly concerned about the window size, then
>why not calculate the windows on the fly, instead of storing them?
>the idea here would be to store just a few coefficients and interpolate
>with some low order polynomials ...
>
>[...]
>  
>
I'm not terribly concerned, I was just wondering if there was a solution
that would keep the tables out of the binary, keep a low memory
footprint at runtime and still beeing able to share the tables with
other instances at the same time.

Regarding the interpolation of the window, that would make sense on a
memory constrained system. But otherwise it would just be slower then
using a table on most systems.

I'll send an updated patch later.

MvH
Benjamin Larsson

-- 
new tiny signature





More information about the ffmpeg-devel mailing list