[FFmpeg-devel] [PATCH] get_cabac_inline_x86: Don't inline if 32-bit clang on windows

Martin Storsjö martin at martin.st
Tue Aug 17 19:08:25 EEST 2021


On Tue, 17 Aug 2021, James Almer wrote:

> On 8/17/2021 12:35 PM, Christopher Degawa wrote:
>> Fixes https://trac.ffmpeg.org/ticket/8903
>> 
>> relevant https://github.com/msys2/MINGW-packages/discussions/9258
>> 
>> Signed-off-by: Christopher Degawa <ccom at randomderp.com>
>> ---
>>   libavcodec/x86/cabac.h | 9 +++++++--
>>   1 file changed, 7 insertions(+), 2 deletions(-)
>> 
>> diff --git a/libavcodec/x86/cabac.h b/libavcodec/x86/cabac.h
>> index 53d74c541e..b046a56a6b 100644
>> --- a/libavcodec/x86/cabac.h
>> +++ b/libavcodec/x86/cabac.h
>> @@ -177,8 +177,13 @@
>>     #if HAVE_7REGS && !BROKEN_COMPILER
>>   #define get_cabac_inline get_cabac_inline_x86
>> -static av_always_inline int get_cabac_inline_x86(CABACContext *c,
>> -                                                 uint8_t *const state)
>> +static
>> +#if defined(_WIN32) && !defined(_WIN64) && defined(__clang__)
>
> Can you do some benchmarks to see how not inlining this compares to 
> simply disabling this code for this target? Because it sounds like you 
> may want to add this case to the BROKEN_COMPILER macro, and not use this 
> code at all.

FWIW, my patch for this issue last year was exactly to add this config 
combo to the broken compiler case - but I believe this is better. 
Benchmarks is of course always best. It'd be interesting also to measure 
the impact of not inlineing this in a configuration where it actually 
works as intended.

// Martin



More information about the ffmpeg-devel mailing list