[FFmpeg-devel] [PATCH 1/3] avcodec/libopenh264enc: support for colorspace and range information

lance.lmwang at gmail.com lance.lmwang at gmail.com
Fri Jan 14 04:59:01 EET 2022


On Thu, Jan 13, 2022 at 11:35:32PM +0200, Martin Storsjö wrote:
> On Thu, 13 Jan 2022, lance.lmwang at gmail.com wrote:
> 
> > From: Limin Wang <lance.lmwang at gmail.com>
> > 
> > Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> > ---
> > libavcodec/libopenh264enc.c | 15 +++++++++++++++
> > 1 file changed, 15 insertions(+)
> > 
> > diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
> > index de4b85c..a55bef8 100644
> > --- a/libavcodec/libopenh264enc.c
> > +++ b/libavcodec/libopenh264enc.c
> > @@ -330,6 +330,21 @@ static av_cold int svc_encode_init(AVCodecContext *avctx)
> >         }
> >     }
> > 
> > +#if OPENH264_VER_AT_LEAST(1, 6)
> > +    param.sSpatialLayers[0].uiVideoFormat = VF_UNDEF;
> > +    param.sSpatialLayers[0].bVideoSignalTypePresent = true;
> 
> What does this flag do, and why do we set it unconditionally while we didn't
> use to before?
> 

OK, will update and set the flag only if bFullRange is set.

> > +    if (avctx->color_range != AVCOL_RANGE_UNSPECIFIED)
> > +        param.sSpatialLayers[0].bFullRange = (avctx->color_range == AVCOL_RANGE_JPEG);
> > +
> > +    param.sSpatialLayers[0].bColorDescriptionPresent = true;
> 
> Ditto - what does this do and why do we set it even if we wouldn't set any
> of the other fields?

will update and set the flag only if any the following fields are set.

> 
> // Martin
> 

-- 
Thanks,
Limin Wang


More information about the ffmpeg-devel mailing list