* [FFmpeg-devel] [PATCH] avcodec/mjpegdec: fix regression with baseline RGB JPEGs
@ 2023-04-13 12:45 Leo Izen
2023-04-17 14:47 ` Leo Izen
2023-04-19 18:30 ` Michael Niedermayer
0 siblings, 2 replies; 5+ messages in thread
From: Leo Izen @ 2023-04-13 12:45 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Leo Izen
Commit b18a9c29713abc3a1b081de3f320ab53a47120c6 introduced a regression
that broke some baseline RGB jpegs. (See Trac issue #4045). This fixes
that.
Signed-off-by: Leo Izen <leo.izen@gmail.com>
---
libavcodec/mjpegdec.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 3fc18aac73..01537d4774 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1698,6 +1698,9 @@ 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)
+ index = (index+2)%3;
+
s->comp_index[i] = index;
s->dc_index[i] = get_bits(&s->gb, 4);
@@ -2721,7 +2724,7 @@ the_end:
}
}
- if (s->avctx->pix_fmt == AV_PIX_FMT_GBRP) {
+ if (s->avctx->pix_fmt == AV_PIX_FMT_GBRP && s->progressive) {
av_assert0(s->nb_components == 3);
FFSWAP(uint8_t *, frame->data[0], frame->data[2]);
FFSWAP(uint8_t *, frame->data[0], frame->data[1]);
--
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] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/mjpegdec: fix regression with baseline RGB JPEGs
2023-04-13 12:45 [FFmpeg-devel] [PATCH] avcodec/mjpegdec: fix regression with baseline RGB JPEGs Leo Izen
@ 2023-04-17 14:47 ` Leo Izen
2023-04-19 18:30 ` Michael Niedermayer
1 sibling, 0 replies; 5+ messages in thread
From: Leo Izen @ 2023-04-17 14:47 UTC (permalink / raw)
To: FFmpeg Development
On 4/13/23 08:45, Leo Izen wrote:
> Commit b18a9c29713abc3a1b081de3f320ab53a47120c6 introduced a regression
> that broke some baseline RGB jpegs. (See Trac issue #4045). This fixes
> that.
>
> Signed-off-by: Leo Izen <leo.izen@gmail.com>
> ---
Pushed as c3625ccfcd74bacff2ec6764dea8ef2beb5e9ef7.
- Leo Izen (Traneptora / thebombzen)
_______________________________________________
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] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/mjpegdec: fix regression with baseline RGB JPEGs
2023-04-13 12:45 [FFmpeg-devel] [PATCH] avcodec/mjpegdec: fix regression with baseline RGB JPEGs Leo Izen
2023-04-17 14:47 ` Leo Izen
@ 2023-04-19 18:30 ` Michael Niedermayer
2023-04-19 18:33 ` Michael Niedermayer
1 sibling, 1 reply; 5+ messages in thread
From: Michael Niedermayer @ 2023-04-19 18:30 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 736 bytes --]
On Thu, Apr 13, 2023 at 08:45:06AM -0400, Leo Izen wrote:
> Commit b18a9c29713abc3a1b081de3f320ab53a47120c6 introduced a regression
> that broke some baseline RGB jpegs. (See Trac issue #4045). This fixes
> that.
>
> Signed-off-by: Leo Izen <leo.izen@gmail.com>
> ---
> libavcodec/mjpegdec.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
Breaks:
./ffplay tickets/1651/prog_rgb_2.jpg
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The day soldiers stop bringing you their problems is the day you have stopped
leading them. They have either lost confidence that you can help or concluded
you do not care. Either case is a failure of leadership. - Colin Powell
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/mjpegdec: fix regression with baseline RGB JPEGs
2023-04-19 18:30 ` Michael Niedermayer
@ 2023-04-19 18:33 ` Michael Niedermayer
2023-04-19 19:36 ` Leo Izen
0 siblings, 1 reply; 5+ messages in thread
From: Michael Niedermayer @ 2023-04-19 18:33 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 925 bytes --]
On Wed, Apr 19, 2023 at 08:30:13PM +0200, Michael Niedermayer wrote:
> On Thu, Apr 13, 2023 at 08:45:06AM -0400, Leo Izen wrote:
> > Commit b18a9c29713abc3a1b081de3f320ab53a47120c6 introduced a regression
> > that broke some baseline RGB jpegs. (See Trac issue #4045). This fixes
> > that.
> >
> > Signed-off-by: Leo Izen <leo.izen@gmail.com>
> > ---
> > libavcodec/mjpegdec.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
>
> Breaks:
> ./ffplay tickets/1651/prog_rgb_2.jpg
also this:
tickets/850/sequential_RGB_24bpp.jpg
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/mjpegdec: fix regression with baseline RGB JPEGs
2023-04-19 18:33 ` Michael Niedermayer
@ 2023-04-19 19:36 ` Leo Izen
0 siblings, 0 replies; 5+ messages in thread
From: Leo Izen @ 2023-04-19 19:36 UTC (permalink / raw)
To: ffmpeg-devel
On 4/19/23 14:33, Michael Niedermayer wrote:
> On Wed, Apr 19, 2023 at 08:30:13PM +0200, Michael Niedermayer wrote:
>> On Thu, Apr 13, 2023 at 08:45:06AM -0400, Leo Izen wrote:
>>> Commit b18a9c29713abc3a1b081de3f320ab53a47120c6 introduced a regression
>>> that broke some baseline RGB jpegs. (See Trac issue #4045). This fixes
>>> that.
>>>
>>> Signed-off-by: Leo Izen <leo.izen@gmail.com>
>>> ---
>>> libavcodec/mjpegdec.c | 5 ++++-
>>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> Breaks:
>> ./ffplay tickets/1651/prog_rgb_2.jpg
>
> also this:
> tickets/850/sequential_RGB_24bpp.jpg
>
> [...]
>
>
> _______________________________________________
> 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".
I tested both of these against the patch v3 sent earlier today and both
work with that.
- Leo Izen (Traneptora / thebombzen)
_______________________________________________
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] 5+ messages in thread
end of thread, other threads:[~2023-04-19 19:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13 12:45 [FFmpeg-devel] [PATCH] avcodec/mjpegdec: fix regression with baseline RGB JPEGs Leo Izen
2023-04-17 14:47 ` Leo Izen
2023-04-19 18:30 ` Michael Niedermayer
2023-04-19 18:33 ` Michael Niedermayer
2023-04-19 19:36 ` 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