Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 0/1] RGB mjpeg fixes
@ 2023-04-17 19:29 Leo Izen
  2023-04-17 19:29 ` [FFmpeg-devel] [PATCH 1/1] avcodec/mjpegdec: fix non-subsampled RGB JPEGs Leo Izen
  0 siblings, 1 reply; 2+ messages in thread
From: Leo Izen @ 2023-04-17 19:29 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Leo Izen

This should fix the other regression.

Fate tests will be sent to the ML soon, once samples are uploaded and tested.

Leo Izen (1):
  avcodec/mjpegdec: fix non-subsampled RGB JPEGs

 libavcodec/mjpegdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
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".

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [FFmpeg-devel] [PATCH 1/1] avcodec/mjpegdec: fix non-subsampled RGB JPEGs
  2023-04-17 19:29 [FFmpeg-devel] [PATCH 0/1] RGB mjpeg fixes Leo Izen
@ 2023-04-17 19:29 ` Leo Izen
  0 siblings, 0 replies; 2+ messages in thread
From: Leo Izen @ 2023-04-17 19:29 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Leo Izen

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;
 
         s->comp_index[i] = index;
-- 
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".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-17 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-17 19:29 [FFmpeg-devel] [PATCH 0/1] RGB mjpeg fixes Leo Izen
2023-04-17 19:29 ` [FFmpeg-devel] [PATCH 1/1] avcodec/mjpegdec: fix non-subsampled RGB JPEGs Leo Izen

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