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/gen6_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/gen6_mfc.c')
-rw-r--r-- | src/gen6_mfc.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/gen6_mfc.c b/src/gen6_mfc.c index c6702e8..f1b29b9 100644 --- a/src/gen6_mfc.c +++ b/src/gen6_mfc.c @@ -788,8 +788,6 @@ gen6_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; @@ -816,14 +814,6 @@ gen6_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); - dri_bo_map(vme_context->vme_output.bo , 1); msg = (unsigned int *)vme_context->vme_output.bo->virtual; @@ -869,7 +859,6 @@ gen6_mfc_avc_pipeline_slice_programing(VADriverContextP ctx, 1, 1, 1, 0, slice_batch); } - free(slice_header); } @@ -1176,8 +1165,6 @@ gen6_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 old_used = intel_batchbuffer_used_size(slice_batch), used; @@ -1210,21 +1197,6 @@ gen6_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 */ used = intel_batchbuffer_used_size(slice_batch); head_size = (used - old_used) / 16; |