[FFmpeg-devel] [PATCH v6 1/4] lavc: add FLIF decoding support

Lynne dev at lynne.ee
Thu Aug 27 20:49:23 EEST 2020


Aug 27, 2020, 10:17 by barsnick at gmx.net:

> On Wed, Aug 26, 2020 at 16:31:46 +0000, Anamitra Ghorui wrote:
>
>> >> +uint8_t ff_flif16_rac_read_bit(FLIF16RangeCoder *rc,
>> >> +                               uint8_t *target)
>> >> +{
>> >> +    return ff_flif16_rac_get(rc, rc->range >> 1, target);
>> >> +}
>> >
>> > If this is called often, you may want to mark it inline.
>> >
>>
>> On Nicolas George's suggestion, I had dropped the inline keyword because
>> the number of inline functions used may put stress on the memory cache.
>> I think I should only inine the "higher" functions and not the "lower"
>> functions like ff_flif16_rac_get in this case. Should I?
>>
>
> Ah, okay, I did read Nicolas's reviews, but I didn't recall this.
> Please do go with his suggestions.
>

We always inline bitstream reading functions, and this one is no different.
Its really necessary for speed, and well worth the additional binary size.
There's no memory cache gains to be had here, not with the huge
several hundred instruction lookaheads modern CPUs have had for decades,
just function call overhead and stack spillage to be saved on.
If we could only put av_always_inline on a single type of function in decoders,
it would have to be in bitstream reading, so please use that here.


More information about the ffmpeg-devel mailing list