[FFmpeg-devel] [PATCH] Move mathops.h to libavutil.
Måns Rullgård
mans
Fri Nov 28 00:10:10 CET 2008
Michael Niedermayer <michaelni at gmx.at> writes:
> On Thu, Nov 27, 2008 at 01:18:05PM -0000, M?ns Rullg?rd wrote:
>>
>> Mans Rullgard wrote:
>> > ---
>> > libavcodec/lsp.c | 2 +-
>> > libavcodec/mpegaudiodec.c | 2 +-
>> > {libavcodec/armv4l => libavutil/arm}/mathops.h | 6 +++---
>> > {libavcodec => libavutil}/bfin/mathops.h | 6 +++---
>> > {libavcodec => libavutil}/mathops.h | 12 ++++++------
>> > {libavcodec => libavutil}/ppc/mathops.h | 6 +++---
>> > {libavcodec/i386 => libavutil/x86}/mathops.h | 6 +++---
>> > 7 files changed, 20 insertions(+), 20 deletions(-)
>> > rename {libavcodec/armv4l => libavutil/arm}/mathops.h (96%)
>> > rename {libavcodec => libavutil}/bfin/mathops.h (95%)
>> > rename {libavcodec => libavutil}/mathops.h (91%)
>> > rename {libavcodec => libavutil}/ppc/mathops.h (92%)
>> > rename {libavcodec/i386 => libavutil/x86}/mathops.h (93%)
>>
>> ping
>
> why should mathops be moved to libavutil?
libavutil already has a number of similar macros/functions, scattered
throughout common.h and internal.h:
FASTDIV()
FFABS()
FFSIGN()
FFMAX()
COPY3_IF_LT()
MASK_ABS()
av_log2()
av_log2_16bit()
ff_sqrt()
mid_pred()
av_clip()
av_clip_uint8()
av_clip_int16()
av_clipf()
Most, if not all, of these are only used in lavc.
IMO, it would make sense to have all elementary maths operations
defined the same place.
What criteria do you use deciding where to place a function of this
type?
> does libavutil need it, do any applications want to use it?
> Its not particularely pretty code, nor is its purpose
It's not particularly ugly either. Most of the macros are a single
statement.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list