diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-23 02:26:23 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-23 02:26:23 +0400 |
commit | 9d6a27d5336550c131d2a45fc4b0e90c93e46aca (patch) | |
tree | 07fe3d8437eda2db2343a9d7d0932870e8018e8e /libavcodec/dsputil.c | |
parent | 74fed968d1b6f0aec9c08b9ac4fcad4314e0460a (diff) | |
parent | 57f09608e1600d1cf1679885a46f5004d522d68f (diff) |
Merge commit '57f09608e1600d1cf1679885a46f5004d522d68f'
* commit '57f09608e1600d1cf1679885a46f5004d522d68f':
dsputil: Move thirdpel-related bits into their own context
Conflicts:
libavcodec/svq3.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r-- | libavcodec/dsputil.c | 299 |
1 files changed, 1 insertions, 298 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index eeeda7c23c..861aa4cf35 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -50,6 +50,7 @@ uint32_t ff_square_tab[512] = { 0, }; #undef BIT_DEPTH #define BIT_DEPTH 8 +#include "tpel_template.c" #include "dsputil_template.c" // 0x7f7f7f7f or 0x7f7f7f7f7f7f7f7f or whatever, depending on the cpu's native arithmetic size @@ -604,284 +605,6 @@ void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, } } -static inline void put_tpel_pixels_mc00_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - switch (width) { - case 2: - put_pixels2_8_c(dst, src, stride, height); - break; - case 4: - put_pixels4_8_c(dst, src, stride, height); - break; - case 8: - put_pixels8_8_c(dst, src, stride, height); - break; - case 16: - put_pixels16_8_c(dst, src, stride, height); - break; - } -} - -static inline void put_tpel_pixels_mc10_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = ((2 * src[j] + src[j + 1] + 1) * - 683) >> 11; - src += stride; - dst += stride; - } -} - -static inline void put_tpel_pixels_mc20_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = ((src[j] + 2 * src[j + 1] + 1) * - 683) >> 11; - src += stride; - dst += stride; - } -} - -static inline void put_tpel_pixels_mc01_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = ((2 * src[j] + src[j + stride] + 1) * - 683) >> 11; - src += stride; - dst += stride; - } -} - -static inline void put_tpel_pixels_mc11_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = ((4 * src[j] + 3 * src[j + 1] + - 3 * src[j + stride] + 2 * src[j + stride + 1] + 6) * - 2731) >> 15; - src += stride; - dst += stride; - } -} - -static inline void put_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = ((3 * src[j] + 2 * src[j + 1] + - 4 * src[j + stride] + 3 * src[j + stride + 1] + 6) * - 2731) >> 15; - src += stride; - dst += stride; - } -} - -static inline void put_tpel_pixels_mc02_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = ((src[j] + 2 * src[j + stride] + 1) * - 683) >> 11; - src += stride; - dst += stride; - } -} - -static inline void put_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = ((3 * src[j] + 4 * src[j + 1] + - 2 * src[j + stride] + 3 * src[j + stride + 1] + 6) * - 2731) >> 15; - src += stride; - dst += stride; - } -} - -static inline void put_tpel_pixels_mc22_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = ((2 * src[j] + 3 * src[j + 1] + - 3 * src[j + stride] + 4 * src[j + stride + 1] + 6) * - 2731) >> 15; - src += stride; - dst += stride; - } -} - -static inline void avg_tpel_pixels_mc00_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - switch (width) { - case 2: - avg_pixels2_8_c(dst, src, stride, height); - break; - case 4: - avg_pixels4_8_c(dst, src, stride, height); - break; - case 8: - avg_pixels8_8_c(dst, src, stride, height); - break; - case 16: - avg_pixels16_8_c(dst, src, stride, height); - break; - } -} - -static inline void avg_tpel_pixels_mc10_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = (dst[j] + - (((2 * src[j] + src[j + 1] + 1) * - 683) >> 11) + 1) >> 1; - src += stride; - dst += stride; - } -} - -static inline void avg_tpel_pixels_mc20_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = (dst[j] + - (((src[j] + 2 * src[j + 1] + 1) * - 683) >> 11) + 1) >> 1; - src += stride; - dst += stride; - } -} - -static inline void avg_tpel_pixels_mc01_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = (dst[j] + - (((2 * src[j] + src[j + stride] + 1) * - 683) >> 11) + 1) >> 1; - src += stride; - dst += stride; - } -} - -static inline void avg_tpel_pixels_mc11_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = (dst[j] + - (((4 * src[j] + 3 * src[j + 1] + - 3 * src[j + stride] + 2 * src[j + stride + 1] + 6) * - 2731) >> 15) + 1) >> 1; - src += stride; - dst += stride; - } -} - -static inline void avg_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = (dst[j] + - (((3 * src[j] + 2 * src[j + 1] + - 4 * src[j + stride] + 3 * src[j + stride + 1] + 6) * - 2731) >> 15) + 1) >> 1; - src += stride; - dst += stride; - } -} - -static inline void avg_tpel_pixels_mc02_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = (dst[j] + - (((src[j] + 2 * src[j + stride] + 1) * - 683) >> 11) + 1) >> 1; - src += stride; - dst += stride; - } -} - -static inline void avg_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = (dst[j] + - (((3 * src[j] + 4 * src[j + 1] + - 2 * src[j + stride] + 3 * src[j + stride + 1] + 6) * - 2731) >> 15) + 1) >> 1; - src += stride; - dst += stride; - } -} - -static inline void avg_tpel_pixels_mc22_c(uint8_t *dst, const uint8_t *src, - int stride, int width, int height) -{ - int i, j; - - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) - dst[j] = (dst[j] + - (((2 * src[j] + 3 * src[j + 1] + - 3 * src[j + stride] + 4 * src[j + stride + 1] + 6) * - 2731) >> 15) + 1) >> 1; - src += stride; - dst += stride; - } -} - #define QPEL_MC(r, OPNAME, RND, OP) \ static void OPNAME ## mpeg4_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, \ int dstStride, int srcStride, \ @@ -2974,26 +2697,6 @@ av_cold void ff_dsputil_init(DSPContext *c, AVCodecContext *avctx) c->pix_abs[1][2] = pix_abs8_y2_c; c->pix_abs[1][3] = pix_abs8_xy2_c; - c->put_tpel_pixels_tab[0] = put_tpel_pixels_mc00_c; - c->put_tpel_pixels_tab[1] = put_tpel_pixels_mc10_c; - c->put_tpel_pixels_tab[2] = put_tpel_pixels_mc20_c; - c->put_tpel_pixels_tab[4] = put_tpel_pixels_mc01_c; - c->put_tpel_pixels_tab[5] = put_tpel_pixels_mc11_c; - c->put_tpel_pixels_tab[6] = put_tpel_pixels_mc21_c; - c->put_tpel_pixels_tab[8] = put_tpel_pixels_mc02_c; - c->put_tpel_pixels_tab[9] = put_tpel_pixels_mc12_c; - c->put_tpel_pixels_tab[10] = put_tpel_pixels_mc22_c; - - c->avg_tpel_pixels_tab[0] = avg_tpel_pixels_mc00_c; - c->avg_tpel_pixels_tab[1] = avg_tpel_pixels_mc10_c; - c->avg_tpel_pixels_tab[2] = avg_tpel_pixels_mc20_c; - c->avg_tpel_pixels_tab[4] = avg_tpel_pixels_mc01_c; - c->avg_tpel_pixels_tab[5] = avg_tpel_pixels_mc11_c; - c->avg_tpel_pixels_tab[6] = avg_tpel_pixels_mc21_c; - c->avg_tpel_pixels_tab[8] = avg_tpel_pixels_mc02_c; - c->avg_tpel_pixels_tab[9] = avg_tpel_pixels_mc12_c; - c->avg_tpel_pixels_tab[10] = avg_tpel_pixels_mc22_c; - #define dspfunc(PFX, IDX, NUM) \ c->PFX ## _pixels_tab[IDX][0] = PFX ## NUM ## _mc00_c; \ c->PFX ## _pixels_tab[IDX][1] = PFX ## NUM ## _mc10_c; \ |