[FFmpeg-devel] [PATCH] Heavy optimization of IFF decoder

Sebastian Vater cdgs.basty
Tue Apr 27 21:05:48 CEST 2010


M?ns Rullg?rd a ?crit :
> Sebastian Vater <cdgs.basty at googlemail.com> writes:
>   
>>  {
>>      GetBitContext gb;
>>      unsigned int i;
>>      const unsigned b = (buf_size * 8) + bps - 1;
>> +    const unsigned b32 = b & ~3;
>>      init_get_bits(&gb, buf, buf_size * 8);
>> -    for(i = 0; i < b; i++) {
>> +    for(i = 0; i < b32; i += 4) {
>> +        const uint32_t v = decodeplane8_tab[plane][get_bits(&gb, 4)];
>> +        AV_WN32A(dst+i, AV_RN32A(dst+i) | v);
>> +    }
>>     
>
> I suggest using a local variable here, like this:
>
>     const uint32_t *lut = decodeplane8_tab[plane];
>     [...]
>     uint32_t v = lut[get_bits(...)];
>
> I don't trust gcc to do that on its own.
>   
Didn't change anything, i.e. still 20% slower...what now?


-- 

Best regards,
                   :-) Basty/CDGS (-:

Warum ich spirituell bin? Ganz einfach, weil ich lieber nach
der Formel des Weltfriedens statt nach der Weltformel suche.




More information about the ffmpeg-devel mailing list