Mercurial > libavcodec.hg
changeset 5490:12d77ed34985 libavcodec
Deinterlace xsub subtitles
author | reimar |
---|---|
date | Sun, 05 Aug 2007 12:11:26 +0000 |
parents | dc54869af30b |
children | d847cbc8756b |
files | xsubdec.c |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/xsubdec.c Sun Aug 05 12:11:24 2007 +0000 +++ b/xsubdec.c Sun Aug 05 12:11:26 2007 +0000 @@ -83,6 +83,8 @@ init_get_bits(&gb, buf, rlelen * 8); bitmap = sub->rects[0].bitmap; for (y = 0; y < h; y++) { + // interlaced: do odd lines + if (y == h / 2) bitmap = sub->rects[0].bitmap + w; for (x = 0; x < w; ) { int log2 = ff_log2_tab[show_bits(&gb, 8)]; int run = get_bits(&gb, 14 - 4 * (log2 >> 1)); @@ -94,6 +96,8 @@ bitmap += run; x += run; } + // interlaced, skip every second line + bitmap += w; align_get_bits(&gb); } *data_size = 1;