[FFmpeg-devel] [PATCH 07/12] avcodec/hevcdec: check for DOVI configuration record in AVCodecContext side data

James Almer jamrial at gmail.com
Mon Aug 28 16:25:28 EEST 2023


On 8/28/2023 10:00 AM, Vittorio Giovara wrote:
> On Mon, Aug 28, 2023 at 2:38 PM James Almer <jamrial at gmail.com> wrote:
> 
>> Signed-off-by: James Almer <jamrial at gmail.com>
>> ---
>>   libavcodec/hevcdec.c | 15 ++++++++++++++-
>>   1 file changed, 14 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
>> index df40c91ba6..dabfe89d4a 100644
>> --- a/libavcodec/hevcdec.c
>> +++ b/libavcodec/hevcdec.c
>> @@ -3337,8 +3337,15 @@ static int hevc_decode_frame(AVCodecContext *avctx,
>> AVFrame *rframe,
>>       }
>>
>>       sd = av_packet_get_side_data(avpkt, AV_PKT_DATA_DOVI_CONF, &sd_size);
>> -    if (sd && sd_size > 0)
>> +    if (sd && sd_size > 0) {
>> +        int old = s->dovi_ctx.dv_profile;
>> +
>>           ff_dovi_update_cfg(&s->dovi_ctx,
>> (AVDOVIDecoderConfigurationRecord *) sd);
>> +        if (old)
>> +            av_log(avctx, AV_LOG_DEBUG,
>> +                   "New DOVI configuration record from input packet
>> (profile %d -> %u).\n",
>> +                   old, s->dovi_ctx.dv_profile);
>> +    }
>>
> 
> In general isn't the bitstream side data more important than the container
> level one?
> Unless specified with a flag, I'd expect that the bistream information is
> preserved over the other ones since it's harder to misconfure, and (iirc)
> it's what we do in many other places (for example on color properties
> config).

This is the DOVI conf side data, which is read from the container 
header. The RPUs are still read exclusively from the bitstream.

Before this set it was being propagated by lavf as packet side data. 
After this set, lavf makes it available in avctx's side data. My 
original intention was to stop looking at packet side data here 
altogether, but Andreas argued that lavc users other than lavf may still 
propagate it that way, so i left it in place.


More information about the ffmpeg-devel mailing list