Don't mix the slice_type values of h264 and h265.
The SLICE_TYPE values of H264 and HEVC are different.
H264: Bslice_type = 1, Pslice_type = 0
HEVC: Bslice_type = 0, Pslice_type = 1
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
assert(qp <= QP_MAX);
lambda = intel_lambda_qp(qp);
- if (slice_type == SLICE_TYPE_I) {
+ if (slice_type == HEVC_SLICE_I) {
vme_state_message[MODE_INTRA_16X16] = 0;
m_cost = lambda * 4;
vme_state_message[MODE_INTRA_8X8] = intel_format_lutvalue(m_cost, 0x8f);
m_costf = lambda * 3.5;
m_cost = m_costf;
vme_state_message[MODE_INTRA_NONPRED] = intel_format_lutvalue(m_cost, 0x6f);
- if (slice_type == SLICE_TYPE_P) {
+ if (slice_type == HEVC_SLICE_P) {
m_costf = lambda * 2.5;
m_cost = m_costf;
vme_state_message[MODE_INTER_16X16] = intel_format_lutvalue(m_cost, 0x8f);
struct gen6_vme_context *vme_context = encoder_context->vme_context;
VAEncSequenceParameterBufferHEVC *pSequenceParameter = (VAEncSequenceParameterBufferHEVC *)encode_state->seq_param_ext->buffer;
VAEncSliceParameterBufferHEVC *pSliceParameter = (VAEncSliceParameterBufferHEVC *)encode_state->slice_params_ext[0]->buffer;
- int is_intra = pSliceParameter->slice_type == SLICE_TYPE_I;
+ int is_intra = pSliceParameter->slice_type == HEVC_SLICE_I;
int width_in_mbs = (pSequenceParameter->pic_width_in_luma_samples + 15)/16;
int height_in_mbs = (pSequenceParameter->pic_height_in_luma_samples + 15)/16;
int slice_type;
slice_type = slice_param->slice_type;
- assert(slice_type != SLICE_TYPE_I && slice_type != SLICE_TYPE_SI);
+ assert(slice_type != HEVC_SLICE_I);
/* to do HEVC */
intel_hevc_vme_reference_state(ctx, encode_state, encoder_context, 0, 1, gen9_vme_source_surface_state);
- if (slice_type == SLICE_TYPE_B)
+ if (slice_type == HEVC_SLICE_B)
intel_hevc_vme_reference_state(ctx, encode_state, encoder_context, 1, 2, gen9_vme_source_surface_state);
}
}
}
- if (pSliceParameter->slice_type == SLICE_TYPE_I) {
+ if (pSliceParameter->slice_type == HEVC_SLICE_I) {
kernel_shader = VME_INTRA_SHADER;
- } else if (pSliceParameter->slice_type == SLICE_TYPE_P) {
+ } else if (pSliceParameter->slice_type == HEVC_SLICE_P) {
kernel_shader = VME_INTER_SHADER;
} else {
kernel_shader = VME_BINTER_SHADER;
{
VAStatus vaStatus = VA_STATUS_SUCCESS;
VAEncSliceParameterBufferHEVC *pSliceParameter = (VAEncSliceParameterBufferHEVC *)encode_state->slice_params_ext[0]->buffer;
- int is_intra = pSliceParameter->slice_type == SLICE_TYPE_I;
+ int is_intra = pSliceParameter->slice_type == HEVC_SLICE_I;
VAEncSequenceParameterBufferHEVC *pSequenceParameter = (VAEncSequenceParameterBufferHEVC *)encode_state->seq_param_ext->buffer;
struct gen6_vme_context *vme_context = encoder_context->vme_context;
hevc_rps.inter_ref_pic_set_prediction_flag = 0;
/* s0: between I and P/B; s1 : between P and B */
- hevc_rps.num_negative_pics = (slice_param->slice_type!=SLICE_TYPE_I) ? 1 : 0;
- hevc_rps.num_positive_pics = (slice_param->slice_type==SLICE_TYPE_B) ? 1 : 0;
+ hevc_rps.num_negative_pics = (slice_param->slice_type!=HEVC_SLICE_I) ? 1 : 0;
+ hevc_rps.num_positive_pics = (slice_param->slice_type==HEVC_SLICE_B) ? 1 : 0;
hevc_rps.delta_poc_s0_minus1[0] = 0;
hevc_rps.used_by_curr_pic_s0_flag[0] = 0;
hevc_rps.delta_poc_s1_minus1[0] = 0;
hevc_rps.used_by_curr_pic_s1_flag[0] = 0;
if(slice_param->num_ref_idx_l0_active_minus1==0 )
{
- hevc_rps.delta_poc_s0_minus1[0] = (slice_param->slice_type==SLICE_TYPE_I) ? 0 : ( curPicOrderCnt - slice_param->ref_pic_list0[0].pic_order_cnt-1); //0;
+ hevc_rps.delta_poc_s0_minus1[0] = (slice_param->slice_type==HEVC_SLICE_I) ? 0 : ( curPicOrderCnt - slice_param->ref_pic_list0[0].pic_order_cnt-1); //0;
hevc_rps.used_by_curr_pic_s0_flag[0] = 1;
}
if(slice_param->num_ref_idx_l1_active_minus1==0 )
{
- hevc_rps.delta_poc_s1_minus1[0] = (slice_param->slice_type==SLICE_TYPE_I) ? 0 : ( slice_param->ref_pic_list1[0].pic_order_cnt -curPicOrderCnt -1);
+ hevc_rps.delta_poc_s1_minus1[0] = (slice_param->slice_type==HEVC_SLICE_I) ? 0 : ( slice_param->ref_pic_list1[0].pic_order_cnt -curPicOrderCnt -1);
hevc_rps.used_by_curr_pic_s1_flag[0] = 1;
}
avc_bitstream_put_ui(bs, slice_param->slice_fields.bits.slice_sao_chroma_flag, 1);
}
- if (slice_param->slice_type != SLICE_TYPE_I)
+ if (slice_param->slice_type != HEVC_SLICE_I)
{
/* num_ref_idx_active_override_flag. 0 */
avc_bitstream_put_ui(bs, 0, 1);
/* No reference picture set modification */
/* MVD_l1_zero_flag */
- if (slice_param->slice_type == SLICE_TYPE_B)
+ if (slice_param->slice_type == HEVC_SLICE_B)
avc_bitstream_put_ui(bs, slice_param->slice_fields.bits.mvd_l1_zero_flag, 1);
/* cabac_init_present_flag. 0 */
*/
}
if (((pic_param->pic_fields.bits.weighted_pred_flag) &&
- (slice_param->slice_type == SLICE_TYPE_P)) ||
+ (slice_param->slice_type == HEVC_SLICE_P)) ||
((pic_param->pic_fields.bits.weighted_bipred_flag) &&
- (slice_param->slice_type == SLICE_TYPE_B)))
+ (slice_param->slice_type == HEVC_SLICE_B)))
{
/* TBD:
* add the weighted table