History

avformat/mxfdec: fix frame wrapping detection for J2K essence container

For JPEG 2000 essence, the MXF input format module currently uses the value of byte 14 of the essence container UL to determine whether the J2K essence is clip- (byte 14 is 0x02) or frame-wrapped (byte 14 is 0x01). Otherwise it assumes an unknown wrapping. Additional wrappings are documented in SMPTE ST422:2019: 0x03: Interlaced Frame, 1 field/KLV 0x04: Interlaced Frame, 2 fields/KLV 0x05: Field-wrapped Picture Element 0x06: Frame-wrapped Picture Element And these should also be handled as frame wrapped content.

Pierre-Anthony Lemieux committed 5 years ago

Commit 74e43821 parent 610658c2 files · +7 −2Browse files

Unified · Split

2 files
  1. libavformat/mxf.h +2 −1
  2. libavformat/mxfdec.c +5 −1
libavformat/mxf.h+2−1
@@ -76,7 +76,8 @@ typedef enum { · 75 unmodified lines
76 NormalWrap = 0,76 NormalWrap = 0,
77 D10D11Wrap,77 D10D11Wrap,
78 RawAWrap,78 RawAWrap,
79 RawVWrap79 RawVWrap,
80 J2KWrap
80} MXFWrappingIndicatorType;81} MXFWrappingIndicatorType;
81 82
82typedef struct MXFLocalTagPair {83typedef struct MXFLocalTagPair {
libavformat/mxfdec.c+5−1
@@ -1411,7 +1411,7 @@ static void *mxf_resolve_strong_ref(MXFContext *mxf, UID *strong_ref, enum MXFMe · 1410 unmodified lines
1411 1411
1412static const MXFCodecUL mxf_picture_essence_container_uls[] = {1412static const MXFCodecUL mxf_picture_essence_container_uls[] = {
1413 // video essence container uls1413 // video essence container uls
1414 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0c,0x01,0x00 }, 14, AV_CODEC_ID_JPEG2000, NULL, 14 },1414 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0c,0x01,0x00 }, 14, AV_CODEC_ID_JPEG2000, NULL, 14, J2KWrap },
1415 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x10,0x60,0x01 }, 14, AV_CODEC_ID_H264, NULL, 15 }, /* H.264 */1415 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x10,0x60,0x01 }, 14, AV_CODEC_ID_H264, NULL, 15 }, /* H.264 */
1416 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x11,0x01,0x00 }, 14, AV_CODEC_ID_DNXHD, NULL, 14 }, /* VC-3 */1416 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x11,0x01,0x00 }, 14, AV_CODEC_ID_DNXHD, NULL, 14 }, /* VC-3 */
1417 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x12,0x01,0x00 }, 14, AV_CODEC_ID_VC1, NULL, 14 }, /* VC-1 */1417 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x12,0x01,0x00 }, 14, AV_CODEC_ID_VC1, NULL, 14 }, /* VC-1 */
@@ -1495,6 +1495,10 @@ static MXFWrappingScheme mxf_get_wrapping_kind(UID *essence_container_ul) · 77 unmodified lines
1495 if (val == 0x02)1495 if (val == 0x02)
1496 val = 0x01;1496 val = 0x01;
1497 break;1497 break;
1498 case J2KWrap:
1499 if (val != 0x02)
1500 val = 0x01;
1501 break;
1498 }1502 }
1499 if (val == 0x01)1503 if (val == 0x01)
1500 return FrameWrapped;1504 return FrameWrapped;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t