diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2012-02-14 13:56:05 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2012-02-14 13:56:05 +0800 |
commit | d0cf73ad1dc66a8fa5911acb837c08604cc51940 (patch) | |
tree | ebe5be859071b24b496e10f0bff781220ecb45a3 /src/gen6_mfd.c | |
parent | 8e95c67fd8aa6e15f40dda8d5d0179bdcf1af680 (diff) | |
parent | 54293d98004c829615fb9637bef40c81f9ac9da4 (diff) | |
download | libva-intel-driver-d0cf73ad1dc66a8fa5911acb837c08604cc51940.tar.gz libva-intel-driver-d0cf73ad1dc66a8fa5911acb837c08604cc51940.tar.bz2 libva-intel-driver-d0cf73ad1dc66a8fa5911acb837c08604cc51940.zip |
Merge branch 'master' into vaapi-ext
Conflicts:
src/gen6_mfc.c
src/gen7_mfd.c
src/gen7_mfd.h
src/i965_drv_video.c
src/i965_drv_video.h
src/i965_encoder.c
src/i965_post_processing.c
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Diffstat (limited to 'src/gen6_mfd.c')
-rw-r--r-- | src/gen6_mfd.c | 77 |
1 files changed, 7 insertions, 70 deletions
diff --git a/src/gen6_mfd.c b/src/gen6_mfd.c index b5d8f62..4e7d307 100644 --- a/src/gen6_mfd.c +++ b/src/gen6_mfd.c @@ -36,6 +36,7 @@ #include "i965_defines.h" #include "i965_drv_video.h" +#include "i965_decoder_utils.h" #include "gen6_mfd.h" @@ -783,81 +784,17 @@ gen6_mfd_avc_phantom_slice_state(VADriverContextP ctx, ADVANCE_BCS_BATCH(batch); } -static void +static inline void gen6_mfd_avc_ref_idx_state(VADriverContextP ctx, VAPictureParameterBufferH264 *pic_param, VASliceParameterBufferH264 *slice_param, struct gen6_mfd_context *gen6_mfd_context) { - struct intel_batchbuffer *batch = gen6_mfd_context->base.batch; - int i, j, num_ref_list; - struct { - unsigned char bottom_idc:1; - unsigned char frame_store_index:4; - unsigned char field_picture:1; - unsigned char long_term:1; - unsigned char non_exist:1; - } refs[32]; - - if (slice_param->slice_type == SLICE_TYPE_I || - slice_param->slice_type == SLICE_TYPE_SI) - return; - - if (slice_param->slice_type == SLICE_TYPE_P || - slice_param->slice_type == SLICE_TYPE_SP) { - num_ref_list = 1; - } else { - num_ref_list = 2; - } - - for (i = 0; i < num_ref_list; i++) { - VAPictureH264 *va_pic; - - if (i == 0) { - va_pic = slice_param->RefPicList0; - } else { - va_pic = slice_param->RefPicList1; - } - - BEGIN_BCS_BATCH(batch, 10); - OUT_BCS_BATCH(batch, MFX_AVC_REF_IDX_STATE | (10 - 2)); - OUT_BCS_BATCH(batch, i); - - for (j = 0; j < 32; j++) { - if (va_pic->flags & VA_PICTURE_H264_INVALID) { - refs[j].non_exist = 1; - refs[j].long_term = 1; - refs[j].field_picture = 1; - refs[j].frame_store_index = 0xf; - refs[j].bottom_idc = 1; - } else { - int frame_idx; - - for (frame_idx = 0; frame_idx < ARRAY_ELEMS(gen6_mfd_context->reference_surface); frame_idx++) { - if (gen6_mfd_context->reference_surface[frame_idx].surface_id != VA_INVALID_ID && - va_pic->picture_id == gen6_mfd_context->reference_surface[frame_idx].surface_id) { - assert(frame_idx == gen6_mfd_context->reference_surface[frame_idx].frame_store_id); - break; - } - } - - assert(frame_idx < ARRAY_ELEMS(gen6_mfd_context->reference_surface)); - - refs[j].non_exist = 0; - refs[j].long_term = !!(va_pic->flags & VA_PICTURE_H264_LONG_TERM_REFERENCE); - refs[j].field_picture = !!(va_pic->flags & - (VA_PICTURE_H264_TOP_FIELD | - VA_PICTURE_H264_BOTTOM_FIELD)); - refs[j].frame_store_index = frame_idx; - refs[j].bottom_idc = !!(va_pic->flags & VA_PICTURE_H264_BOTTOM_FIELD); - } - - va_pic++; - } - - intel_batchbuffer_data(batch, refs, sizeof(refs)); - ADVANCE_BCS_BATCH(batch); - } + gen6_send_avc_ref_idx_state( + gen6_mfd_context->base.batch, + slice_param, + gen6_mfd_context->reference_surface + ); } static void |