diff mbox

[FFmpeg-devel] lavc/vaapi_hevc: fix scaling list duplicate transfer issue.

Message ID 236bdaae-2ca9-3c12-63ac-a9012afe8928@gmail.com
State Accepted
Commit 584eea5bf3e40e2dbab986f8e9e8f01c8a4426d2
Headers show

Commit Message

Jun Zhao Nov. 22, 2016, 8:16 a.m. UTC
From 4059bc56cba30b26bc194673968c3a51014e315f Mon Sep 17 00:00:00 2001
From: Jun Zhao <mypopydev@gmail.com>
Date: Tue, 22 Nov 2016 15:58:50 +0800
Subject: [PATCH] lavc/vaapi_hevc: fix scaling list duplicate transfer issue.

scaling list is already transfered to raster scan during head parsing,
so no need to transfer it again.

And after this fix, FATE test SLIST_A_Sony_4/SLIST_B_Sony_8/
SLIST_C_Sony_3/SLIST_D_Sony_9 will pass in i965/Skylake.

used the comand:
make HWACCEL='vaapi -vaapi_device /dev/dri/renderD128 \
-hwaccel_output_format yuv420p' fate-hevc -i | \
grep "recipe for target" | wc -l test and verify.

Signed-off-by: Wang, Yi A <yi.a.wamg@intel.com>
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
---
 libavcodec/vaapi_hevc.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Mark Thompson Nov. 23, 2016, 9:41 p.m. UTC | #1
On 22/11/16 08:16, Jun Zhao wrote:
> From 4059bc56cba30b26bc194673968c3a51014e315f Mon Sep 17 00:00:00 2001
> From: Jun Zhao <mypopydev@gmail.com>
> Date: Tue, 22 Nov 2016 15:58:50 +0800
> Subject: [PATCH] lavc/vaapi_hevc: fix scaling list duplicate transfer issue.
>
> scaling list is already transfered to raster scan during head parsing,
> so no need to transfer it again.
>
> And after this fix, FATE test SLIST_A_Sony_4/SLIST_B_Sony_8/
> SLIST_C_Sony_3/SLIST_D_Sony_9 will pass in i965/Skylake.
>
> used the comand:
> make HWACCEL='vaapi -vaapi_device /dev/dri/renderD128 \
> -hwaccel_output_format yuv420p' fate-hevc -i | \
> grep "recipe for target" | wc -l test and verify.
>
> Signed-off-by: Wang, Yi A <yi.a.wamg@intel.com>
> Signed-off-by: Jun Zhao <jun.zhao@intel.com>
> ---
>  libavcodec/vaapi_hevc.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)

Tested, LGTM, applied.

Thanks,

- Mark
diff mbox

Patch

diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
index 62f783e..dd43463 100644
--- a/libavcodec/vaapi_hevc.c
+++ b/libavcodec/vaapi_hevc.c
@@ -265,7 +265,7 @@  static int vaapi_hevc_start_frame(AVCodecContext          *avctx,
     VAPictureParameterBufferHEVC *pic_param;
     VAIQMatrixBufferHEVC *iq_matrix;
     ScalingList const * scaling_list;
-    int i, j, pos;
+    int i, j;
 
     ff_dlog(avctx, "vaapi_hevc_start_frame()\n");
 
@@ -293,15 +293,13 @@  static int vaapi_hevc_start_frame(AVCodecContext          *avctx,
 
     for (i = 0; i < 6; ++i) {
         for (j = 0; j < 16; ++j) {
-            pos = 4 * ff_hevc_diag_scan4x4_y[j] + ff_hevc_diag_scan4x4_x[j];
-            iq_matrix->ScalingList4x4[i][j] = scaling_list->sl[0][i][pos];
+            iq_matrix->ScalingList4x4[i][j] = scaling_list->sl[0][i][j];
         }
         for (j = 0; j < 64; ++j) {
-            pos = 8 * ff_hevc_diag_scan8x8_y[j] + ff_hevc_diag_scan8x8_x[j];
-            iq_matrix->ScalingList8x8[i][j] = scaling_list->sl[1][i][pos];
-            iq_matrix->ScalingList16x16[i][j] = scaling_list->sl[2][i][pos];
+            iq_matrix->ScalingList8x8[i][j] = scaling_list->sl[1][i][j];
+            iq_matrix->ScalingList16x16[i][j] = scaling_list->sl[2][i][j];
             if (i < 2) {
-                iq_matrix->ScalingList32x32[i][j] = scaling_list->sl[3][i * 3][pos];
+                iq_matrix->ScalingList32x32[i][j] = scaling_list->sl[3][i * 3][j];
             }
         }
         iq_matrix->ScalingListDC16x16[i] = scaling_list->sl_dc[0][i];