diff options
Diffstat (limited to 'libavcodec/sh4/dsputil_align.c')
-rw-r--r-- | libavcodec/sh4/dsputil_align.c | 106 |
1 files changed, 9 insertions, 97 deletions
diff --git a/libavcodec/sh4/dsputil_align.c b/libavcodec/sh4/dsputil_align.c index 5c3e65ba00..b5207b7f58 100644 --- a/libavcodec/sh4/dsputil_align.c +++ b/libavcodec/sh4/dsputil_align.c @@ -233,67 +233,15 @@ if (sz==16) { \ } while(--height); \ } -#define DEFFUNC(op,rnd,xy,sz,OP_N,avgfunc) \ -static void op##_##rnd##_pixels##sz##_##xy (uint8_t * dest, const uint8_t * ref, \ - const ptrdiff_t stride, int height) \ -{ \ - switch((int)ref&3) { \ - case 0:OP_N##0(sz,rnd##_##avgfunc); return; \ - case 1:OP_N(1,sz,rnd##_##avgfunc); return; \ - case 2:OP_N(2,sz,rnd##_##avgfunc); return; \ - case 3:OP_N(3,sz,rnd##_##avgfunc); return; \ - } \ -} - -#define OP put - -DEFFUNC(put, rnd,o,8,OP_C,avg32) -DEFFUNC(put, rnd,x,8,OP_X,avg32) -DEFFUNC(put,no_rnd,x,8,OP_X,avg32) -DEFFUNC(put, rnd,y,8,OP_Y,avg32) -DEFFUNC(put,no_rnd,y,8,OP_Y,avg32) -DEFFUNC(put, rnd,xy,8,OP_XY,PACK) -DEFFUNC(put,no_rnd,xy,8,OP_XY,PACK) -DEFFUNC(put, rnd,o,16,OP_C,avg32) -DEFFUNC(put, rnd,x,16,OP_X,avg32) -DEFFUNC(put,no_rnd,x,16,OP_X,avg32) -DEFFUNC(put, rnd,y,16,OP_Y,avg32) -DEFFUNC(put,no_rnd,y,16,OP_Y,avg32) -DEFFUNC(put, rnd,xy,16,OP_XY,PACK) -DEFFUNC(put,no_rnd,xy,16,OP_XY,PACK) - -#undef OP -#define OP avg - -DEFFUNC(avg, rnd,o,8,OP_C,avg32) -DEFFUNC(avg, rnd,x,8,OP_X,avg32) -DEFFUNC(avg, rnd,y,8,OP_Y,avg32) -DEFFUNC(avg, rnd,xy,8,OP_XY,PACK) -DEFFUNC(avg, rnd,o,16,OP_C,avg32) -DEFFUNC(avg, rnd,x,16,OP_X,avg32) -DEFFUNC(avg,no_rnd,x,16,OP_X,avg32) -DEFFUNC(avg, rnd,y,16,OP_Y,avg32) -DEFFUNC(avg,no_rnd,y,16,OP_Y,avg32) -DEFFUNC(avg, rnd,xy,16,OP_XY,PACK) -DEFFUNC(avg,no_rnd,xy,16,OP_XY,PACK) - -#undef OP - -#define put_no_rnd_pixels8_o put_rnd_pixels8_o -#define put_no_rnd_pixels16_o put_rnd_pixels16_o -#define avg_no_rnd_pixels16_o avg_rnd_pixels16_o +#define put_pixels8_c ff_put_rnd_pixels8_o +#define put_pixels16_c ff_put_rnd_pixels16_o +#define avg_pixels8_c ff_avg_rnd_pixels8_o +#define avg_pixels16_c ff_avg_rnd_pixels16_o +#define put_no_rnd_pixels8_c ff_put_rnd_pixels8_o +#define put_no_rnd_pixels16_c ff_put_rnd_pixels16_o +#define avg_no_rnd_pixels16_c ff_avg_rnd_pixels16_o -#define put_pixels8_c put_rnd_pixels8_o -#define put_pixels16_c put_rnd_pixels16_o -#define avg_pixels8_c avg_rnd_pixels8_o -#define avg_pixels16_c avg_rnd_pixels16_o -#define put_no_rnd_pixels8_c put_rnd_pixels8_o -#define put_no_rnd_pixels16_c put_rnd_pixels16_o -#define avg_no_rnd_pixels16_c avg_rnd_pixels16_o - -#define QPEL - -#ifdef QPEL +#if CONFIG_HPELDSP #include "qpel.c" @@ -301,43 +249,7 @@ DEFFUNC(avg,no_rnd,xy,16,OP_XY,PACK) av_cold void ff_dsputil_init_align(DSPContext *c, AVCodecContext *avctx) { - const int high_bit_depth = avctx->bits_per_raw_sample > 8; - - if (!high_bit_depth) { - c->put_pixels_tab[0][0] = put_rnd_pixels16_o; - c->put_pixels_tab[0][1] = put_rnd_pixels16_x; - c->put_pixels_tab[0][2] = put_rnd_pixels16_y; - c->put_pixels_tab[0][3] = put_rnd_pixels16_xy; - c->put_pixels_tab[1][0] = put_rnd_pixels8_o; - c->put_pixels_tab[1][1] = put_rnd_pixels8_x; - c->put_pixels_tab[1][2] = put_rnd_pixels8_y; - c->put_pixels_tab[1][3] = put_rnd_pixels8_xy; - - c->put_no_rnd_pixels_tab[0][0] = put_no_rnd_pixels16_o; - c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x; - c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y; - c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy; - c->put_no_rnd_pixels_tab[1][0] = put_no_rnd_pixels8_o; - c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x; - c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y; - c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy; - - c->avg_pixels_tab[0][0] = avg_rnd_pixels16_o; - c->avg_pixels_tab[0][1] = avg_rnd_pixels16_x; - c->avg_pixels_tab[0][2] = avg_rnd_pixels16_y; - c->avg_pixels_tab[0][3] = avg_rnd_pixels16_xy; - c->avg_pixels_tab[1][0] = avg_rnd_pixels8_o; - c->avg_pixels_tab[1][1] = avg_rnd_pixels8_x; - c->avg_pixels_tab[1][2] = avg_rnd_pixels8_y; - c->avg_pixels_tab[1][3] = avg_rnd_pixels8_xy; - - c->avg_no_rnd_pixels_tab[0] = avg_no_rnd_pixels16_o; - c->avg_no_rnd_pixels_tab[1] = avg_no_rnd_pixels16_x; - c->avg_no_rnd_pixels_tab[2] = avg_no_rnd_pixels16_y; - c->avg_no_rnd_pixels_tab[3] = avg_no_rnd_pixels16_xy; - } - -#ifdef QPEL +#if CONFIG_HPELDSP #define dspfunc(PFX, IDX, NUM) \ c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_sh4; \ |