Signed-off-by: Xiang, Haihao <[email protected]>
---
 src/i965_encoder.c | 10 +++++++++-
 src/i965_encoder.h |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/i965_encoder.c b/src/i965_encoder.c
index be01e83..e7e1554 100644
--- a/src/i965_encoder.c
+++ b/src/i965_encoder.c
@@ -325,6 +325,7 @@ intel_encoder_check_avc_parameter(VADriverContextP ctx,
     struct object_surface *obj_surface;        
     struct object_buffer *obj_buffer;
     VAEncPictureParameterBufferH264 *pic_param = 
(VAEncPictureParameterBufferH264 *)encode_state->pic_param_ext->buffer;
+    VAEncSequenceParameterBufferH264 *seq_param = 
(VAEncSequenceParameterBufferH264 *)encode_state->seq_param_ext->buffer;
     int i;
 
     assert(!(pic_param->CurrPic.flags & VA_PICTURE_H264_INVALID));
@@ -367,7 +368,14 @@ intel_encoder_check_avc_parameter(VADriverContextP ctx,
 
     for ( ; i < 16; i++)
         encode_state->reference_objects[i] = NULL;
-    
+
+    /*
+     * A sequence consists of an IDR unit, followed by zero or more non-IDR 
unit, but not including any
+     * subsequent IDR unit, so idr_pic_flag can indicate the current frame is 
the start of a new
+     * sequnce
+     */
+    encoder_context->is_new_sequence = 
(pic_param->pic_fields.bits.idr_pic_flag && seq_param);
+
     return VA_STATUS_SUCCESS;
 
 error:
diff --git a/src/i965_encoder.h b/src/i965_encoder.h
index db7e698..bec83e3 100644
--- a/src/i965_encoder.h
+++ b/src/i965_encoder.h
@@ -67,6 +67,7 @@ struct intel_encoder_context
     unsigned int low_power_mode:1;
     unsigned int soft_batch_force:1;
     unsigned int context_roi:1;
+    unsigned int is_new_sequence:1; /* Currently only valid for H.264, TODO 
for other codecs */
 
     void (*vme_context_destroy)(void *vme_context);
     VAStatus (*vme_pipeline)(VADriverContextP ctx,
-- 
1.9.1

_______________________________________________
Libva mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libva

Reply via email to