[Libva] [PATCH][libva-intel-driver] vp9encoder: encoder to handle properly CSC on input surface

Daniel Charles daniel.charles at intel.com
Sat Aug 13 00:30:55 UTC 2016


VP9 encoder was not checking for the yuv surface fourcc provided as the input.
If the format is I420, the driver creates an underlying surface where the input
is converted to NV12.

The underlying temporary surface was not used properly by the vme_pipeline_vp9 as
intel_encoder_check_yuv_surface will place the underlying surface on the
encode_state->input_yuv_object if it needed conversion or it will place the correct
current_render_target if the conversion is not needed.

Signed-off-by: Daniel Charles <daniel.charles at intel.com>
---
 src/gen9_vp9_encoder.c | 1 -
 src/i965_encoder.c     | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gen9_vp9_encoder.c b/src/gen9_vp9_encoder.c
index eecd206..0980a77 100644
--- a/src/gen9_vp9_encoder.c
+++ b/src/gen9_vp9_encoder.c
@@ -3813,7 +3813,6 @@ gen9_encode_vp9_check_parameter(VADriverContextP ctx,
     vp9_state->status_buffer.bo = obj_buffer->buffer_store->bo;
 
     encode_state->reconstructed_object = SURFACE(pic_param->reconstructed_frame);
-    encode_state->input_yuv_object = SURFACE(encode_state->current_render_target);
 
     if (!encode_state->reconstructed_object ||
         !encode_state->input_yuv_object)
diff --git a/src/i965_encoder.c b/src/i965_encoder.c
index c83cc7d..df501f9 100644
--- a/src/i965_encoder.c
+++ b/src/i965_encoder.c
@@ -740,6 +740,7 @@ intel_encoder_sanity_check_input(VADriverContextP ctx,
         vaStatus = intel_encoder_check_vp9_parameter(ctx, encode_state, encoder_context);
         if (vaStatus != VA_STATUS_SUCCESS)
             goto out;
+        vaStatus = intel_encoder_check_yuv_surface(ctx, profile, encode_state, encoder_context);
         break;
     }
     default:
-- 
2.5.5



More information about the Libva mailing list