diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-05-30 21:21:13 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-05-30 21:21:13 +0000 |
commit | fdbbf2e0fc1bb91a5d735a49f39337eb172e68a7 (patch) | |
tree | 173022230073f2bcc7d1d3f09bff1fe38168df48 /libavcodec/h261.c | |
parent | c6148de2320739d4443fa702f78eac68fc0ab044 (diff) | |
download | ffmpeg-fdbbf2e0fc1bb91a5d735a49f39337eb172e68a7.tar.gz |
rewrite h261 loop filter
no malloc(64) memcpy free stuff
no filter1 A->B then filter2 A->B (yes not B->A)
no incorrect rouding after the 1d filter
Originally committed as revision 3177 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h261.c')
-rw-r--r-- | libavcodec/h261.c | 45 |
1 files changed, 7 insertions, 38 deletions
diff --git a/libavcodec/h261.c b/libavcodec/h261.c index 236fd8a3ca..6ec8de630a 100644 --- a/libavcodec/h261.c +++ b/libavcodec/h261.c @@ -64,44 +64,13 @@ void ff_h261_loop_filter(H261Context * h){ uint8_t *dest_y = s->dest[0]; uint8_t *dest_cb= s->dest[1]; uint8_t *dest_cr= s->dest[2]; - uint8_t *src; - - CHECKED_ALLOCZ((src),sizeof(uint8_t) * 64 ); - - for(i=0; i<8;i++) - memcpy(src+i*8,dest_y+i*linesize,sizeof(uint8_t) * 8 ); - s->dsp.h261_v_loop_filter(dest_y, src, linesize); - s->dsp.h261_h_loop_filter(dest_y, src, linesize); - - for(i=0; i<8;i++) - memcpy(src+i*8,dest_y+i*linesize + 8,sizeof(uint8_t) * 8 ); - s->dsp.h261_v_loop_filter(dest_y + 8, src, linesize); - s->dsp.h261_h_loop_filter(dest_y + 8, src, linesize); - - for(i=0; i<8;i++) - memcpy(src+i*8,dest_y+(i+8)*linesize,sizeof(uint8_t) * 8 ); - s->dsp.h261_v_loop_filter(dest_y + 8 * linesize, src, linesize); - s->dsp.h261_h_loop_filter(dest_y + 8 * linesize, src, linesize); - - for(i=0; i<8;i++) - memcpy(src+i*8,dest_y+(i+8)*linesize + 8,sizeof(uint8_t) * 8 ); - s->dsp.h261_v_loop_filter(dest_y + 8 * linesize + 8, src, linesize); - s->dsp.h261_h_loop_filter(dest_y + 8 * linesize + 8, src, linesize); - - for(i=0; i<8;i++) - memcpy(src+i*8,dest_cb+i*uvlinesize,sizeof(uint8_t) * 8 ); - s->dsp.h261_v_loop_filter(dest_cb, src, uvlinesize); - s->dsp.h261_h_loop_filter(dest_cb, src, uvlinesize); - - for(i=0; i<8;i++) - memcpy(src+i*8,dest_cr+i*uvlinesize,sizeof(uint8_t) * 8 ); - s->dsp.h261_v_loop_filter(dest_cr, src, uvlinesize); - s->dsp.h261_h_loop_filter(dest_cr, src, uvlinesize); - -fail: - av_free(src); - - return; + + s->dsp.h261_loop_filter(dest_y , linesize); + s->dsp.h261_loop_filter(dest_y + 8, linesize); + s->dsp.h261_loop_filter(dest_y + 8 * linesize , linesize); + s->dsp.h261_loop_filter(dest_y + 8 * linesize + 8, linesize); + s->dsp.h261_loop_filter(dest_cb, uvlinesize); + s->dsp.h261_loop_filter(dest_cr, uvlinesize); } static int h261_decode_block(H261Context *h, DCTELEM *block, |