[FFmpeg-devel] [PATCH] intmath: remove av_ctz.

Ganesh Ajjanagadde gajjanag at mit.edu
Mon Oct 12 03:30:48 CEST 2015


On Sun, Oct 11, 2015 at 9:24 PM, James Almer <jamrial at gmail.com> wrote:
> On 10/11/2015 10:12 PM, Ganesh Ajjanagadde wrote:
>> On Sun, Oct 11, 2015 at 6:04 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
>>> Hi,
>>>
>>> On Sun, Oct 11, 2015 at 5:52 PM, Andreas Cadhalpun <
>>> andreas.cadhalpun at googlemail.com> wrote:
>>>
>>>> On 11.10.2015 23:44, Ronald S. Bultje wrote:
>>>>> It's a non-installed header and only used in one place (flacenc).
>>>>> Since ff_ctz is static inline, it's fine to use that instead.
>>>>> ---
>>>>>  doc/APIchanges       |  3 ---
>>>>>  libavcodec/flacenc.c |  2 +-
>>>>>  libavutil/intmath.c  |  5 -----
>>>>>  libavutil/intmath.h  | 14 ++++++--------
>>>>>  4 files changed, 7 insertions(+), 17 deletions(-)
>>>>
>>>> Should be fine.
>>>
>>>
>>> Thanks, pushed.
>>
>> Since there is still time, and I did not think of this before, I would
>> like to replace ff_ctz with ff_ctz32. There are a couple of reasons:
>> 1. It is used with an int32 argument in flacenc.
>> 2. I can do a deBruijn optimization for this as well. With an int also
>> I could do it, but it would need some ifdefry depending on whether int
>> is 32 bit or 64 bits.
>>
>> Let me see if I understand API/ABI with respect to this proposed
>> change correctly now:
>> API is not broken, as this is not public.
>> ABI is broken, since the width of operands to ff_ctz has could change
>> from 64 to 32 bits.
>
> ABI was "broken" by removing av_ctz, since it was an exported function,
> just not part of the public API (header was never installed).

Just to make this clear: suppose (hypothetically) av_ctz was public.
If my application never used av_ctz, but I (or my distro) upgrades
libav*, then I don't need to recompile/relink my code?

> ff_ctz is an inline function on a private header. You do pretty much do
> whatever you want with it.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list