comparison xsubdec.c @ 5491:d847cbc8756b libavcodec

Fix deinterlacing for odd height
author reimar
date Sun, 05 Aug 2007 12:11:28 +0000
parents 12d77ed34985
children 922a668222f0
comparison
equal deleted inserted replaced
5490:12d77ed34985 5491:d847cbc8756b
82 rlelen = FFMIN(rlelen, buf_end - buf); 82 rlelen = FFMIN(rlelen, buf_end - buf);
83 init_get_bits(&gb, buf, rlelen * 8); 83 init_get_bits(&gb, buf, rlelen * 8);
84 bitmap = sub->rects[0].bitmap; 84 bitmap = sub->rects[0].bitmap;
85 for (y = 0; y < h; y++) { 85 for (y = 0; y < h; y++) {
86 // interlaced: do odd lines 86 // interlaced: do odd lines
87 if (y == h / 2) bitmap = sub->rects[0].bitmap + w; 87 if (y == (h + 1) / 2) bitmap = sub->rects[0].bitmap + w;
88 for (x = 0; x < w; ) { 88 for (x = 0; x < w; ) {
89 int log2 = ff_log2_tab[show_bits(&gb, 8)]; 89 int log2 = ff_log2_tab[show_bits(&gb, 8)];
90 int run = get_bits(&gb, 14 - 4 * (log2 >> 1)); 90 int run = get_bits(&gb, 14 - 4 * (log2 >> 1));
91 int colour = get_bits(&gb, 2); 91 int colour = get_bits(&gb, 2);
92 run = FFMIN(run, w - x); 92 run = FFMIN(run, w - x);