[Libva] [LIBVA-INTEL-DRIVER][PATCH 06/12] Add the VAEncMacroblockMapBufferType buffer for encoding

Zhao Yakui yakui.zhao at intel.com
Tue May 24 12:00:32 UTC 2016


Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
Reviewed-by: Sean V Kelley <sean.v.kelley at intel.com>
---
 src/i965_drv_video.c | 9 +++++++++
 src/i965_drv_video.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 2c70a29..932e5be 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -2090,6 +2090,7 @@ i965_destroy_context(struct object_heap *heap, struct object_base *obj)
             i965_release_buffer_store(&obj_context->codec_state.encode.packed_header_data_ext[i]);
         free(obj_context->codec_state.encode.packed_header_data_ext);
 
+        i965_release_buffer_store(&obj_context->codec_state.encode.encmb_map);
     } else {
         assert(obj_context->codec_state.decode.num_slice_params <= obj_context->codec_state.decode.max_slice_params);
         assert(obj_context->codec_state.decode.num_slice_datas <= obj_context->codec_state.decode.max_slice_datas);
@@ -2361,6 +2362,7 @@ i965_create_buffer_internal(VADriverContextP ctx,
     case VAProcFilterParameterBufferType:
     case VAHuffmanTableBufferType:
     case VAProbabilityBufferType:
+    case VAEncMacroblockMapBufferType:
         /* Ok */
         break;
 
@@ -2421,6 +2423,7 @@ i965_create_buffer_internal(VADriverContextP ctx,
     } else if (type == VASliceDataBufferType || 
                type == VAImageBufferType || 
                type == VAEncCodedBufferType ||
+               type == VAEncMacroblockMapBufferType ||
                type == VAProbabilityBufferType) {
 
         /* If the buffer is wrapped, the bo/buffer of buffer_store is bogus.
@@ -2797,6 +2800,7 @@ 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;
+        i965_release_buffer_store(&obj_context->codec_state.encode.encmb_map);
     } else {
         obj_context->codec_state.decode.current_render_target = render_target;
         i965_release_buffer_store(&obj_context->codec_state.decode.pic_param);
@@ -3062,6 +3066,7 @@ DEF_RENDER_ENCODE_SINGLE_BUFFER_FUNC(huffman_table, huffman_table)
 /* extended buffer */
 DEF_RENDER_ENCODE_SINGLE_BUFFER_FUNC(sequence_parameter_ext, seq_param_ext)
 DEF_RENDER_ENCODE_SINGLE_BUFFER_FUNC(picture_parameter_ext, pic_param_ext)
+DEF_RENDER_ENCODE_SINGLE_BUFFER_FUNC(encmb_map, encmb_map)
 
 #define DEF_RENDER_ENCODE_MULTI_BUFFER_FUNC(name, member) DEF_RENDER_MULTI_BUFFER_FUNC(encode, name, member)
 // DEF_RENDER_ENCODE_MULTI_BUFFER_FUNC(slice_parameter, slice_params)
@@ -3333,6 +3338,10 @@ i965_encoder_render_picture(VADriverContextP ctx,
                                                                  obj_buffer);
             break;
             
+        case VAEncMacroblockMapBufferType:
+            vaStatus = I965_RENDER_ENCODE_BUFFER(encmb_map);
+            break;
+
         default:
             vaStatus = VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE;
             break;
diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h
index 2053bc8..93f9921 100644
--- a/src/i965_drv_video.h
+++ b/src/i965_drv_video.h
@@ -159,6 +159,7 @@ struct encode_state
     struct buffer_store *packed_header_param[5];
     struct buffer_store *packed_header_data[5];
     struct buffer_store **slice_params_ext;
+    struct buffer_store *encmb_map;
     int max_slice_params_ext;
     int num_slice_params_ext;
 
-- 
1.8.2.1



More information about the Libva mailing list