[FFmpeg-devel] [PATCH] MXF - Add jpeg2000 subdescriptor - Sponsored by INA

Cédric Le Barz clebarz at ektacom.com
Thu Jun 1 18:19:55 EEST 2023

Le 09/05/2023 à 16:28, Pierre-Anthony Lemieux a écrit :
> Couple of follow-up comments.
> - "mxf_parse_jpeg2000_frame" could be moved to one of jpeg2000 source
> files, to keep J2K parsing code together. Maybe there is a way to
> reuse jpeg2000_read_main_headers() at jpeg2000dec.c?
> - when defining the J2K descriptor items, please refer to the symbol
> name from the SMPTE registers, it make following/debugging the code a
> lot easier:
> { 0x8405,
> {0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0a,0x04,0x01,0x06,0x03,0x05,0x00,0x0
> 0,0x00}},
> /* Vertical offset from the origin of the reference grid to the left
> side of the image area */
> becomes
> { 0x8405,
> {0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0a,0x04,0x01,0x06,0x03,0x05,0x00,0x0
> 0,0x00}},
> /* YOsiz: vertical offset from the origin of the reference grid to the
> left side of the image area */
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org  with subject "unsubscribe".

Attach to this mail, is my new patch for adding jpeg2000 sub-descriptor 
in MXF file  taking into account remarks from FFmpeg community (remarks 
from Pierre-Anthony above as well as this from Tomas), i.e. :

1 - When there is a mismatch in components number, this is now process 
as an error.

2 - When defining and using the J2K descriptor items, I now refer to the 
symbol name from the SMPTE registers (X0siz, XT0siz...)

3 - As suggested, I make use of  jpeg2000_read_main_headers() in 
libavcodec. But, I let the parsing function in mxfenc.c file as all 
other parsing functions are in this file (mxf_parse_mpeg2_frame, 
mxf_parse_h264_frame...). The use of jpeg2000_read_main_headers() in 
mxfenc implies some minor modifications in jpeg2000 files :

* rename of Jpeg2000Tile structure to J2kTile in j2kenc.c (to avoid 

* move some structure declarations from jpeg2000dec.c to jpeg2000.h

* make jpeg2000_read_main_headers() function "public"


-------------- next part --------------
An embedded message was scrubbed...
From: Cedric Le Barz <clebarz at ektacom.com>
Subject: [PATCH] Add jpeg2000 subdescriptor (take into account FFmpeg community remarks).
Date: Wed, 5 Apr 2023 11:59:18 +0200
Size: 28717
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20230601/fb4733d2/attachment.eml>

More information about the ffmpeg-devel mailing list