Commit 1654ca7d authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mjpegdec: fix rounding of chroma_height

Fixes green line at the bottom
Fixes Ticket3913
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c7011789
...@@ -468,7 +468,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) ...@@ -468,7 +468,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
else else
goto unk_pixfmt; goto unk_pixfmt;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
s->chroma_height = s->height / 2; s->chroma_height = (s->height + 1) / 2;
break; break;
case 0x11000000: case 0x11000000:
case 0x13000000: case 0x13000000:
...@@ -492,7 +492,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) ...@@ -492,7 +492,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
else else
goto unk_pixfmt; goto unk_pixfmt;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
s->chroma_height = s->height / 2; s->chroma_height = (s->height + 1) / 2;
break; break;
case 0x21111100: case 0x21111100:
if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P; if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
...@@ -513,7 +513,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) ...@@ -513,7 +513,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
if (pix_fmt_id == 0x42111100) { if (pix_fmt_id == 0x42111100) {
s->upscale_h = 6; s->upscale_h = 6;
s->chroma_height = s->height / 2; s->chroma_height = (s->height + 1) / 2;
} }
break; break;
case 0x41111100: case 0x41111100:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment