diff options
Diffstat (limited to 'libavcodec/mathops.h')
-rw-r--r-- | libavcodec/mathops.h | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h index 7af13e19e0..46283ca444 100644 --- a/libavcodec/mathops.h +++ b/libavcodec/mathops.h @@ -3,20 +3,20 @@ * Copyright (c) 2001, 2002 Fabrice Bellard * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> et al * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVCODEC_MATHOPS_H @@ -39,8 +39,6 @@ extern const uint8_t ff_zigzag_direct[64]; # include "arm/mathops.h" #elif ARCH_AVR32 # include "avr32/mathops.h" -#elif ARCH_BFIN -# include "bfin/mathops.h" #elif ARCH_MIPS # include "mips/mathops.h" #elif ARCH_PPC @@ -123,6 +121,20 @@ static inline av_const int mid_pred(int a, int b, int c) } #endif +#ifndef median4 +#define median4 median4 +static inline av_const int median4(int a, int b, int c, int d) +{ + if (a < b) { + if (c < d) return (FFMIN(b, d) + FFMAX(a, c)) / 2; + else return (FFMIN(b, c) + FFMAX(a, d)) / 2; + } else { + if (c < d) return (FFMIN(a, d) + FFMAX(b, c)) / 2; + else return (FFMIN(a, c) + FFMAX(b, d)) / 2; + } +} +#endif + #ifndef sign_extend static inline av_const int sign_extend(int val, unsigned bits) { @@ -199,6 +211,8 @@ if ((y) < (x)) {\ # define FASTDIV(a,b) ((uint32_t)((((uint64_t)a) * ff_inverse[b]) >> 32)) #endif /* FASTDIV */ +#ifndef ff_sqrt +#define ff_sqrt ff_sqrt static inline av_const unsigned int ff_sqrt(unsigned int a) { unsigned int b; @@ -218,6 +232,7 @@ static inline av_const unsigned int ff_sqrt(unsigned int a) return b - (a < b * b); } +#endif static inline int8_t ff_u8_to_s8(uint8_t a) { |