comparison dsputil.c @ 324:9c6f056f0e41 libavcodec

fixed mpeg4 time stuff on encoding mpeg4 b-frame enoding support removed old, out-commented ratecontrol reuse motion compensation code between encoding & decoding prefix newly added global functions with ff_ to reduce namespace polution b-frame ME (unfinished, but working) added some comments to mpegvideo.h do MC on encoding only once if possible bugs? ;)
author michaelni
date Wed, 17 Apr 2002 04:32:12 +0000
parents cda7d0857baf
children 7ac7a48fbe5e
comparison
equal deleted inserted replaced
323:68cc7650c645 324:9c6f056f0e41
25 #include "dsputil.h" 25 #include "dsputil.h"
26 #include "simple_idct.h" 26 #include "simple_idct.h"
27 27
28 void (*ff_idct)(DCTELEM *block); 28 void (*ff_idct)(DCTELEM *block);
29 void (*get_pixels)(DCTELEM *block, const UINT8 *pixels, int line_size); 29 void (*get_pixels)(DCTELEM *block, const UINT8 *pixels, int line_size);
30 void (*diff_pixels)(DCTELEM *block, const UINT8 *s1, const UINT8 *s2, int stride);
30 void (*put_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size); 31 void (*put_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
31 void (*add_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size); 32 void (*add_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
32 void (*gmc1)(UINT8 *dst, UINT8 *src, int srcStride, int h, int x16, int y16, int rounder); 33 void (*gmc1)(UINT8 *dst, UINT8 *src, int srcStride, int h, int x16, int y16, int rounder);
33 void (*clear_blocks)(DCTELEM *blocks); 34 void (*clear_blocks)(DCTELEM *blocks);
34 35
178 p[7] = pix[7]; 179 p[7] = pix[7];
179 pix += line_size; 180 pix += line_size;
180 p += 8; 181 p += 8;
181 } 182 }
182 } 183 }
184
185 void diff_pixels_c(DCTELEM *block, const UINT8 *s1, const UINT8 *s2, int stride){
186 DCTELEM *p;
187 int i;
188
189 /* read the pixels */
190 p = block;
191 for(i=0;i<8;i++) {
192 p[0] = s1[0] - s2[0];
193 p[1] = s1[1] - s2[1];
194 p[2] = s1[2] - s2[2];
195 p[3] = s1[3] - s2[3];
196 p[4] = s1[4] - s2[4];
197 p[5] = s1[5] - s2[5];
198 p[6] = s1[6] - s2[6];
199 p[7] = s1[7] - s2[7];
200 s1 += stride;
201 s2 += stride;
202 p += 8;
203 }
204 }
205
183 206
184 void put_pixels_clamped_c(const DCTELEM *block, UINT8 *pixels, int line_size) 207 void put_pixels_clamped_c(const DCTELEM *block, UINT8 *pixels, int line_size)
185 { 208 {
186 const DCTELEM *p; 209 const DCTELEM *p;
187 UINT8 *pix; 210 UINT8 *pix;
896 ff_idct = simple_idct; 919 ff_idct = simple_idct;
897 #else 920 #else
898 ff_idct = j_rev_dct; 921 ff_idct = j_rev_dct;
899 #endif 922 #endif
900 get_pixels = get_pixels_c; 923 get_pixels = get_pixels_c;
924 diff_pixels = diff_pixels_c;
901 put_pixels_clamped = put_pixels_clamped_c; 925 put_pixels_clamped = put_pixels_clamped_c;
902 add_pixels_clamped = add_pixels_clamped_c; 926 add_pixels_clamped = add_pixels_clamped_c;
903 gmc1= gmc1_c; 927 gmc1= gmc1_c;
904 clear_blocks= clear_blocks_c; 928 clear_blocks= clear_blocks_c;
905 929