Opened 11 months ago

Last modified 11 months ago

#10300 open defect

JPEG2000 encoder produce corrupted output

Reported by: inganault Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: j2k
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

The JPEG2000 encoder produce output image with apparent artifact for some input files.

How to reproduce:

ffmpeg -i corrupt_j2k.y4m test.jp2 && ffmpeg -i test.jp2 test.jpg

The file corrupt_j2k.y4m (yuv420p) is attached.
Converting the corrupt_j2k.y4m to yuv422p and yuv444p also trigger the bug.

What I have tried:

Encoder Commit Status
libopenjpeg b4eca5c (git-master) not affected
avcodec jpeg2000 b4eca5c (git-master) affected
avcodec jpeg2000 341064d (libavcodec/jpeg2000: fix tag tree reset) affected
avcodec jpeg2000 f0e3311 (libavcodec/j2kenc: Support for multiple layers) not affected

Attachments (2)

corrupt_j2k.y4m (1.5 MB ) - added by inganault 11 months ago.
corrupt_j2k.jp2 (578.5 KB ) - added by inganault 11 months ago.
the output file with artifact

Change History (4)

by inganault, 11 months ago

Attachment: corrupt_j2k.y4m added

by inganault, 11 months ago

Attachment: corrupt_j2k.jp2 added

the output file with artifact

comment:1 by Balling, 11 months ago

Status: newopen

So what you are saying is 341064d68a134e2fb3dd35f8f5b50c6df8506c10 is the regression commit cause previous commit is not affected. Lets check openjpeg decoder with your output (it is bitperfect with mine, except for one byte in ffmpeg version).

ffmpeg.exe -c:v libopenjpeg -i defchwae.jp2 cxanvcadcv.png

Produces same corrupt output, in fact so does opj_decompress.exe -i corrupt_j2k.jp2 -o fasfafas2121.png

So the bug is in encoder.

Last edited 11 months ago by Balling (previous) (diff)

comment:2 by Balling, 11 months ago

Here [jpeg2000 @ 00000292f9557740] bpno became invalid is no longer present after the fix here (in encoder, so need to encode again files): #5360

but the bug is still there.

Also you can use ffmpeg.exe -i corrupt_j2k.y4m -pred 1 tes231231t.jp2

Last edited 11 months ago by Balling (previous) (diff)
Note: See TracTickets for help on using tickets.