Philip de Nier <[email protected]> added the comment:

Patch #5:

Requires patch #4.

Add support for 10-bit v210 uncompressed picture. Also added the 8-bit picture
essence coding label from s377m-2009, in addition to the 10-bit label, which
signals the uyvy 4:2:2 format.

_____________________________________________________
FFmpeg issue tracker <[email protected]>
<https://roundup.ffmpeg.org/roundup/ffmpeg/issue1470>
_____________________________________________________
Index: libavformat/mxfdec.c
===================================================================
--- libavformat/mxfdec.c	(revision 21481)
+++ libavformat/mxfdec.c	(working copy)
@@ -815,10 +815,18 @@
             st->codec->width = descriptor->width;
             st->codec->height = descriptor->height;
             st->need_parsing = AVSTREAM_PARSE_HEADERS;
-            if (st->codec->codec_id == CODEC_ID_RAWVIDEO) {
+            if (st->codec->codec_id == CODEC_ID_RAWVIDEO || st->codec->codec_id == CODEC_ID_V210) {
                 st->codec->bits_per_raw_sample = descriptor->component_depth;
-                if (mxf_match_uid(*essence_container_ul, mxf_gc_unc_sd, 15))
+                if (codec_ul->id == CODEC_ID_V210 ||
+                    (mxf_match_uid(*essence_container_ul, mxf_gc_unc_sd, 15) && descriptor->component_depth == 10))
+                {
+                    st->codec->pix_fmt = PIX_FMT_YUV422P16LE;
+                }
+                else if (codec_ul->id == CODEC_ID_RAWVIDEO ||
+                    (mxf_match_uid(*essence_container_ul, mxf_gc_unc_sd, 15) && descriptor->component_depth == 8))
+                {
                     st->codec->pix_fmt = PIX_FMT_UYVY422;
+                }
             }
         } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) {
             container_ul = mxf_get_codec_ul(mxf_essence_container_uls, essence_container_ul);
Index: libavformat/mxf.c
===================================================================
--- libavformat/mxf.c   (revision 21481)
+++ libavformat/mxf.c   (working copy)
@@ -40,6 +40,8 @@
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x02,0x01,0x02,0x00 }, 13,    CODEC_ID_DVVIDEO }, /* DV25 IEC PAL */
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x07,0x04,0x01,0x02,0x02,0x03,0x01,0x01,0x00 }, 14,   CODEC_ID_JPEG2000 }, /* JPEG2000 Codestream */
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x01,0x7F,0x00,0x00,0x00 }, 13,   CODEC_ID_RAWVIDEO }, /* Uncompressed */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x01 }, 16,   CODEC_ID_RAWVIDEO }, /* Uncompressed, 8-bit, interleaved, UYVY 4:2:2 */
+    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x02,0x01 }, 16,       CODEC_ID_V210 }, /* Uncompressed, 10-bit, interleaved, V210 4:2:2 */
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x03,0x02,0x00,0x00 }, 14,      CODEC_ID_DNXHD }, /* SMPTE VC-3/DNxHD */
     /* SoundEssenceCompression */
     { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 }, 13,  CODEC_ID_PCM_S16LE }, /* Uncompressed */

Reply via email to