diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-04-17 04:32:12 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-04-17 04:32:12 +0000 |
commit | 9dbcbd92e84b2cd033fa6688935ffaad4b67e64e (patch) | |
tree | 4996c809abbc01abc148d63074e321dc3437e5a9 /libavcodec/dsputil.c | |
parent | a7c02e2589ee901e0640c8e19b898ad0213fb071 (diff) | |
download | ffmpeg-9dbcbd92e84b2cd033fa6688935ffaad4b67e64e.tar.gz |
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? ;)
Originally committed as revision 403 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r-- | libavcodec/dsputil.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 0d15b2893a..54779bf008 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -27,6 +27,7 @@ void (*ff_idct)(DCTELEM *block); void (*get_pixels)(DCTELEM *block, const UINT8 *pixels, int line_size); +void (*diff_pixels)(DCTELEM *block, const UINT8 *s1, const UINT8 *s2, int stride); void (*put_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size); void (*add_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size); void (*gmc1)(UINT8 *dst, UINT8 *src, int srcStride, int h, int x16, int y16, int rounder); @@ -181,6 +182,28 @@ void get_pixels_c(DCTELEM *block, const UINT8 *pixels, int line_size) } } +void diff_pixels_c(DCTELEM *block, const UINT8 *s1, const UINT8 *s2, int stride){ + DCTELEM *p; + int i; + + /* read the pixels */ + p = block; + for(i=0;i<8;i++) { + p[0] = s1[0] - s2[0]; + p[1] = s1[1] - s2[1]; + p[2] = s1[2] - s2[2]; + p[3] = s1[3] - s2[3]; + p[4] = s1[4] - s2[4]; + p[5] = s1[5] - s2[5]; + p[6] = s1[6] - s2[6]; + p[7] = s1[7] - s2[7]; + s1 += stride; + s2 += stride; + p += 8; + } +} + + void put_pixels_clamped_c(const DCTELEM *block, UINT8 *pixels, int line_size) { const DCTELEM *p; @@ -898,6 +921,7 @@ void dsputil_init(void) ff_idct = j_rev_dct; #endif get_pixels = get_pixels_c; + diff_pixels = diff_pixels_c; put_pixels_clamped = put_pixels_clamped_c; add_pixels_clamped = add_pixels_clamped_c; gmc1= gmc1_c; |