Mercurial > libavcodec.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
1707:027545a2fdbe | 1708:dea5b2946999 |
---|---|
108 b(block+n, pixels+n, line_size, h);\ | 108 b(block+n, pixels+n, line_size, h);\ |
109 } | 109 } |
110 | 110 |
111 /* motion estimation */ | 111 /* motion estimation */ |
112 | 112 |
113 typedef int (*op_pixels_abs_func)(uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/; | 113 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))*/; |
114 | |
115 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))*/; | |
116 | 114 |
117 | 115 |
118 /** | 116 /** |
119 * DSPContext. | 117 * DSPContext. |
120 */ | 118 */ |
134 void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy, | 132 void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy, |
135 int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height); | 133 int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height); |
136 void (*clear_blocks)(DCTELEM *blocks/*align 16*/); | 134 void (*clear_blocks)(DCTELEM *blocks/*align 16*/); |
137 int (*pix_sum)(uint8_t * pix, int line_size); | 135 int (*pix_sum)(uint8_t * pix, int line_size); |
138 int (*pix_norm1)(uint8_t * pix, int line_size); | 136 int (*pix_norm1)(uint8_t * pix, int line_size); |
139 me_cmp_func sad[2]; /* identical to pix_absAxA except additional void * */ | 137 // 16x16 8x8 4x4 2x2 16x8 8x4 4x2 8x16 4x8 2x4 |
140 me_cmp_func sse[2]; | 138 |
141 me_cmp_func hadamard8_diff[2]; | 139 me_cmp_func sad[4]; /* identical to pix_absAxA except additional void * */ |
142 me_cmp_func dct_sad[2]; | 140 me_cmp_func sse[4]; |
143 me_cmp_func quant_psnr[2]; | 141 me_cmp_func hadamard8_diff[4]; |
144 me_cmp_func bit[2]; | 142 me_cmp_func dct_sad[4]; |
145 me_cmp_func rd[2]; | 143 me_cmp_func quant_psnr[4]; |
144 me_cmp_func bit[4]; | |
145 me_cmp_func rd[4]; | |
146 int (*hadamard8_abs )(uint8_t *src, int stride, int mean); | 146 int (*hadamard8_abs )(uint8_t *src, int stride, int mean); |
147 | 147 |
148 me_cmp_func me_pre_cmp[11]; | 148 me_cmp_func me_pre_cmp[5]; |
149 me_cmp_func me_cmp[11]; | 149 me_cmp_func me_cmp[5]; |
150 me_cmp_func me_sub_cmp[11]; | 150 me_cmp_func me_sub_cmp[5]; |
151 me_cmp_func mb_cmp[11]; | 151 me_cmp_func mb_cmp[5]; |
152 | 152 |
153 /* maybe create an array for 16/8/4/2 functions */ | 153 /* maybe create an array for 16/8/4/2 functions */ |
154 /** | 154 /** |
155 * Halfpel motion compensation with rounding (a+b+1)>>1. | 155 * Halfpel motion compensation with rounding (a+b+1)>>1. |
156 * this is an array[4][4] of motion compensation funcions for 4 | 156 * this is an array[4][4] of motion compensation funcions for 4 |
224 h264_chroma_mc_func avg_h264_chroma_pixels_tab[3]; | 224 h264_chroma_mc_func avg_h264_chroma_pixels_tab[3]; |
225 | 225 |
226 qpel_mc_func put_h264_qpel_pixels_tab[3][16]; | 226 qpel_mc_func put_h264_qpel_pixels_tab[3][16]; |
227 qpel_mc_func avg_h264_qpel_pixels_tab[3][16]; | 227 qpel_mc_func avg_h264_qpel_pixels_tab[3][16]; |
228 | 228 |
229 op_pixels_abs_func pix_abs16x16; | 229 me_cmp_func pix_abs[2][4]; |
230 op_pixels_abs_func pix_abs16x16_x2; | |
231 op_pixels_abs_func pix_abs16x16_y2; | |
232 op_pixels_abs_func pix_abs16x16_xy2; | |
233 op_pixels_abs_func pix_abs8x8; | |
234 op_pixels_abs_func pix_abs8x8_x2; | |
235 op_pixels_abs_func pix_abs8x8_y2; | |
236 op_pixels_abs_func pix_abs8x8_xy2; | |
237 | 230 |
238 /* huffyuv specific */ | 231 /* huffyuv specific */ |
239 void (*add_bytes)(uint8_t *dst/*align 16*/, uint8_t *src/*align 16*/, int w); | 232 void (*add_bytes)(uint8_t *dst/*align 16*/, uint8_t *src/*align 16*/, int w); |
240 void (*diff_bytes)(uint8_t *dst/*align 16*/, uint8_t *src1/*align 16*/, uint8_t *src2/*align 1*/,int w); | 233 void (*diff_bytes)(uint8_t *dst/*align 16*/, uint8_t *src1/*align 16*/, uint8_t *src2/*align 1*/,int w); |
241 /** | 234 /** |
482 const FFTSample *input, FFTSample *tmp); | 475 const FFTSample *input, FFTSample *tmp); |
483 void ff_mdct_calc(MDCTContext *s, FFTSample *out, | 476 void ff_mdct_calc(MDCTContext *s, FFTSample *out, |
484 const FFTSample *input, FFTSample *tmp); | 477 const FFTSample *input, FFTSample *tmp); |
485 void ff_mdct_end(MDCTContext *s); | 478 void ff_mdct_end(MDCTContext *s); |
486 | 479 |
487 #define WARPER88_1616(name8, name16)\ | 480 #define WARPER8_16(name8, name16)\ |
488 static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride){\ | 481 static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\ |
489 return name8(s, dst , src , stride)\ | 482 return name8(s, dst , src , stride, h)\ |
490 +name8(s, dst+8 , src+8 , stride)\ | 483 +name8(s, dst+8 , src+8 , stride, h);\ |
491 +name8(s, dst +8*stride, src +8*stride, stride)\ | 484 } |
492 +name8(s, dst+8+8*stride, src+8+8*stride, stride);\ | 485 |
486 #define WARPER8_16_SQ(name8, name16)\ | |
487 static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\ | |
488 int score=0;\ | |
489 score +=name8(s, dst , src , stride, 8);\ | |
490 score +=name8(s, dst+8 , src+8 , stride, 8);\ | |
491 if(h==16){\ | |
492 dst += 8*stride;\ | |
493 src += 8*stride;\ | |
494 score +=name8(s, dst , src , stride, 8);\ | |
495 score +=name8(s, dst+8 , src+8 , stride, 8);\ | |
496 }\ | |
497 return score;\ | |
493 } | 498 } |
494 | 499 |
495 #ifndef HAVE_LRINTF | 500 #ifndef HAVE_LRINTF |
496 /* XXX: add ISOC specific test to avoid specific BSD testing. */ | 501 /* XXX: add ISOC specific test to avoid specific BSD testing. */ |
497 /* better than nothing implementation. */ | 502 /* better than nothing implementation. */ |