diff options
author | Zhao, Yakui <yakui.zhao@intel.com> | 2014-05-26 08:40:15 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2014-06-16 11:53:35 +0800 |
commit | 107274f309c6c3a7c59b70d5140b781341c7e9c2 (patch) | |
tree | 375b1ae53ffa90401250da01a4f282c50801b307 /src/gen75_mfc.c | |
parent | ee4b8c3ec1e5b5f126d8bdb7021eb15630de751e (diff) | |
download | libva-intel-driver-107274f309c6c3a7c59b70d5140b781341c7e9c2.tar.gz libva-intel-driver-107274f309c6c3a7c59b70d5140b781341c7e9c2.tar.bz2 libva-intel-driver-107274f309c6c3a7c59b70d5140b781341c7e9c2.zip |
H264_Encoding: Add the support of packed slice header to be flexible
Under some encoding scenario, the user hopes to generate the packed slice
header data by themself and then the driver can insert the passed slice
header packed data into the coded clip.
1.The VA_ENC_PACKED_HEADER_SLICE flag is exported and it is treated as optional.
This is to say: if packed slice header data is passed, it will be
inserted directly. If no packed slice header data is passed, the driver will
help to generate it.
2.Another restriction is that the packed slice header data is inserted after
the packed rawdata for one slice. That is to say: If it needs to insert the
packed rawdata and slice header data, the packed rawdata will be inserted
firstly(This is handled by the driver).
Signed-off-by: Zhao, Yakui <yakui.zhao@intel.com>
(cherry picked from commit 00111e8a8bfa67b971419b72577eaa1b9f47bc34)
Conflicts:
src/gen75_mfc.c
src/gen8_mfc.c
Diffstat (limited to 'src/gen75_mfc.c')
-rw-r--r-- | src/gen75_mfc.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/gen75_mfc.c b/src/gen75_mfc.c index 18a588f..1051dd5 100644 --- a/src/gen75_mfc.c +++ b/src/gen75_mfc.c @@ -1166,8 +1166,6 @@ gen75_mfc_avc_pipeline_slice_programing(VADriverContextP ctx, int i,x,y; int qp = pPicParameter->pic_init_qp + pSliceParameter->slice_qp_delta; unsigned int rate_control_mode = encoder_context->rate_control_mode; - unsigned char *slice_header = NULL; - int slice_header_length_in_bits = 0; unsigned int tail_data[] = { 0x0, 0x0 }; int slice_type = intel_avc_enc_slice_type_fixup(pSliceParameter->slice_type); int is_intra = slice_type == SLICE_TYPE_I; @@ -1194,16 +1192,6 @@ gen75_mfc_avc_pipeline_slice_programing(VADriverContextP ctx, intel_avc_slice_insert_packed_data(ctx, encode_state, encoder_context, slice_index, slice_batch); - slice_header_length_in_bits = build_avc_slice_header(pSequenceParameter, pPicParameter, pSliceParameter, &slice_header); - - // slice hander - mfc_context->insert_object(ctx, encoder_context, - (unsigned int *)slice_header, ALIGN(slice_header_length_in_bits, 32) >> 5, slice_header_length_in_bits & 0x1f, - 5, /* first 5 bytes are start code + nal unit type */ - 1, 0, 1, slice_batch); - - free(slice_header); - dri_bo_map(vme_context->vme_output.bo , 1); msg_ptr = (unsigned char *)vme_context->vme_output.bo->virtual; @@ -1516,8 +1504,6 @@ gen75_mfc_avc_batchbuffer_slice(VADriverContextP ctx, int last_slice = (pSliceParameter->macroblock_address + pSliceParameter->num_macroblocks) == (width_in_mbs * height_in_mbs); int qp = pPicParameter->pic_init_qp + pSliceParameter->slice_qp_delta; unsigned int rate_control_mode = encoder_context->rate_control_mode; - unsigned char *slice_header = NULL; - int slice_header_length_in_bits = 0; unsigned int tail_data[] = { 0x0, 0x0 }; long head_offset; int slice_type = intel_avc_enc_slice_type_fixup(pSliceParameter->slice_type); @@ -1547,22 +1533,6 @@ gen75_mfc_avc_batchbuffer_slice(VADriverContextP ctx, intel_avc_slice_insert_packed_data(ctx, encode_state, encoder_context, slice_index, slice_batch); - slice_header_length_in_bits = build_avc_slice_header(pSequenceParameter, pPicParameter, pSliceParameter, &slice_header); - - // slice hander - mfc_context->insert_object(ctx, - encoder_context, - (unsigned int *)slice_header, - ALIGN(slice_header_length_in_bits, 32) >> 5, - slice_header_length_in_bits & 0x1f, - 5, /* first 5 bytes are start code + nal unit type */ - 1, - 0, - 1, - slice_batch); - - free(slice_header); - intel_batchbuffer_align(slice_batch, 16); /* aligned by an Oword */ head_offset = intel_batchbuffer_used_size(slice_batch); |