Commit 4bdec0e7 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '278bd205'

* commit '278bd205':
  sh4: hpeldsp: Move half-pel assembly from dsputil to hpeldsp

Conflicts:
	libavcodec/hpeldsp.c
	libavcodec/hpeldsp.h
	libavcodec/sh4/dsputil_align.c
	libavcodec/sh4/dsputil_sh4.h
	libavcodec/sh4/hpeldsp.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents c5a11ab6 278bd205
...@@ -233,18 +233,6 @@ if (sz==16) { \ ...@@ -233,18 +233,6 @@ if (sz==16) { \
} while(--height); \ } 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 put_pixels8_c ff_put_rnd_pixels8_o #define put_pixels8_c ff_put_rnd_pixels8_o
#define put_pixels16_c ff_put_rnd_pixels16_o #define put_pixels16_c ff_put_rnd_pixels16_o
#define avg_pixels8_c ff_avg_rnd_pixels8_o #define avg_pixels8_c ff_avg_rnd_pixels8_o
...@@ -253,7 +241,7 @@ static void op##_##rnd##_pixels##sz##_##xy (uint8_t * dest, const uint8_t * ref, ...@@ -253,7 +241,7 @@ static void op##_##rnd##_pixels##sz##_##xy (uint8_t * dest, const uint8_t * ref,
#define put_no_rnd_pixels16_c ff_put_rnd_pixels16_o #define put_no_rnd_pixels16_c ff_put_rnd_pixels16_o
#define avg_no_rnd_pixels16_c ff_avg_rnd_pixels16_o #define avg_no_rnd_pixels16_c ff_avg_rnd_pixels16_o
#if CONFIG_H264QPEL #if CONFIG_HPELDSP
#include "qpel.c" #include "qpel.c"
...@@ -261,9 +249,7 @@ static void op##_##rnd##_pixels##sz##_##xy (uint8_t * dest, const uint8_t * ref, ...@@ -261,9 +249,7 @@ static void op##_##rnd##_pixels##sz##_##xy (uint8_t * dest, const uint8_t * ref,
av_cold void ff_dsputil_init_align(DSPContext *c, AVCodecContext *avctx) av_cold void ff_dsputil_init_align(DSPContext *c, AVCodecContext *avctx)
{ {
const int high_bit_depth = avctx->bits_per_raw_sample > 8; #if CONFIG_HPELDSP
#if CONFIG_H264QPEL
#define dspfunc(PFX, IDX, NUM) \ #define dspfunc(PFX, IDX, NUM) \
c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_sh4; \ c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_sh4; \
......
...@@ -26,9 +26,13 @@ ...@@ -26,9 +26,13 @@
void ff_idct_sh4(int16_t *block); void ff_idct_sh4(int16_t *block);
void ff_dsputil_init_align(DSPContext* c, AVCodecContext *avctx); void ff_dsputil_init_align(DSPContext* c, AVCodecContext *avctx);
void ff_put_rnd_pixels8_o (uint8_t * dest, const uint8_t * ref, const int stride, int height); void ff_put_rnd_pixels8_o(uint8_t *dest, const uint8_t *ref,
void ff_put_rnd_pixels16_o(uint8_t * dest, const uint8_t * ref, const int stride, int height); const ptrdiff_t stride, int height);
void ff_avg_rnd_pixels8_o (uint8_t * dest, const uint8_t * ref, const int stride, int height); void ff_put_rnd_pixels16_o(uint8_t *dest, const uint8_t *ref,
void ff_avg_rnd_pixels16_o(uint8_t * dest, const uint8_t * ref, const int stride, int height); 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 */ #endif /* AVCODEC_SH4_DSPUTIL_SH4_H */
...@@ -20,10 +20,12 @@ ...@@ -20,10 +20,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavutil/attributes.h"
#include "libavcodec/avcodec.h" #include "libavcodec/avcodec.h"
#include "libavcodec/dsputil.h" #include "libavcodec/dsputil.h"
#include "libavcodec/bit_depth_template.c" // for BYTE_VEC32 #include "libavcodec/bit_depth_template.c" // for BYTE_VEC32
#include "libavcodec/hpeldsp.h"
#include "libavcodec/rnd_avg.h"
#include "dsputil_sh4.h" #include "dsputil_sh4.h"
...@@ -69,7 +71,8 @@ ...@@ -69,7 +71,8 @@
#define OP put #define OP put
static void put_pixels4_c(uint8_t *dest,const uint8_t *ref, const int stride,int height) static void put_pixels4_c(uint8_t *dest, const uint8_t *ref,
const int stride, int height)
{ {
switch((int)ref&3){ switch((int)ref&3){
case 0: OP_C40(); return; case 0: OP_C40(); return;
...@@ -82,7 +85,8 @@ static void put_pixels4_c(uint8_t *dest,const uint8_t *ref, const int stride,int ...@@ -82,7 +85,8 @@ static void put_pixels4_c(uint8_t *dest,const uint8_t *ref, const int stride,int
#undef OP #undef OP
#define OP avg #define OP avg
static void avg_pixels4_c(uint8_t *dest,const uint8_t *ref, const int stride,int height) static void avg_pixels4_c(uint8_t *dest, const uint8_t *ref,
const int stride, int height)
{ {
switch((int)ref&3){ switch((int)ref&3){
case 0: OP_C40(); return; case 0: OP_C40(); return;
...@@ -261,9 +265,9 @@ if (sz==16) { \ ...@@ -261,9 +265,9 @@ if (sz==16) { \
} while(--height); \ } while(--height); \
} }
#define DEFFUNC(prefix, op,rnd,xy,sz,OP_N,avgfunc) \ #define DEFFUNC(prefix, op, rnd, xy, sz, OP_N, avgfunc) \
prefix void op##_##rnd##_pixels##sz##_##xy (uint8_t * dest, const uint8_t * ref, \ prefix void op##_##rnd##_pixels##sz##_##xy(uint8_t *dest, const uint8_t *ref, \
const int stride, int height) \ const ptrdiff_t stride, int height) \
{ \ { \
switch((int)ref&3) { \ switch((int)ref&3) { \
case 0:OP_N##0(sz,rnd##_##avgfunc); return; \ case 0:OP_N##0(sz,rnd##_##avgfunc); return; \
...@@ -311,37 +315,37 @@ DEFFUNC(static,avg,no_rnd,xy,16,OP_XY,PACK) ...@@ -311,37 +315,37 @@ DEFFUNC(static,avg,no_rnd,xy,16,OP_XY,PACK)
#define ff_put_no_rnd_pixels16_o ff_put_rnd_pixels16_o #define ff_put_no_rnd_pixels16_o ff_put_rnd_pixels16_o
#define ff_avg_no_rnd_pixels16_o ff_avg_rnd_pixels16_o #define ff_avg_no_rnd_pixels16_o ff_avg_rnd_pixels16_o
void ff_hpeldsp_init_sh4(HpelDSPContext* c, int flags) av_cold void ff_hpeldsp_init_sh4(HpelDSPContext *c, int flags)
{ {
c->put_pixels_tab[0][0] = ff_put_rnd_pixels16_o; c->put_pixels_tab[0][0] = ff_put_rnd_pixels16_o;
c->put_pixels_tab[0][1] = put_rnd_pixels16_x; 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][2] = put_rnd_pixels16_y;
c->put_pixels_tab[0][3] = put_rnd_pixels16_xy; c->put_pixels_tab[0][3] = put_rnd_pixels16_xy;
c->put_pixels_tab[1][0] = ff_put_rnd_pixels8_o; c->put_pixels_tab[1][0] = ff_put_rnd_pixels8_o;
c->put_pixels_tab[1][1] = put_rnd_pixels8_x; 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][2] = put_rnd_pixels8_y;
c->put_pixels_tab[1][3] = put_rnd_pixels8_xy; c->put_pixels_tab[1][3] = put_rnd_pixels8_xy;
c->put_no_rnd_pixels_tab[0][0] = ff_put_no_rnd_pixels16_o; c->put_no_rnd_pixels_tab[0][0] = ff_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][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][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[0][3] = put_no_rnd_pixels16_xy;
c->put_no_rnd_pixels_tab[1][0] = ff_put_no_rnd_pixels8_o; c->put_no_rnd_pixels_tab[1][0] = ff_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][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][2] = put_no_rnd_pixels8_y;
c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy; c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy;
c->avg_pixels_tab[0][0] = ff_avg_rnd_pixels16_o; c->avg_pixels_tab[0][0] = ff_avg_rnd_pixels16_o;
c->avg_pixels_tab[0][1] = avg_rnd_pixels16_x; 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][2] = avg_rnd_pixels16_y;
c->avg_pixels_tab[0][3] = avg_rnd_pixels16_xy; c->avg_pixels_tab[0][3] = avg_rnd_pixels16_xy;
c->avg_pixels_tab[1][0] = ff_avg_rnd_pixels8_o; c->avg_pixels_tab[1][0] = ff_avg_rnd_pixels8_o;
c->avg_pixels_tab[1][1] = avg_rnd_pixels8_x; 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][2] = avg_rnd_pixels8_y;
c->avg_pixels_tab[1][3] = avg_rnd_pixels8_xy; c->avg_pixels_tab[1][3] = avg_rnd_pixels8_xy;
c->avg_no_rnd_pixels_tab[0] = ff_avg_no_rnd_pixels16_o; c->avg_no_rnd_pixels_tab[0] = ff_avg_no_rnd_pixels16_o;
c->avg_no_rnd_pixels_tab[1] = avg_no_rnd_pixels16_x; 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[2] = avg_no_rnd_pixels16_y;
c->avg_no_rnd_pixels_tab[3] = avg_no_rnd_pixels16_xy; c->avg_no_rnd_pixels_tab[3] = avg_no_rnd_pixels16_xy;
} }
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