[FFmpeg-devel] [PATCH] avcodec/cbs_av1: infer ref_order_hint when not coded in the bitstream

James Almer jamrial at gmail.com
Wed Nov 11 15:04:23 EET 2020


On 11/10/2020 7:50 PM, Mark Thompson wrote:
> On 31/10/2020 14:40, James Almer wrote:
>> Signed-off-by: James Almer <jamrial at gmail.com>
>> ---
>>   libavcodec/cbs_av1_syntax_template.c | 10 ++++++++--
>>   1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavcodec/cbs_av1_syntax_template.c 
>> b/libavcodec/cbs_av1_syntax_template.c
>> index f351b1de24..dc3d8d1048 100644
>> --- a/libavcodec/cbs_av1_syntax_template.c
>> +++ b/libavcodec/cbs_av1_syntax_template.c
>> @@ -1490,13 +1490,19 @@ static int 
>> FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
>>           fb(8, refresh_frame_flags);
>>       if (!frame_is_intra || current->refresh_frame_flags != 
>> all_frames) {
>> -        if (current->error_resilient_mode && seq->enable_order_hint) {
>> +        if (seq->enable_order_hint) {
>>               for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
>> -                fbs(order_hint_bits, ref_order_hint[i], 1, i);
>> +                if (current->error_resilient_mode)
>> +                    fbs(order_hint_bits, ref_order_hint[i], 1, i);
>> +                else
>> +                    infer(ref_order_hint[i], priv->ref[i].order_hint);
>>                   if (current->ref_order_hint[i] != 
>> priv->ref[i].order_hint)
>>                       priv->ref[i].valid = 0;
>>               }
>>           }
>> +    } else if (seq->enable_order_hint) {
>> +        for (i = 0; i < AV1_NUM_REF_FRAMES; i++)
>> +            infer(ref_order_hint[i], priv->ref[i].order_hint);
> 
> Is filling these on a key frame meaningful in any way?  The slots need 
> not be valid at all, such as at the first frame in a stream.
> 
>>       }
>>       if (current->frame_type == AV1_FRAME_KEY ||
>>
> 
> Probably good anyway.

Will change the above and push, thanks.

> 
> Thanks,
> 
> - Mark
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-devel mailing list