diff dsputil.h @ 1267:85b71f9f7450 libavcodec

moving the svq3 motion compensation stuff to dsputil (this also means that existing optimized halfpel code is used now ...)
author michaelni
date Thu, 15 May 2003 23:30:03 +0000
parents 2fa34e615c76
children a979fab41ed8
line wrap: on
line diff
--- a/dsputil.h	Thu May 15 01:34:47 2003 +0000
+++ b/dsputil.h	Thu May 15 23:30:03 2003 +0000
@@ -77,6 +77,7 @@
 /* add and put pixel (decoding) */
 // blocksizes for op_pixels_func are 8x4,8x8 16x8 16x16
 typedef void (*op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int h);
+typedef void (*tpel_mc_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int w, int h);
 typedef void (*qpel_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);
 typedef void (*h264_chroma_mc_func)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x, int y);
 
@@ -146,18 +147,18 @@
     me_cmp_func me_sub_cmp[11];
     me_cmp_func mb_cmp[11];
 
-    /* maybe create an array for 16/8 functions */
+    /* maybe create an array for 16/8/4/2 functions */
     /**
      * Halfpel motion compensation with rounding (a+b+1)>>1.
-     * this is an array[2][4] of motion compensation funcions for 2 
-     * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
+     * this is an array[4][4] of motion compensation funcions for 4 
+     * horizontal blocksizes (2,4,8,16) and the 4 halfpel positions<br>
      * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
      * @param block destination where the result is stored
      * @param pixels source
      * @param line_size number of bytes in a horizontal line of block
      * @param h height
      */
-    op_pixels_func put_pixels_tab[2][4];
+    op_pixels_func put_pixels_tab[4][4];
 
     /**
      * Halfpel motion compensation with rounding (a+b+1)>>1.
@@ -194,6 +195,18 @@
      * @param h height
      */
     op_pixels_func avg_no_rnd_pixels_tab[2][4];
+    
+    /**
+     * Thirdpel motion compensation with rounding (a+b+1)>>1.
+     * this is an array[12] of motion compensation funcions for the 9 thirdpel positions<br>
+     * *pixels_tab[ xthirdpel + 4*ythirdpel ]
+     * @param block destination where the result is stored
+     * @param pixels source
+     * @param line_size number of bytes in a horizontal line of block
+     * @param h height
+     */
+    tpel_mc_func put_tpel_pixels_tab[11]; //FIXME individual func ptr per width?
+    
     qpel_mc_func put_qpel_pixels_tab[2][16];
     qpel_mc_func avg_qpel_pixels_tab[2][16];
     qpel_mc_func put_no_rnd_qpel_pixels_tab[2][16];
@@ -380,7 +393,9 @@
 
 struct unaligned_64 { uint64_t l; } __attribute__((packed));
 struct unaligned_32 { uint32_t l; } __attribute__((packed));
+struct unaligned_16 { uint16_t l; } __attribute__((packed));
 
+#define LD16(a) (((const struct unaligned_16 *) (a))->l)
 #define LD32(a) (((const struct unaligned_32 *) (a))->l)
 #define LD64(a) (((const struct unaligned_64 *) (a))->l)
 
@@ -388,6 +403,7 @@
 
 #else /* __GNUC__ */
 
+#define LD16(a) (*((uint16_t*)(a)))
 #define LD32(a) (*((uint32_t*)(a)))
 #define LD64(a) (*((uint64_t*)(a)))