[FFmpeg-devel] [PATCH] rl.h: Allocate temporary VLC tables instead of having them static.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Sep 1 13:19:22 CEST 2014


On 1 September 2014 12:05:00 CEST, Michael Niedermayer <michaelni at gmx.at> wrote:
>On Mon, Sep 01, 2014 at 09:32:56AM +0200, Reimar Döffinger wrote:
>> On 01.09.2014, at 02:35, Michael Niedermayer <michaelni at gmx.at>
>wrote:
>> > On Sun, Aug 31, 2014 at 08:27:17PM +0200, Reimar Döffinger wrote:
>> >> 
>> >> {
>> >>     int i, q;
>> >> +    VLC vlc;
>> > 
>> >> +    init_vlc(&vlc, 9, rl->n + 1, &rl->table_vlc[0][1], 4, 2,
>&rl->table_vlc[0][0], 4, 2, 0);
>> > 
>> > same issue here
>> > 
>> > why do you change the code to dynamically allocate ?
>> 
>> Because it ends up using and wasting memory for nothing at runtime if
>you leave it static.
>> And the size is a bit too large to do it on-stack I think.
>
>maybe iam missing something but does it need more than 5kb ?
>or is that considered "too much" for some supported platform ?

Something around 5kB, yes.
Though since I'd prefer to have it in the function I'd prefer to just make it something like always 1500 elements or so...
I for some reason though 4kB was the limit though, but if not I'd be happy to put it on stack instead!




More information about the ffmpeg-devel mailing list