summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2017-01-04 09:40:48 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2017-01-05 11:46:48 +0800
commit70770f91b35b86f2eb1313860868be5f7264456f (patch)
tree67ec7a0157d73a52ce31d2cee639cc1c4347017c
parent972e6f2b36499389bc7cb7bb34414423b5525143 (diff)
Encoder: release all misc parameter buffers
User can still use the old setting if needed because the setting is stored in a common structure now. Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Reviewed-by: Mark Thompson <sw@jkqxz.net> Tested-by: Mark Thompson <sw@jkqxz.net>
-rw-r--r--src/i965_drv_video.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 51a708c..76cb915 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -2798,7 +2798,7 @@ i965_BeginPicture(VADriverContextP ctx,
struct object_surface *obj_surface = SURFACE(render_target);
struct object_config *obj_config;
VAStatus vaStatus = VA_STATUS_SUCCESS;
- int i;
+ int i, j;
ASSERT_RET(obj_context, VA_STATUS_ERROR_INVALID_CONTEXT);
ASSERT_RET(obj_surface, VA_STATUS_ERROR_INVALID_SURFACE);
@@ -2841,15 +2841,10 @@ i965_BeginPicture(VADriverContextP ctx,
obj_context->codec_state.encode.num_packed_header_data_ext = 0;
obj_context->codec_state.encode.slice_index = 0;
obj_context->codec_state.encode.vps_sps_seq_index = 0;
- /*
- * Based on ROI definition in va/va.h, the ROI set through this
- * structure is applicable only to the current frame or field.
- * That is to say: it is on-the-fly setting. If it is not set,
- * the current frame doesn't use ROI.
- * It is uncertain whether the other misc buffer should be released.
- * So only release the previous ROI buffer.
- */
- i965_release_buffer_store(&obj_context->codec_state.encode.misc_param[VAEncMiscParameterTypeROI][0]);
+
+ for (i = 0; i < ARRAY_ELEMS(obj_context->codec_state.encode.misc_param); i++)
+ for (j = 0; j < ARRAY_ELEMS(obj_context->codec_state.encode.misc_param[0]); j++)
+ i965_release_buffer_store(&obj_context->codec_state.encode.misc_param[i][j]);
i965_release_buffer_store(&obj_context->codec_state.encode.encmb_map);
} else {