summaryrefslogtreecommitdiff
path: root/libavcodec/dsputil.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2013-12-21 16:03:59 +0100
committerDiego Biurrun <diego@biurrun.de>2014-03-22 06:17:30 -0700
commit57f09608e1600d1cf1679885a46f5004d522d68f (patch)
treeddb3ce6e7d2ac7f8479add595d7212434d7ca8f7 /libavcodec/dsputil.c
parent82dd1026cfc1d72b04019185bea4c1c9621ace3f (diff)
dsputil: Move thirdpel-related bits into their own context
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r--libavcodec/dsputil.c299
1 files changed, 1 insertions, 298 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 9fe6f0b757..b81ba47521 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -48,6 +48,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
@@ -540,284 +541,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, \
@@ -2781,26 +2504,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; \