From: Leo Izen <leo.izen@gmail.com> To: ffmpeg-devel@ffmpeg.org Cc: Leo Izen <leo.izen@gmail.com> Subject: [FFmpeg-devel] [PATCH v3 2/3] avcodec/mjpeg: fix weird RGB-subsampled baseline JPEGs Date: Wed, 19 Apr 2023 14:11:25 -0400 Message-ID: <20230419181126.38662-3-leo.izen@gmail.com> (raw) In-Reply-To: <20230419181126.38662-1-leo.izen@gmail.com> These were broken before any of the recent RGB JPEG commits. This is an additional fix to bring them in line with the rest of the RGB jpegs, which should now all work after the previous patch. Fixes #10190. --- libavcodec/mjpegdec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 1e3ddb72fb..330c5da5a8 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -576,6 +576,12 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) if (s->adobe_transform == 0 || s->component_id[0] == 'R' && s->component_id[1] == 'G' && s->component_id[2] == 'B') { s->avctx->pix_fmt = AV_PIX_FMT_GBRP; + if (!s->progressive) { + for (int i = 0; i < 2; i++) { + FFSWAP(int, s->upscale_h[i], s->upscale_h[(i + 2) % 3]); + FFSWAP(int, s->upscale_v[i], s->upscale_v[(i + 2) % 3]); + } + } } else { s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P; s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; -- 2.40.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2023-04-19 18:12 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-04-19 18:11 [FFmpeg-devel] [PATCH v3 0/3] RGB mjpeg fixes (with FATE tests) Leo Izen 2023-04-19 18:11 ` [FFmpeg-devel] [PATCH v3 1/3] avcodec/mjpegdec: fix non-subsampled RGB JPEGs Leo Izen 2023-04-19 18:58 ` Michael Niedermayer 2023-04-19 19:23 ` Leo Izen 2023-04-19 20:37 ` Michael Niedermayer 2023-04-19 21:15 ` Leo Izen 2023-04-20 6:35 ` Caleb Etemesi 2023-04-20 9:50 ` Michael Niedermayer 2023-04-20 16:27 ` Leo Izen 2023-04-19 18:11 ` Leo Izen [this message] 2023-04-19 18:11 ` [FFmpeg-devel] [PATCH v3 3/3] fate: add tests for RGB jpegs Leo Izen 2023-04-19 18:52 ` Michael Niedermayer 2023-04-19 18:38 ` [FFmpeg-devel] [PATCH v3 0/3] RGB mjpeg fixes (with FATE tests) Michael Niedermayer
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230419181126.38662-3-leo.izen@gmail.com \ --to=leo.izen@gmail.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git