From c45f629576151f05ce7010967683385d277859fe Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 5 Jul 2011 17:33:24 +0200 Subject: Rename libavcodec/high_bit_depth.h ---> libavcodec/bit_depth_template.c This naming scheme is used elsewhere, so it's sensible to be consistent. --- libavcodec/bit_depth_template.c | 106 ++++++++++++++++++++++++++++++++++++++++ libavcodec/dsputil_template.c | 2 +- libavcodec/h264dsp_template.c | 2 +- libavcodec/h264idct_template.c | 2 +- libavcodec/h264pred_template.c | 3 +- libavcodec/high_bit_depth.h | 106 ---------------------------------------- 6 files changed, 111 insertions(+), 110 deletions(-) create mode 100644 libavcodec/bit_depth_template.c delete mode 100644 libavcodec/high_bit_depth.h (limited to 'libavcodec') diff --git a/libavcodec/bit_depth_template.c b/libavcodec/bit_depth_template.c new file mode 100644 index 0000000000..c0a6eafe89 --- /dev/null +++ b/libavcodec/bit_depth_template.c @@ -0,0 +1,106 @@ +/* + * This file is part of Libav. + * + * Libav 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, + * 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 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "dsputil.h" + +#ifndef BIT_DEPTH +#define BIT_DEPTH 8 +#endif + +#ifdef AVCODEC_H264_HIGH_DEPTH_H +# undef pixel +# undef pixel2 +# undef pixel4 +# undef dctcoef +# undef INIT_CLIP +# undef no_rnd_avg_pixel4 +# undef rnd_avg_pixel4 +# undef AV_RN2P +# undef AV_RN4P +# undef AV_RN4PA +# undef AV_WN2P +# undef AV_WN4P +# undef AV_WN4PA +# undef CLIP +# undef FUNC +# undef FUNCC +# undef av_clip_pixel +# undef PIXEL_SPLAT_X4 +#else +# define AVCODEC_H264_HIGH_DEPTH_H +# define CLIP_PIXEL(depth)\ + static inline uint16_t av_clip_pixel_ ## depth (int p)\ + {\ + const int pixel_max = (1 << depth)-1;\ + return (p & ~pixel_max) ? (-p)>>31 & pixel_max : p;\ + } + +CLIP_PIXEL( 9) +CLIP_PIXEL(10) +#endif + +#if BIT_DEPTH > 8 +# define pixel uint16_t +# define pixel2 uint32_t +# define pixel4 uint64_t +# define dctcoef int32_t + +# define INIT_CLIP +# define no_rnd_avg_pixel4 no_rnd_avg64 +# define rnd_avg_pixel4 rnd_avg64 +# define AV_RN2P AV_RN32 +# define AV_RN4P AV_RN64 +# define AV_RN4PA AV_RN64A +# define AV_WN2P AV_WN32 +# define AV_WN4P AV_WN64 +# define AV_WN4PA AV_WN64A +# define PIXEL_SPLAT_X4(x) ((x)*0x0001000100010001ULL) +#else +# define pixel uint8_t +# define pixel2 uint16_t +# define pixel4 uint32_t +# define dctcoef int16_t + +# define INIT_CLIP uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; +# define no_rnd_avg_pixel4 no_rnd_avg32 +# define rnd_avg_pixel4 rnd_avg32 +# define AV_RN2P AV_RN16 +# define AV_RN4P AV_RN32 +# define AV_RN4PA AV_RN32A +# define AV_WN2P AV_WN16 +# define AV_WN4P AV_WN32 +# define AV_WN4PA AV_WN32A +# define PIXEL_SPLAT_X4(x) ((x)*0x01010101U) +#endif + +#if BIT_DEPTH == 8 +# define av_clip_pixel(a) av_clip_uint8(a) +# define CLIP(a) cm[a] +# define FUNC(a) a ## _8 +# define FUNCC(a) a ## _8_c +#elif BIT_DEPTH == 9 +# define av_clip_pixel(a) av_clip_pixel_9(a) +# define CLIP(a) av_clip_pixel_9(a) +# define FUNC(a) a ## _9 +# define FUNCC(a) a ## _9_c +#elif BIT_DEPTH == 10 +# define av_clip_pixel(a) av_clip_pixel_10(a) +# define CLIP(a) av_clip_pixel_10(a) +# define FUNC(a) a ## _10 +# define FUNCC(a) a ## _10_c +#endif diff --git a/libavcodec/dsputil_template.c b/libavcodec/dsputil_template.c index b85931856a..645a881a19 100644 --- a/libavcodec/dsputil_template.c +++ b/libavcodec/dsputil_template.c @@ -27,7 +27,7 @@ * DSP utils */ -#include "high_bit_depth.h" +#include "bit_depth_template.c" static inline void FUNC(copy_block2)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) { diff --git a/libavcodec/h264dsp_template.c b/libavcodec/h264dsp_template.c index be88f7487f..d11eff0919 100644 --- a/libavcodec/h264dsp_template.c +++ b/libavcodec/h264dsp_template.c @@ -25,7 +25,7 @@ * @author Michael Niedermayer */ -#include "high_bit_depth.h" +#include "bit_depth_template.c" #define op_scale1(x) block[x] = av_clip_pixel( (block[x]*weight + offset) >> log2_denom ) #define op_scale2(x) dst[x] = av_clip_pixel( (src[x]*weights + dst[x]*weightd + offset) >> (log2_denom+1)) diff --git a/libavcodec/h264idct_template.c b/libavcodec/h264idct_template.c index c024538db5..55c1d3a4d8 100644 --- a/libavcodec/h264idct_template.c +++ b/libavcodec/h264idct_template.c @@ -25,7 +25,7 @@ * @author Michael Niedermayer */ -#include "high_bit_depth.h" +#include "bit_depth_template.c" #ifndef AVCODEC_H264IDCT_INTERNAL_H #define AVCODEC_H264IDCT_INTERNAL_H diff --git a/libavcodec/h264pred_template.c b/libavcodec/h264pred_template.c index 1c1fe0bc31..e5d91555b8 100644 --- a/libavcodec/h264pred_template.c +++ b/libavcodec/h264pred_template.c @@ -26,7 +26,8 @@ */ #include "mathops.h" -#include "high_bit_depth.h" + +#include "bit_depth_template.c" static void FUNCC(pred4x4_vertical)(uint8_t *_src, const uint8_t *topright, int _stride){ pixel *src = (pixel*)_src; diff --git a/libavcodec/high_bit_depth.h b/libavcodec/high_bit_depth.h deleted file mode 100644 index c0a6eafe89..0000000000 --- a/libavcodec/high_bit_depth.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This file is part of Libav. - * - * Libav 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, - * 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 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "dsputil.h" - -#ifndef BIT_DEPTH -#define BIT_DEPTH 8 -#endif - -#ifdef AVCODEC_H264_HIGH_DEPTH_H -# undef pixel -# undef pixel2 -# undef pixel4 -# undef dctcoef -# undef INIT_CLIP -# undef no_rnd_avg_pixel4 -# undef rnd_avg_pixel4 -# undef AV_RN2P -# undef AV_RN4P -# undef AV_RN4PA -# undef AV_WN2P -# undef AV_WN4P -# undef AV_WN4PA -# undef CLIP -# undef FUNC -# undef FUNCC -# undef av_clip_pixel -# undef PIXEL_SPLAT_X4 -#else -# define AVCODEC_H264_HIGH_DEPTH_H -# define CLIP_PIXEL(depth)\ - static inline uint16_t av_clip_pixel_ ## depth (int p)\ - {\ - const int pixel_max = (1 << depth)-1;\ - return (p & ~pixel_max) ? (-p)>>31 & pixel_max : p;\ - } - -CLIP_PIXEL( 9) -CLIP_PIXEL(10) -#endif - -#if BIT_DEPTH > 8 -# define pixel uint16_t -# define pixel2 uint32_t -# define pixel4 uint64_t -# define dctcoef int32_t - -# define INIT_CLIP -# define no_rnd_avg_pixel4 no_rnd_avg64 -# define rnd_avg_pixel4 rnd_avg64 -# define AV_RN2P AV_RN32 -# define AV_RN4P AV_RN64 -# define AV_RN4PA AV_RN64A -# define AV_WN2P AV_WN32 -# define AV_WN4P AV_WN64 -# define AV_WN4PA AV_WN64A -# define PIXEL_SPLAT_X4(x) ((x)*0x0001000100010001ULL) -#else -# define pixel uint8_t -# define pixel2 uint16_t -# define pixel4 uint32_t -# define dctcoef int16_t - -# define INIT_CLIP uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; -# define no_rnd_avg_pixel4 no_rnd_avg32 -# define rnd_avg_pixel4 rnd_avg32 -# define AV_RN2P AV_RN16 -# define AV_RN4P AV_RN32 -# define AV_RN4PA AV_RN32A -# define AV_WN2P AV_WN16 -# define AV_WN4P AV_WN32 -# define AV_WN4PA AV_WN32A -# define PIXEL_SPLAT_X4(x) ((x)*0x01010101U) -#endif - -#if BIT_DEPTH == 8 -# define av_clip_pixel(a) av_clip_uint8(a) -# define CLIP(a) cm[a] -# define FUNC(a) a ## _8 -# define FUNCC(a) a ## _8_c -#elif BIT_DEPTH == 9 -# define av_clip_pixel(a) av_clip_pixel_9(a) -# define CLIP(a) av_clip_pixel_9(a) -# define FUNC(a) a ## _9 -# define FUNCC(a) a ## _9_c -#elif BIT_DEPTH == 10 -# define av_clip_pixel(a) av_clip_pixel_10(a) -# define CLIP(a) av_clip_pixel_10(a) -# define FUNC(a) a ## _10 -# define FUNCC(a) a ## _10_c -#endif -- cgit v1.2.3