[FFmpeg-devel] [PATCH v3 1/3] avcodec/mjpegdec: fix non-subsampled RGB JPEGs

Michael Niedermayer michael at niedermayer.cc
Wed Apr 19 21:58:38 EEST 2023


On Wed, Apr 19, 2023 at 02:11:24PM -0400, Leo Izen wrote:
> The change introduced in b18a9c29713abc3a1b081de3f320ab53a47120c6
> created a regression for non-subsampled progressive RGB jpegs. This
> should fix that.
> ---
>  libavcodec/mjpegdec.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> index 01537d4774..1e3ddb72fb 100644
> --- a/libavcodec/mjpegdec.c
> +++ b/libavcodec/mjpegdec.c
> @@ -1698,7 +1698,8 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask,
>          s->h_scount[i]  = s->h_count[index];
>          s->v_scount[i]  = s->v_count[index];
>  
> -        if(nb_components == 3 && s->nb_components == 3 && s->avctx->pix_fmt == AV_PIX_FMT_GBRP)
> +        if((nb_components == 3 || nb_components == 1) && s->nb_components == 3
> +                && s->avctx->pix_fmt == AV_PIX_FMT_GBRP && !s->progressive)
>              index = (index+2)%3;

Why is progressive/!progressive special cased in all the new RGB code ?

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Whats the most studid thing your enemy could do ? Blow himself up
Whats the most studid thing you could do ? Give up your rights and
freedom because your enemy blew himself up.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20230419/d8c90ac9/attachment.sig>


More information about the ffmpeg-devel mailing list