1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

avcodec/leaddec: support format 0x1006

Fixes ticket #10658.
This commit is contained in:
Peter Ross
2025-01-14 11:59:38 +11:00
parent a8f2374507
commit 16f9cfcf4b

View File

@@ -164,6 +164,10 @@ static int lead_decode_frame(AVCodecContext *avctx, AVFrame * frame,
case 0x1000: case 0x1000:
avctx->pix_fmt = AV_PIX_FMT_YUV420P; avctx->pix_fmt = AV_PIX_FMT_YUV420P;
break; break;
case 0x1006:
fields = 2;
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
break;
case 0x2000: case 0x2000:
avctx->pix_fmt = AV_PIX_FMT_YUV444P; avctx->pix_fmt = AV_PIX_FMT_YUV444P;
break; break;
@@ -237,7 +241,8 @@ static int lead_decode_frame(AVCodecContext *avctx, AVFrame * frame,
return ret; return ret;
} }
} else if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) { } else if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
for (int mb_y = 0; mb_y < (avctx->height + 15) / 16; mb_y++) for (int f = 0; f < fields; f++)
for (int mb_y = 0; mb_y < (avctx->height + 15) / 16 / fields; mb_y++)
for (int mb_x = 0; mb_x < (avctx->width + 15) / 16; mb_x++) for (int mb_x = 0; mb_x < (avctx->width + 15) / 16; mb_x++)
for (int b = 0; b < (yuv20p_half ? 4 : 6); b++) { for (int b = 0; b < (yuv20p_half ? 4 : 6); b++) {
int luma_block = yuv20p_half ? 2 : 4; int luma_block = yuv20p_half ? 2 : 4;
@@ -258,8 +263,8 @@ static int lead_decode_frame(AVCodecContext *avctx, AVFrame * frame,
ret = decode_block(s, &gb, dc_vlc, dc_bits, ac_vlc, ac_bits, ret = decode_block(s, &gb, dc_vlc, dc_bits, ac_vlc, ac_bits,
dc_pred + plane, dequant[!(b < 4)], dc_pred + plane, dequant[!(b < 4)],
frame->data[plane] + y*frame->linesize[plane] + x, frame->data[plane] + (f + y*fields)*frame->linesize[plane] + x,
(yuv20p_half && b < 2 ? 2 : 1) * frame->linesize[plane]); (yuv20p_half && b < 2 ? 2 : 1) * fields * frame->linesize[plane]);
if (ret < 0) if (ret < 0)
return ret; return ret;