[FFmpeg-devel] [PATCH]lavc/mjpegdec: Support 2:3 subsampling

Michael Niedermayer michael at niedermayer.cc
Wed Oct 17 23:12:56 EEST 2018


On Wed, Oct 17, 2018 at 09:01:30PM +0200, Carl Eugen Hoyos wrote:
> 2018-10-17 17:51 GMT+02:00, Michael Niedermayer <michael at niedermayer.cc>:
> > On Wed, Oct 17, 2018 at 12:22:51AM +0200, Carl Eugen Hoyos wrote:
> >> Hi!
> >>
> >> Attached patch allows decoding the sample from ticket #7495.
> >>
> >> Please review, Carl Eugen
> >
> >>  mjpegdec.c |   17 ++++++++++++++---
> >>  1 file changed, 14 insertions(+), 3 deletions(-)
> >> 8f0d03a533b42c35f2bd8d5bdae4dabd24b18f4c
> >> 0001-lavc-mjpegdec-Support-2-3-subsampling.patch
> >> From 0e9d2ec4e0cba36ba03a6b7470a707c0a3f88b8c Mon Sep 17 00:00:00 2001
> >> From: Carl Eugen Hoyos <ceffmpeg at gmail.com>
> >> Date: Wed, 17 Oct 2018 00:21:26 +0200
> >> Subject: [PATCH] lavc/mjpegdec: Support 2:3 subsampling.
> >>
> >> Fixes ticket #7495.
> >> ---
> >>  libavcodec/mjpegdec.c |   17 ++++++++++++++---
> >>  1 file changed, 14 insertions(+), 3 deletions(-)
> >
> > breaks
> > make -j12 fate-tdsc
> 
> New patch attached, please review.
> 
> Thank you, Carl Eugen

>  mjpegdec.c |   11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 45ffa2918d1236d99637c96f84803a646e757cab  0001-lavc-mjpegdec-Support-2-3-subsampling.patch
> From 2a8917ad5f82184c10e41be776bf3d138b676a85 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <ceffmpeg at gmail.com>
> Date: Wed, 17 Oct 2018 21:00:37 +0200
> Subject: [PATCH] lavc/mjpegdec: Support 2:3 subsampling.
> 
> Fixes ticket #7495.
> ---
>  libavcodec/mjpegdec.c |   11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> index 35ee10d..cfc5de8 100644
> --- a/libavcodec/mjpegdec.c
> +++ b/libavcodec/mjpegdec.c
> @@ -594,6 +594,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
>          s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
>          break;
>      case 0x22111100:
> +    case 0x23111100:
>      case 0x42111100:
>      case 0x24111100:
>          if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P;
> @@ -607,6 +608,10 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
>              if (s->bits > 8)
>                  goto unk_pixfmt;
>              s->upscale_v[1] = s->upscale_v[2] = 1;
> +        } else if (pix_fmt_id == 0x23111100) {
> +            if (s->bits > 8)
> +                goto unk_pixfmt;
> +            s->upscale_v[1] = s->upscale_v[2] = 2;
>          }
>          break;
>      case 0x41111100:

there remains code which does:
            if (s->upscale_v[p])
                h = (h+1)>>1;
                
didnt deeply check but doesnt this need an update or a assert upscale_v == 1 ?

no more comments from me about this patch

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20181017/cac4e756/attachment.sig>


More information about the ffmpeg-devel mailing list