[Libva] [PATCH 17/18] Encoding: Follow API to free the previous ROI buffer when starting a new frame
Zhao, Yakui
yakui.zhao at intel.com
Mon Jan 12 05:01:40 PST 2015
From: Zhao Yakui <yakui.zhao at intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
---
src/i965_drv_video.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index eefff39..5a61bde 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -2388,6 +2388,16 @@ i965_BeginPicture(VADriverContextP ctx,
obj_context->codec_state.encode.num_packed_header_params_ext = 0;
obj_context->codec_state.encode.num_packed_header_data_ext = 0;
obj_context->codec_state.encode.slice_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]);
} else {
obj_context->codec_state.decode.current_render_target = render_target;
i965_release_buffer_store(&obj_context->codec_state.decode.pic_param);
--
1.7.10.1
More information about the Libva
mailing list