frontneds/va: use current_display_picture from VA for film grain
authorRuijing Dong <ruijing.dong@amd.com>
Fri, 2 Dec 2022 21:04:18 +0000 (16:04 -0500)
committerEric Engestrom <eric@engestrom.ch>
Sun, 1 Jan 2023 17:28:29 +0000 (17:28 +0000)
use the interface defined in vaapi for av1 film grain's output
https://github.com/intel/libva/blob/master/va/va_dec_av1.h#L296-L304

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>
(cherry picked from commit 7e91f9486418ad69aaef9ca5ce539ae47995e1d9)

.pick_status.json
src/gallium/frontends/va/picture_av1.c

index 9e4c09e..4c4db5c 100644 (file)
         "description": "frontneds/va: use current_display_picture from VA for film grain",
         "nominated": false,
         "nomination_type": null,
-        "resolution": 4,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
index 899afe8..c0a25fb 100644 (file)
@@ -181,7 +181,13 @@ void vlVaHandlePictureParameterBufferAV1(vlVaDriver *drv, vlVaContext *context,
 
    context->desc.av1.picture_parameter.matrix_coefficients =
       av1->matrix_coefficients;
-   context->desc.av1.picture_parameter.current_frame_id = av1->current_frame;
+
+   context->desc.av1.film_grain_target = NULL;
+   if (av1->film_grain_info.film_grain_info_fields.bits.apply_grain)
+      context->desc.av1.picture_parameter.current_frame_id = av1->current_display_picture;
+   else
+      context->desc.av1.picture_parameter.current_frame_id = av1->current_frame;
+
    context->desc.av1.picture_parameter.order_hint = av1->order_hint;
    context->desc.av1.picture_parameter.primary_ref_frame = av1->primary_ref_frame;
    context->desc.av1.picture_parameter.frame_width = av1->frame_width_minus1 + 1;