[FFmpeg-devel] [PATCH]lavf/mov: Write colour matrix "6" for color_space bt470bg

Michael Niedermayer michaelni at gmx.at
Wed May 20 21:12:19 CEST 2015


On Wed, May 20, 2015 at 08:13:02PM +0200, Carl Eugen Hoyos wrote:
> On Wednesday 20 May 2015 08:02:57 pm Ronald S. Bultje wrote:
> > Hi,
> >
> > On Wed, May 20, 2015 at 12:32 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> > > Our mov demuxer claims that "6" is bt470bg, so write "6" if
> > > the user specified bt470bg.
> >
> > [..]
> >
> > >      }
> > >      switch (track->enc->colorspace) {
> > >      case AVCOL_TRC_BT709:     avio_wb16(pb, 1); break;
> > > +    case AVCOL_PRI_BT470BG:
> > >      case AVCOL_PRI_SMPTE170M: avio_wb16(pb, 6); break;
> > >      case AVCOL_PRI_SMPTE240M: avio_wb16(pb, 7); break;
> > >      default:                  avio_wb16(pb, 2);
> > 
> > Am I the only one that thinks it's weird that we read the SPC field as a
> > combination/mixture of TRC/PRI instead of SPC fields?
> 
> New patch attached, I will change the others if ok.
> 
> Thank you, Carl Eugen

>  movenc.c |    1 +
>  1 file changed, 1 insertion(+)
> 3ae97b2b0155da7e3425abf00f2792c4100c3a7f  patchbt470m.diff
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index b6821d4..4aa64b0 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -1608,6 +1608,7 @@ static int mov_write_colr_tag(AVIOContext *pb, MOVTrack *track)
>      }
>      switch (track->enc->colorspace) {
>      case AVCOL_TRC_BT709:     avio_wb16(pb, 1); break;
> +    case AVCOL_SPC_BT470BG:
>      case AVCOL_PRI_SMPTE170M: avio_wb16(pb, 6); break;

LGTM

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150520/fac16a31/attachment.asc>


More information about the ffmpeg-devel mailing list