[Libva] [Libva-intel-driver][PATCH 03/18] Add some new internal variables for a new sequence

Xiang, Haihao haihao.xiang at intel.com
Tue Sep 6 15:41:48 UTC 2016


Currently these variables are used only for H.264 encoding

Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>
---
 src/i965_encoder.c | 7 +++++++
 src/i965_encoder.h | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/src/i965_encoder.c b/src/i965_encoder.c
index e7e1554..d045881 100644
--- a/src/i965_encoder.c
+++ b/src/i965_encoder.c
@@ -376,6 +376,12 @@ intel_encoder_check_avc_parameter(VADriverContextP ctx,
      */
     encoder_context->is_new_sequence = (pic_param->pic_fields.bits.idr_pic_flag && seq_param);
 
+    if (encoder_context->is_new_sequence) {
+        encoder_context->num_frames_in_sequence = 0;
+        encoder_context->frame_width_in_mbs = seq_param->picture_width_in_mbs;
+        encoder_context->frame_height_in_mbs = seq_param->picture_height_in_mbs;
+    }
+
     return VA_STATUS_SUCCESS;
 
 error:
@@ -775,6 +781,7 @@ intel_encoder_end_picture(VADriverContextP ctx,
     }
 
     encoder_context->mfc_pipeline(ctx, profile, encode_state, encoder_context);
+    encoder_context->num_frames_in_sequence++;
 
     return VA_STATUS_SUCCESS;
 }
diff --git a/src/i965_encoder.h b/src/i965_encoder.h
index bec83e3..de20ef9 100644
--- a/src/i965_encoder.h
+++ b/src/i965_encoder.h
@@ -59,6 +59,10 @@ struct intel_encoder_context
     unsigned int rate_control_mode;
     unsigned int quality_level;
     unsigned int quality_range;
+    unsigned int num_frames_in_sequence;
+    unsigned int frame_width_in_mbs;
+    unsigned int frame_height_in_mbs;
+
     void *vme_context;
     void *mfc_context;
     void *enc_priv_state;
-- 
1.9.1



More information about the Libva mailing list