Lines Matching refs:pConfig

114 static void _GenerateParameterSets(MFE_CONFIG* pConfig);
117 static NALU_t* _GenerateSeq_parameter_set_NALU (MFE_CONFIG* pConfig);
118 static NALU_t* _GeneratePic_parameter_set_NALU(MFE_CONFIG *pConfig);
122 static MS_S32 _GeneratePic_parameter_set_rbsp (MFE_CONFIG* pConfig, pic_parameter_set_rbsp_t *pps, …
123 static void _GenerateVUIParameters(MFE_CONFIG *pConfig, seq_parameter_set_rbsp_t *sps);
126 void MallocSPSPPSBuf(MFE_CONFIG* pConfig) in MallocSPSPPSBuf() argument
128pConfig->active_sps = MfeDrvMemMalloc(sizeof(seq_parameter_set_rbsp_t), (const MS_S8*)("active_sps… in MallocSPSPPSBuf()
129 if (pConfig->active_sps) in MallocSPSPPSBuf()
131 memset(pConfig->active_sps, 0, sizeof(seq_parameter_set_rbsp_t)); in MallocSPSPPSBuf()
138pConfig->active_pps = MfeDrvMemMalloc(sizeof(pic_parameter_set_rbsp_t), (const MS_S8*)("active_pps… in MallocSPSPPSBuf()
139 if (pConfig->active_pps) in MallocSPSPPSBuf()
141 memset(pConfig->active_pps, 0, sizeof(pic_parameter_set_rbsp_t)); in MallocSPSPPSBuf()
149 void FreeSPSPPSBuf(MFE_CONFIG* pConfig) in FreeSPSPPSBuf() argument
151 MfeDrvMemFree((void**)&pConfig->active_sps, (const MS_S8*)("active_sps")); in FreeSPSPPSBuf()
152 MfeDrvMemFree((void**)&pConfig->active_pps, (const MS_S8*)("active_pps")); in FreeSPSPPSBuf()
165 void GenerateSPSPPS(MFE_CONFIG* pConfig) in GenerateSPSPPS() argument
167 _GenerateParameterSets(pConfig); in GenerateSPSPPS()
168 _GenerateSeq_parameter_set_NALU(pConfig); in GenerateSPSPPS()
169 _GeneratePic_parameter_set_NALU(pConfig); in GenerateSPSPPS()
184 static void _GenerateParameterSets(MFE_CONFIG* pConfig) in _GenerateParameterSets() argument
188 GenerateSequenceParameterSet(pConfig, pConfig->active_sps, 0); in _GenerateParameterSets()
189 GeneratePictureParameterSet (pConfig, pConfig->active_pps, pConfig->active_sps, 0); in _GenerateParameterSets()
224 static NALU_t* _GenerateSeq_parameter_set_NALU (MFE_CONFIG* pConfig) in _GenerateSeq_parameter_set_NALU() argument
226 NALU_t *n = &pConfig->NaluStruct[STATIC_SPS]; in _GenerateSeq_parameter_set_NALU()
231 n->buf = pConfig->NaluBuf[STATIC_SPS]; in _GenerateSeq_parameter_set_NALU()
233 RBSPlen = _GenerateSeq_parameter_set_rbsp (pConfig->active_sps, rbsp); in _GenerateSeq_parameter_set_NALU()
258 static NALU_t* _GeneratePic_parameter_set_NALU(MFE_CONFIG *pConfig) in _GeneratePic_parameter_set_NALU() argument
260 NALU_t *n = &pConfig->NaluStruct[STATIC_PPS]; in _GeneratePic_parameter_set_NALU()
265 n->buf = pConfig->NaluBuf[STATIC_PPS]; in _GeneratePic_parameter_set_NALU()
267 RBSPlen = _GeneratePic_parameter_set_rbsp (pConfig, pConfig->active_pps, rbsp); in _GeneratePic_parameter_set_NALU()
291 void GenerateSequenceParameterSet( MFE_CONFIG *pConfig, in GenerateSequenceParameterSet() argument
296 H264INFO *pInfo = &pConfig->ctxH264Info; in GenerateSequenceParameterSet()
365 sps->frame_mbs_only_flag = (MS_BOOL) (pConfig->bInterlace == PROGRESSIVE); in GenerateSequenceParameterSet()
368 sps->pic_width_in_mbs_minus1 = (pConfig->nBufWidth/16) -1; in GenerateSequenceParameterSet()
369 …sps->pic_height_in_map_units_minus1 = ((pConfig->nBufHeight/16)/ (2 - sps->frame_mbs_only_flag)) -… in GenerateSequenceParameterSet()
381 _GenerateVUIParameters(pConfig, sps); in GenerateSequenceParameterSet()
383 ntmpDispHeight = pConfig->nDispHeight; in GenerateSequenceParameterSet()
389 if ((pConfig->nBufHeight != ntmpDispHeight) || (pConfig->nBufWidth != pConfig->nDispWidth)) { in GenerateSequenceParameterSet()
407 if (pConfig->MfeCropInfo.crop_en == TRUE) { in GenerateSequenceParameterSet()
409 sps->frame_cropping_rect_left_offset = pConfig->MfeCropInfo.crop_left / CropUnitX; in GenerateSequenceParameterSet()
410 sps->frame_cropping_rect_right_offset = pConfig->MfeCropInfo.crop_right / CropUnitX; in GenerateSequenceParameterSet()
411 sps->frame_cropping_rect_top_offset = pConfig->MfeCropInfo.crop_top / CropUnitY; in GenerateSequenceParameterSet()
412 sps->frame_cropping_rect_bottom_offset = pConfig->MfeCropInfo.crop_bottom / CropUnitY; in GenerateSequenceParameterSet()
416 if (pConfig->nBufWidth != pConfig->nDispWidth) in GenerateSequenceParameterSet()
417 sps->frame_cropping_rect_right_offset = (16 - pConfig->nDispWidth % 16) / CropUnitX; in GenerateSequenceParameterSet()
420 if (pConfig->nBufHeight != ntmpDispHeight) in GenerateSequenceParameterSet()
421 … sps->frame_cropping_rect_bottom_offset = (16 - pConfig->nDispHeight % 16) / CropUnitY; in GenerateSequenceParameterSet()
449 void GeneratePictureParameterSet( MFE_CONFIG* pConfig, in GeneratePictureParameterSet() argument
455 H264INFO *pInfo = &pConfig->ctxH264Info; in GeneratePictureParameterSet()
464 pps->entropy_coding_mode_flag = (pConfig->UseCABAC==1); in GeneratePictureParameterSet()
604 static MS_S32 _GeneratePic_parameter_set_rbsp (MFE_CONFIG* pConfig, pic_parameter_set_rbsp_t *pps, … in _GeneratePic_parameter_set_rbsp() argument
619 pps->pic_order_present_flag = pConfig->ctxH264Info.pic_order_present_flag; in _GeneratePic_parameter_set_rbsp()
763 static void _GenerateVUIParameters(MFE_CONFIG *pConfig, seq_parameter_set_rbsp_t *sps) in _GenerateVUIParameters() argument
770 …vui->aspect_ratio_info_present_flag = (MS_BOOL) (pConfig->setVUI_aspect_ratio_info_present_fl… in _GenerateVUIParameters()
775 if (pConfig->setVUI_aspect_ratio_info_present_flag == TRUE) in _GenerateVUIParameters()
777 vui->aspect_ratio_idc = (MS_U32) pConfig->setVUI_aspect_ratio_idc; in _GenerateVUIParameters()
778 vui->sar_width = (MS_U32) pConfig->setVUI_sar_width; in _GenerateVUIParameters()
779 vui->sar_height = (MS_U32) pConfig->setVUI_sar_height; in _GenerateVUIParameters()
795 switch (pConfig->FrameRatex100) { in _GenerateVUIParameters()
814 vui->time_scale = (MS_U32) pConfig->FrameRatex100; in _GenerateVUIParameters()
860 vui->max_dec_frame_buffering = (MS_U32) pConfig->ctxH264Info.num_ref_frames; in _GenerateVUIParameters()
921 static MS_S32 get_picture_type(MFE_CONFIG* pConfig) in get_picture_type() argument
927 switch (pConfig->vopPredType) in get_picture_type()
953 static MS_S32 ref_pic_list_reordering(MFE_CONFIG* pConfig, Bitstream *bitstream) in ref_pic_list_reordering() argument
957 if (pConfig->vopPredType!=I_VOP) in ref_pic_list_reordering()
974 static MS_S32 dec_ref_pic_marking(MFE_CONFIG* pConfig, Bitstream *bitstream) in dec_ref_pic_marking() argument
976 H264INFO* pInfo = &pConfig->ctxH264Info; in dec_ref_pic_marking()
1001 static MS_S32 SliceHeader(MFE_CONFIG* pConfig, MS_U8 *rbsp) in SliceHeader() argument
1004 H264INFO* pInfo = &pConfig->ctxH264Info; in SliceHeader()
1015 len += ue_v((MS_S8*)("SH: slice_type"), get_picture_type(pConfig), bitstream); in SliceHeader()
1016 …len += ue_v((MS_S8*)("SH: pic_parameter_set_id"), pConfig->active_pps->pic_parameter_set_id ,bitst… in SliceHeader()
1019 if (!pConfig->active_sps->frame_mbs_only_flag) in SliceHeader()
1077 if (pConfig->vopPredType == P_VOP) in SliceHeader()
1082 …override_flag = (pInfo->num_ref_idx_l0_active != (pConfig->active_pps->num_ref_idx_l0_active_minus… in SliceHeader()
1084 …(int)override_flag, (int)pInfo->num_ref_idx_l0_active, (int)pConfig->active_pps->num_ref_idx_l0_ac… in SliceHeader()
1091 len += ref_pic_list_reordering(pConfig, bitstream); in SliceHeader()
1094 len += dec_ref_pic_marking(pConfig, bitstream); in SliceHeader()
1096 if(pConfig->UseCABAC && pConfig->vopPredType != I_VOP) in SliceHeader()
1101 …len += se_v((MS_S8*)("SH: slice_qp_delta"), (pInfo->intQP - 26 - pConfig->active_pps->pic_init_qp_… in SliceHeader()
1103 if (pConfig->active_pps->deblocking_filter_control_present_flag) in SliceHeader()
1114 if(pConfig->UseCABAC && (bitstream->bits_to_go!=8)) { in SliceHeader()
1134 static MS_S32 DummySliceHeaderAndData(MFE_CONFIG* pConfig, MS_U8 *rbsp) in DummySliceHeaderAndData() argument
1137 H264INFO* pInfo = &pConfig->ctxH264Info; in DummySliceHeaderAndData()
1139 MS_S32 nMbCount = ((pConfig->nDispWidth+15)>>4) * ((pConfig->nDispHeight+15)>>4); in DummySliceHeaderAndData()
1149 …len += ue_v((MS_S8*)("SH: pic_parameter_set_id"), pConfig->active_pps->pic_parameter_set_id, bitst… in DummySliceHeaderAndData()
1154 …len += se_v((MS_S8*)("SH: slice_qp_delta"), (/*pInfo->intStep*/26 - 26 - pConfig->active_pps->pic_… in DummySliceHeaderAndData()
1156 if (pConfig->active_pps->deblocking_filter_control_present_flag) in DummySliceHeaderAndData()
1214 void codeSPSPPS(MFE_CONFIG* pConfig,OutStream* pStream) in codeSPSPPS() argument
1216 WriteAnnexbNALU(pStream, &pConfig->NaluStruct[STATIC_SPS]); in codeSPSPPS()
1217 WriteAnnexbNALU(pStream, &pConfig->NaluStruct[STATIC_PPS]); in codeSPSPPS()
1220 MS_S32 codeH264ConfigHeaders(MFE_CONFIG *pConfig,MS_U32* size_of_sps,MS_U32* size_of_pps) in codeH264ConfigHeaders() argument
1222 OutStream* pStream = &pConfig->m_OutStream; in codeH264ConfigHeaders()
1228 *size_of_sps = WriteAnnexbNALU(pStream, &pConfig->NaluStruct[STATIC_SPS]) / 8; in codeH264ConfigHeaders()
1229 *size_of_pps = WriteAnnexbNALU(pStream, &pConfig->NaluStruct[STATIC_PPS]) / 8; in codeH264ConfigHeaders()
1237 void codeSliceHeader(MFE_CONFIG* pConfig, OutStream* pStream) in codeSliceHeader() argument
1240 H264INFO* pInfo = &pConfig->ctxH264Info; in codeSliceHeader()
1245 …nalu->len = 8 + SliceHeader(pConfig, &rbsp[1]); // rbsp[0] is reserved for nal_unit_idc and nal_un… in codeSliceHeader()
1249 Byte1 = get_NALU_1stbyte(pInfo, pConfig->vopPredType); in codeSliceHeader()
1257 void codeDummySliceHeader(MFE_CONFIG* pConfig, OutStream* pStream) in codeDummySliceHeader() argument
1264 …nalu->len = 8 + DummySliceHeaderAndData(pConfig, &rbsp[1]); // rbsp[0] is reserved for nal_unit_id… in codeDummySliceHeader()