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

Martin Storsjö martin at martin.st
Thu Jan 13 23:35:32 EET 2022


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?

> +    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?

// Martin



More information about the ffmpeg-devel mailing list