diff mbox series

[FFmpeg-devel] avcodec/dxva2_av1: fix superres_denom parameter

Message ID 20210908051950.5172-1-tong1.wu@intel.com
State Accepted
Commit f31033c6ca4bd88e4bb646bab0bc7fd600d4f8b2
Headers show
Series [FFmpeg-devel] avcodec/dxva2_av1: fix superres_denom parameter | expand

Checks

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

Commit Message

Tong Wu Sept. 8, 2021, 5:19 a.m. UTC
Defined in spec 5.9.8. When superres is enabled, SuperresDenom equals
"coded_denom + SUPERRES_DENOM_MIN" instead of coded_denom.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
---
 libavcodec/dxva2_av1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Xiang, Haihao Sept. 8, 2021, 5:46 a.m. UTC | #1
On Wed, 2021-09-08 at 13:19 +0800, Tong Wu wrote:
> Defined in spec 5.9.8. When superres is enabled, SuperresDenom equals
> "coded_denom + SUPERRES_DENOM_MIN" instead of coded_denom.
> 
> Signed-off-by: Tong Wu <tong1.wu@intel.com>
> ---
>  libavcodec/dxva2_av1.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/dxva2_av1.c b/libavcodec/dxva2_av1.c
> index aa14e473df..c30b57799c 100644
> --- a/libavcodec/dxva2_av1.c
> +++ b/libavcodec/dxva2_av1.c
> @@ -73,7 +73,7 @@ static int fill_picture_parameters(const AVCodecContext
> *avctx, AVDXVAContext *c
>      pp->max_height = seq->max_frame_height_minus_1 + 1;
>  
>      pp->CurrPicTextureIndex = ff_dxva2_get_surface_index(avctx, ctx, h-
> >cur_frame.tf.f);
> -    pp->superres_denom      = frame_header->use_superres ? frame_header-
> >coded_denom : AV1_SUPERRES_NUM;
> +    pp->superres_denom      = frame_header->use_superres ? frame_header-
> >coded_denom + AV1_SUPERRES_DENOM_MIN : AV1_SUPERRES_NUM;
>      pp->bitdepth            = get_bit_depth_from_seq(seq);
>      pp->seq_profile         = seq->seq_profile;
>  

LGTM

-Haihao
Hendrik Leppkes Sept. 8, 2021, 6:34 a.m. UTC | #2
On Wed, Sep 8, 2021 at 7:21 AM Tong Wu <tong1.wu@intel.com> wrote:
>
> Defined in spec 5.9.8. When superres is enabled, SuperresDenom equals
> "coded_denom + SUPERRES_DENOM_MIN" instead of coded_denom.
>
> Signed-off-by: Tong Wu <tong1.wu@intel.com>
> ---
>  libavcodec/dxva2_av1.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/dxva2_av1.c b/libavcodec/dxva2_av1.c
> index aa14e473df..c30b57799c 100644
> --- a/libavcodec/dxva2_av1.c
> +++ b/libavcodec/dxva2_av1.c
> @@ -73,7 +73,7 @@ static int fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *c
>      pp->max_height = seq->max_frame_height_minus_1 + 1;
>
>      pp->CurrPicTextureIndex = ff_dxva2_get_surface_index(avctx, ctx, h->cur_frame.tf.f);
> -    pp->superres_denom      = frame_header->use_superres ? frame_header->coded_denom : AV1_SUPERRES_NUM;
> +    pp->superres_denom      = frame_header->use_superres ? frame_header->coded_denom + AV1_SUPERRES_DENOM_MIN : AV1_SUPERRES_NUM;
>      pp->bitdepth            = get_bit_depth_from_seq(seq);
>      pp->seq_profile         = seq->seq_profile;
>
> --
> 2.16.1.windows.4
>

LGTM. Confirmed in the spec. Will apply soon.
diff mbox series

Patch

diff --git a/libavcodec/dxva2_av1.c b/libavcodec/dxva2_av1.c
index aa14e473df..c30b57799c 100644
--- a/libavcodec/dxva2_av1.c
+++ b/libavcodec/dxva2_av1.c
@@ -73,7 +73,7 @@  static int fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *c
     pp->max_height = seq->max_frame_height_minus_1 + 1;
 
     pp->CurrPicTextureIndex = ff_dxva2_get_surface_index(avctx, ctx, h->cur_frame.tf.f);
-    pp->superres_denom      = frame_header->use_superres ? frame_header->coded_denom : AV1_SUPERRES_NUM;
+    pp->superres_denom      = frame_header->use_superres ? frame_header->coded_denom + AV1_SUPERRES_DENOM_MIN : AV1_SUPERRES_NUM;
     pp->bitdepth            = get_bit_depth_from_seq(seq);
     pp->seq_profile         = seq->seq_profile;