summaryrefslogtreecommitdiff
path: root/libavcodec/xsubdec.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2007-08-05 12:11:26 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2007-08-05 12:11:26 +0000
commit3c247b4ff76a5e93ea18a7b0817fdf598bb38757 (patch)
tree0c0c40c5d0ac0faec3a307cfecab14f228f75713 /libavcodec/xsubdec.c
parent3143c78716007c84f879c95e49c482805d25a2f6 (diff)
Deinterlace xsub subtitles
Originally committed as revision 9941 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/xsubdec.c')
-rw-r--r--libavcodec/xsubdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c
index 134eb9ab03..9a90bf4fdf 100644
--- a/libavcodec/xsubdec.c
+++ b/libavcodec/xsubdec.c
@@ -83,6 +83,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
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 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
bitmap += run;
x += run;
}
+ // interlaced, skip every second line
+ bitmap += w;
align_get_bits(&gb);
}
*data_size = 1;