[FFmpeg-devel] [PATCH 07/13] avformat/mxfenc: Add vertical subsampling support

Tomas Härdin tjoppen at acc.umu.se
Tue May 8 13:45:18 EEST 2018


mån 2018-05-07 klockan 12:38 +0200 skrev Michael Niedermayer:
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> 
> @@ -1149,6 +1151,8 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
>          desc_size += 5;
>      if (sc->interlaced)
>          desc_size += 8;
> +    if (sc->v_chroma_sub_sample)
> +        desc_size += 8;
>  
>      mxf_write_generic_desc(s, st, key, desc_size);
>  
> @@ -1209,6 +1213,12 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
>      mxf_write_local_tag(pb, 4, 0x3302);
>      avio_wb32(pb, sc->h_chroma_sub_sample);
>  
> +    // vertical subsampling
> +    if (sc->v_chroma_sub_sample) {
> +        mxf_write_local_tag(pb, 4, 0x3308);
> +        avio_wb32(pb, sc->v_chroma_sub_sample);
> +    }
> +
>      // color siting
>      mxf_write_local_tag(pb, 1, 0x3303);
>      avio_w8(pb, sc->color_siting);
> @@ -2273,6 +2283,7 @@ static int mxf_write_header(AVFormatContext *s)
>              if (pix_desc) {
>                  sc->component_depth     = pix_desc->comp[0].depth;
>                  sc->h_chroma_sub_sample = 1 << pix_desc->log2_chroma_w;
> +                sc->v_chroma_sub_sample = 1 << pix_desc->log2_chroma_h;

Looks OK. Had this confused for chrome siting for a while, but I see
that is actually handled correctly.

/Tomas


More information about the ffmpeg-devel mailing list