From 2596d7261d75381e6f1f9841e86ee051a09c374e Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sat, 19 May 2012 19:20:22 +0200 Subject: [PATCH] Fix interlaced AVUI decoding. --- libavcodec/avuidec.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavcodec/avuidec.c b/libavcodec/avuidec.c index d43de33cbd..ad0c40c4b6 100644 --- a/libavcodec/avuidec.c +++ b/libavcodec/avuidec.c @@ -53,8 +53,8 @@ static int avui_decode_frame(AVCodecContext *avctx, void *data, interlaced = avctx->extradata[19] != 1; skip[0] = skip[1] = 16; if (avctx->height == 486) { - skip[0] = 8; - skip[1] = 12; + skip[0] = 10; + skip[1] = 10; } if (avpkt->size < avctx->width * (2 * avctx->height + skip[0] + skip[1]) + 4 * interlaced) { @@ -85,10 +85,17 @@ static int avui_decode_frame(AVCodecContext *avctx, void *data, for (i = 0; i < interlaced + 1; i++) { src += avctx->width * skip[i]; srca += avctx->width * skip[i]; + if (interlaced && avctx->height == 486) { + y = pic->data[0] + (1 - i) * pic->linesize[0]; + u = pic->data[1] + (1 - i) * pic->linesize[1]; + v = pic->data[2] + (1 - i) * pic->linesize[2]; + a = pic->data[3] + (1 - i) * pic->linesize[3]; + } else { y = pic->data[0] + i * pic->linesize[0]; u = pic->data[1] + i * pic->linesize[1]; v = pic->data[2] + i * pic->linesize[2]; a = pic->data[3] + i * pic->linesize[3]; + } for (j = 0; j < avctx->height >> interlaced; j++) { for (k = 0; k < avctx->width >> 1; k++) {