diff mbox series

[FFmpeg-devel,v2,2/3] libavcodec/jpeg2000dec: Support for Parameterless Markers

Message ID 20200718131622.6234-2-gautamramk@gmail.com
State Accepted
Commit e39490615fcae8e9399e907a63f07aa8d0f9148d
Headers show
Series [FFmpeg-devel,v2,1/3] libavcodec/jpeg2000dec: Fix codeblock decode check
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Gautam Ramakrishnan July 18, 2020, 1:16 p.m. UTC
From: Gautam Ramakrishnan <gautamramk@gmail.com>

The JPEG2000 standard reserves marker values 0xFF30
to 0xFF3F to be used as parameterless markers. This
patch adds support to decode codestream with such
markers. This allows decoding of p0_02.j2k.
---
 libavcodec/jpeg2000dec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer July 19, 2020, 6:45 a.m. UTC | #1
On Sat, Jul 18, 2020 at 06:46:21PM +0530, gautamramk@gmail.com wrote:
> From: Gautam Ramakrishnan <gautamramk@gmail.com>
> 
> The JPEG2000 standard reserves marker values 0xFF30
> to 0xFF3F to be used as parameterless markers. This
> patch adds support to decode codestream with such
> markers. This allows decoding of p0_02.j2k.
> ---
>  libavcodec/jpeg2000dec.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

will apply

thx

[...]
Carl Eugen Hoyos July 19, 2020, 11:02 a.m. UTC | #2
Am Sa., 18. Juli 2020 um 15:16 Uhr schrieb <gautamramk@gmail.com>:
>
> From: Gautam Ramakrishnan <gautamramk@gmail.com>
>
> The JPEG2000 standard reserves marker values 0xFF30
> to 0xFF3F to be used as parameterless markers. This
> patch adds support to decode codestream with such
> markers.

> This allows decoding of p0_02.j2k.

I wonder if sample aspect ratio should be set for samples
with subsampling in the only component.

Carl Eugen
diff mbox series

Patch

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 5043125fe3..5e9e97eb6a 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -2092,7 +2092,8 @@  static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
 
         marker = bytestream2_get_be16u(&s->g);
         oldpos = bytestream2_tell(&s->g);
-
+        if (marker >= 0xFF30 && marker <= 0xFF3F)
+            continue;
         if (marker == JPEG2000_SOD) {
             Jpeg2000Tile *tile;
             Jpeg2000TilePart *tp;