Commit 278bd205 authored by Michael Niedermayer's avatar Michael Niedermayer Committed by Martin Storsjö

sh4: hpeldsp: Move half-pel assembly from dsputil to hpeldsp

Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent bfb41b50
......@@ -60,6 +60,8 @@ av_cold void ff_hpeldsp_init(HpelDSPContext *c, int flags)
ff_hpeldsp_init_bfin(c, flags);
if (ARCH_PPC)
ff_hpeldsp_init_ppc(c, flags);
if (ARCH_SH4)
ff_hpeldsp_init_sh4(c, flags);
if (ARCH_X86)
ff_hpeldsp_init_x86(c, flags);
}
......@@ -97,6 +97,7 @@ void ff_hpeldsp_init(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_arm(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_bfin(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_sh4(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags);
#endif /* AVCODEC_HPELDSP_H */
......@@ -3,3 +3,5 @@ OBJS += sh4/dsputil_align.o \
sh4/idct_sh4.o \
OBJS-$(CONFIG_H264CHROMA) += sh4/h264chroma_init.o \
OBJS-$(CONFIG_HPELDSP) += sh4/hpeldsp.o
......@@ -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; \
......
......@@ -25,4 +25,13 @@
void ff_idct_sh4(int16_t *block);
void ff_dsputil_init_align(DSPContext* c, AVCodecContext *avctx);
void ff_put_rnd_pixels8_o(uint8_t *dest, const uint8_t *ref,
const ptrdiff_t stride, int height);
void ff_put_rnd_pixels16_o(uint8_t *dest, const uint8_t *ref,
const ptrdiff_t stride, int height);
void ff_avg_rnd_pixels8_o (uint8_t *dest, const uint8_t *ref,
const ptrdiff_t stride, int height);
void ff_avg_rnd_pixels16_o(uint8_t *dest, const uint8_t *ref,
const ptrdiff_t stride, int height);
#endif /* AVCODEC_SH4_DSPUTIL_SH4_H */
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment