Mercurial > libavcodec.hg
diff dsputil.h @ 936:caa77cd960c0 libavcodec
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
author | michaelni |
---|---|
date | Fri, 27 Dec 2002 23:51:46 +0000 |
parents | a408778eff87 |
children | 13aec7e50c52 |
line wrap: on
line diff
--- a/dsputil.h Sun Dec 22 22:34:42 2002 +0000 +++ b/dsputil.h Fri Dec 27 23:51:46 2002 +0000 @@ -79,13 +79,10 @@ /* 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 @@ 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 @@ 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 @@ 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 @@ __asm __volatile ("emms;":::"memory"); } + #define emms_c() \ {\ if (mm_flags & MM_MMX)\ @@ -281,6 +288,14 @@ 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. */