diff mbox series

[FFmpeg-devel,2/3] avcodec/libuavs3d: use output_reorder_delay as has_b_frames

Message ID tencent_27D3105C43CB9DA624909AE6C9A7F0EAAC06@qq.com
State Accepted
Commit 8379e454e0125f2a89328636a95e3183a670c300
Headers show
Series [FFmpeg-devel,1/3] avcodec/avs3_parser: set has_b_frames properly | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Zhao Zhili May 13, 2022, 9:40 a.m. UTC
has_b_frames is more than a bool, it's the size of the frame
reordering buffer in the decoder.
---
 libavcodec/libuavs3d.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jun Zhao May 14, 2022, 1:04 a.m. UTC | #1
On Fri, May 13, 2022 at 5:41 PM Zhao Zhili <quinkblack@foxmail.com> wrote:
>
> has_b_frames is more than a bool, it's the size of the frame
> reordering buffer in the decoder.
> ---
>  libavcodec/libuavs3d.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/libuavs3d.c b/libavcodec/libuavs3d.c
> index 23de4c8cd5..e911963a41 100644
> --- a/libavcodec/libuavs3d.c
> +++ b/libavcodec/libuavs3d.c
> @@ -206,7 +206,7 @@ static int libuavs3d_decode_frame(AVCodecContext *avctx, AVFrame *frm,
>                      avctx->framerate.num = ff_avs3_frame_rate_tab[seqh->frame_rate_code].num;
>                      avctx->framerate.den = ff_avs3_frame_rate_tab[seqh->frame_rate_code].den;
>                  }
> -                avctx->has_b_frames  = !seqh->low_delay;
> +                avctx->has_b_frames = seqh->output_reorder_delay;
The same case, AVS3 uses output_reorder_delay but AVS2 uses low_delay,
which is a bit strange
>                  avctx->pix_fmt = seqh->bit_depth_internal == 8 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUV420P10LE;
>                  ret = ff_set_dimensions(avctx, seqh->horizontal_size, seqh->vertical_size);
>                  if (ret < 0)
> --
Zhao Zhili May 14, 2022, 3:39 a.m. UTC | #2
> On May 14, 2022, at 9:04 AM, mypopy@gmail.com wrote:
> 
> On Fri, May 13, 2022 at 5:41 PM Zhao Zhili <quinkblack@foxmail.com> wrote:
>> 
>> has_b_frames is more than a bool, it's the size of the frame
>> reordering buffer in the decoder.
>> ---
>> libavcodec/libuavs3d.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/libavcodec/libuavs3d.c b/libavcodec/libuavs3d.c
>> index 23de4c8cd5..e911963a41 100644
>> --- a/libavcodec/libuavs3d.c
>> +++ b/libavcodec/libuavs3d.c
>> @@ -206,7 +206,7 @@ static int libuavs3d_decode_frame(AVCodecContext *avctx, AVFrame *frm,
>>                     avctx->framerate.num = ff_avs3_frame_rate_tab[seqh->frame_rate_code].num;
>>                     avctx->framerate.den = ff_avs3_frame_rate_tab[seqh->frame_rate_code].den;
>>                 }
>> -                avctx->has_b_frames  = !seqh->low_delay;
>> +                avctx->has_b_frames = seqh->output_reorder_delay;
> The same case, AVS3 uses output_reorder_delay but AVS2 uses low_delay,
> which is a bit strange

Patch 3/3 explains why: it should be picture_reorder_delay, but it’s
not available in libdavs2’s public API.

>>                 avctx->pix_fmt = seqh->bit_depth_internal == 8 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUV420P10LE;
>>                 ret = ff_set_dimensions(avctx, seqh->horizontal_size, seqh->vertical_size);
>>                 if (ret < 0)
>> --
diff mbox series

Patch

diff --git a/libavcodec/libuavs3d.c b/libavcodec/libuavs3d.c
index 23de4c8cd5..e911963a41 100644
--- a/libavcodec/libuavs3d.c
+++ b/libavcodec/libuavs3d.c
@@ -206,7 +206,7 @@  static int libuavs3d_decode_frame(AVCodecContext *avctx, AVFrame *frm,
                     avctx->framerate.num = ff_avs3_frame_rate_tab[seqh->frame_rate_code].num;
                     avctx->framerate.den = ff_avs3_frame_rate_tab[seqh->frame_rate_code].den;
                 }
-                avctx->has_b_frames  = !seqh->low_delay;
+                avctx->has_b_frames = seqh->output_reorder_delay;
                 avctx->pix_fmt = seqh->bit_depth_internal == 8 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUV420P10LE;
                 ret = ff_set_dimensions(avctx, seqh->horizontal_size, seqh->vertical_size);
                 if (ret < 0)