diff dsputil.h @ 1708:dea5b2946999 libavcodec

interlaced motion estimation interlaced mpeg2 encoding P & B frames rate distored interlaced mb decission alternate scantable support 4mv encoding fixes (thats also why the regression tests change) passing height to most dsp functions interlaced mpeg4 encoding (no direct mode MBs yet) various related cleanups disabled old motion estimaton algorithms (log, full, ...) they will either be fixed or removed
author michael
date Tue, 30 Dec 2003 16:07:57 +0000
parents 11433ade9e06
children 39a209b0c82c
line wrap: on
line diff
--- a/dsputil.h	Tue Dec 30 15:29:38 2003 +0000
+++ b/dsputil.h	Tue Dec 30 16:07:57 2003 +0000
@@ -110,9 +110,7 @@
 
 /* motion estimation */
 
-typedef int (*op_pixels_abs_func)(uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/;
-
-typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/;
+typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size, int h)/* __attribute__ ((const))*/;
 
 
 /**
@@ -136,19 +134,21 @@
     void (*clear_blocks)(DCTELEM *blocks/*align 16*/);
     int (*pix_sum)(uint8_t * pix, int line_size);
     int (*pix_norm1)(uint8_t * pix, 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];
-    me_cmp_func bit[2];
-    me_cmp_func rd[2];
+// 16x16 8x8 4x4 2x2 16x8 8x4 4x2 8x16 4x8 2x4
+    
+    me_cmp_func sad[4]; /* identical to pix_absAxA except additional void * */
+    me_cmp_func sse[4];
+    me_cmp_func hadamard8_diff[4];
+    me_cmp_func dct_sad[4];
+    me_cmp_func quant_psnr[4];
+    me_cmp_func bit[4];
+    me_cmp_func rd[4];
     int (*hadamard8_abs )(uint8_t *src, int stride, int mean);
 
-    me_cmp_func me_pre_cmp[11];
-    me_cmp_func me_cmp[11];
-    me_cmp_func me_sub_cmp[11];
-    me_cmp_func mb_cmp[11];
+    me_cmp_func me_pre_cmp[5];
+    me_cmp_func me_cmp[5];
+    me_cmp_func me_sub_cmp[5];
+    me_cmp_func mb_cmp[5];
 
     /* maybe create an array for 16/8/4/2 functions */
     /**
@@ -226,14 +226,7 @@
     qpel_mc_func put_h264_qpel_pixels_tab[3][16];
     qpel_mc_func avg_h264_qpel_pixels_tab[3][16];
     
-    op_pixels_abs_func pix_abs16x16;
-    op_pixels_abs_func pix_abs16x16_x2;
-    op_pixels_abs_func pix_abs16x16_y2;
-    op_pixels_abs_func pix_abs16x16_xy2;
-    op_pixels_abs_func pix_abs8x8;
-    op_pixels_abs_func pix_abs8x8_x2;
-    op_pixels_abs_func pix_abs8x8_y2;
-    op_pixels_abs_func pix_abs8x8_xy2;
+    me_cmp_func pix_abs[2][4];
     
     /* huffyuv specific */
     void (*add_bytes)(uint8_t *dst/*align 16*/, uint8_t *src/*align 16*/, int w);
@@ -484,12 +477,24 @@
                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);\
+#define WARPER8_16(name8, name16)\
+static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\
+    return name8(s, dst           , src           , stride, h)\
+          +name8(s, dst+8         , src+8         , stride, h);\
+}
+
+#define WARPER8_16_SQ(name8, name16)\
+static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\
+    int score=0;\
+    score +=name8(s, dst           , src           , stride, 8);\
+    score +=name8(s, dst+8         , src+8         , stride, 8);\
+    if(h==16){\
+        dst += 8*stride;\
+        src += 8*stride;\
+        score +=name8(s, dst           , src           , stride, 8);\
+        score +=name8(s, dst+8         , src+8         , stride, 8);\
+    }\
+    return score;\
 }
 
 #ifndef HAVE_LRINTF