diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-12-27 23:51:46 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-12-27 23:51:46 +0000 |
commit | 1457ab523343e94e094ad1c60de37077f8dc5589 (patch) | |
tree | 2df86f0b66c5df4c373dec5809a1f62c563df901 /libavcodec/dsputil.h | |
parent | ac97734133a52c41825e427fd15a66f65a89d4bb (diff) | |
download | ffmpeg-1457ab523343e94e094ad1c60de37077f8dc5589.tar.gz |
qpel encoding
4mv+b frames encoding finally fixed
chroma ME
5 comparission functions for ME
b frame encoding speedup
wmv2 codec (unfinished)
user specified diamond size for EPZS
Originally committed as revision 1365 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.h')
-rw-r--r-- | libavcodec/dsputil.h | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index 29aca1ac22..b2cac91c9c 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -79,13 +79,10 @@ static void a(uint8_t *block, const uint8_t *pixels, int line_size, int h){\ /* motion estimation */ -typedef int (*op_pixels_abs_func)(UINT8 *blk1/*align width (8 or 16)*/, UINT8 *blk2/*align 1*/, int line_size); -/* -int pix_abs16x16_c(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs16x16_x2_c(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs16x16_y2_c(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs16x16_xy2_c(UINT8 *blk1, UINT8 *blk2, int lx); -*/ +typedef int (*op_pixels_abs_func)(UINT8 *blk1/*align width (8 or 16)*/, UINT8 *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/; + +typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, UINT8 *blk1/*align width (8 or 16)*/, UINT8 *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/; + typedef struct DSPContext { /* pixel ops : interface with DCT */ void (*get_pixels)(DCTELEM *block/*align 16*/, const UINT8 *pixels/*align 8*/, int line_size); @@ -98,7 +95,16 @@ typedef struct DSPContext { void (*clear_blocks)(DCTELEM *blocks/*align 16*/); int (*pix_sum)(UINT8 * pix, int line_size); int (*pix_norm1)(UINT8 * pix, int line_size); - int (*pix_norm)(UINT8 * pix1, UINT8 * pix2, int line_size); + me_cmp_func sad[2]; /* identical to pix_absAxA except additional void * */ + me_cmp_func sse[2]; + me_cmp_func hadamard8_diff[2]; + me_cmp_func dct_sad[2]; + me_cmp_func quant_psnr[2]; + int (*hadamard8_abs )(uint8_t *src, int stride, int mean); + + me_cmp_func me_cmp[11]; + me_cmp_func me_sub_cmp[11]; + me_cmp_func mb_cmp[11]; /* maybe create an array for 16/8 functions */ op_pixels_func put_pixels_tab[2][4]; @@ -109,6 +115,7 @@ typedef struct DSPContext { qpel_mc_func avg_qpel_pixels_tab[2][16]; qpel_mc_func put_no_rnd_qpel_pixels_tab[2][16]; qpel_mc_func avg_no_rnd_qpel_pixels_tab[2][16]; + qpel_mc_func put_mspel_pixels_tab[8]; op_pixels_abs_func pix_abs16x16; op_pixels_abs_func pix_abs16x16_x2; @@ -120,9 +127,8 @@ typedef struct DSPContext { op_pixels_abs_func pix_abs8x8_xy2; /* huffyuv specific */ - //FIXME note: alignment isnt guranteed currently but could be if needed void (*add_bytes)(uint8_t *dst/*align 16*/, uint8_t *src/*align 16*/, int w); - void (*diff_bytes)(uint8_t *dst/*align 16*/, uint8_t *src1/*align 16*/, uint8_t *src2/*align 16*/,int w); + void (*diff_bytes)(uint8_t *dst/*align 16*/, uint8_t *src1/*align 16*/, uint8_t *src2/*align 1*/,int w); } DSPContext; void dsputil_init(DSPContext* p, unsigned mask); @@ -156,6 +162,7 @@ static inline void emms(void) __asm __volatile ("emms;":::"memory"); } + #define emms_c() \ {\ if (mm_flags & MM_MMX)\ @@ -281,6 +288,14 @@ void ff_mdct_calc(MDCTContext *s, FFTSample *out, const FFTSample *input, FFTSample *tmp); void ff_mdct_end(MDCTContext *s); +#define WARPER88_1616(name8, name16)\ +static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride){\ + return name8(s, dst , src , stride)\ + +name8(s, dst+8 , src+8 , stride)\ + +name8(s, dst +8*stride, src +8*stride, stride)\ + +name8(s, dst+8+8*stride, src+8+8*stride, stride);\ +} + #ifndef HAVE_LRINTF /* XXX: add ISOC specific test to avoid specific BSD testing. */ /* better than nothing implementation. */ |