diff options
author | David Conrad <lessen42@gmail.com> | 2010-07-11 22:52:51 +0000 |
---|---|---|
committer | David Conrad <lessen42@gmail.com> | 2010-07-11 22:52:51 +0000 |
commit | fca58a815aa242e707b22db3fce1da44a50ffcd4 (patch) | |
tree | 4b5bbd7e94101074060ac9d47674f1a2d029807d | |
parent | 3683b7e5700c1cf99b1c699030ad150fb3731c76 (diff) | |
download | ffmpeg-fca58a815aa242e707b22db3fce1da44a50ffcd4.tar.gz |
vc1: Fix ordering of loop filter for I/B frames
All horizontal edges must be filtered before all vertical edges
Originally committed as revision 24206 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/vc1dec.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 0d21e1c1a5..8c9cbcd9db 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -162,17 +162,27 @@ enum Imode { static void vc1_loop_filter_iblk(MpegEncContext *s, int pq) { - int i, j; - if(!s->first_slice_line) + int j; + if (!s->first_slice_line) { s->dsp.vc1_v_loop_filter16(s->dest[0], s->linesize, pq); - s->dsp.vc1_v_loop_filter16(s->dest[0] + 8*s->linesize, s->linesize, pq); - for(i = !s->mb_x*8; i < 16; i += 8) - s->dsp.vc1_h_loop_filter16(s->dest[0] + i, s->linesize, pq); - for(j = 0; j < 2; j++){ - if(!s->first_slice_line) + if (s->mb_x) + s->dsp.vc1_h_loop_filter16(s->dest[0] - 16*s->linesize, s->linesize, pq); + s->dsp.vc1_h_loop_filter16(s->dest[0] - 16*s->linesize+8, s->linesize, pq); + for(j = 0; j < 2; j++){ s->dsp.vc1_v_loop_filter8(s->dest[j+1], s->uvlinesize, pq); - if(s->mb_x) - s->dsp.vc1_h_loop_filter8(s->dest[j+1], s->uvlinesize, pq); + if (s->mb_x) + s->dsp.vc1_h_loop_filter8(s->dest[j+1]-8*s->uvlinesize, s->uvlinesize, pq); + } + } + s->dsp.vc1_v_loop_filter16(s->dest[0] + 8*s->linesize, s->linesize, pq); + + if (s->mb_y == s->mb_height-1) { + if (s->mb_x) { + s->dsp.vc1_h_loop_filter16(s->dest[0], s->linesize, pq); + s->dsp.vc1_h_loop_filter8(s->dest[1], s->uvlinesize, pq); + s->dsp.vc1_h_loop_filter8(s->dest[2], s->uvlinesize, pq); + } + s->dsp.vc1_h_loop_filter16(s->dest[0] + 8, s->linesize, pq); } } |