Lines Matching refs:ph
73 static MPP_RET gen_weight_quant_param(AvsdPicHeader_t *ph) in gen_weight_quant_param() argument
76 RK_U32 *wqp = (RK_U32 *)ph->weighting_quant_param; in gen_weight_quant_param()
82 if (ph->weighting_quant_flag == 0) { in gen_weight_quant_param()
90 if (ph->weighting_quant_param_index == 0x0) { in gen_weight_quant_param()
94 } else if (ph->weighting_quant_param_index == 0x1) { in gen_weight_quant_param()
97 ph->weighting_quant_param_delta1[i]; in gen_weight_quant_param()
99 } else if (ph->weighting_quant_param_index == 0x2) { in gen_weight_quant_param()
102 ph->weighting_quant_param_delta2[i]; in gen_weight_quant_param()
115 static MPP_RET get_extend_header(BitReadCtx_t *bitctx, AvsdSeqHeader_t *vsh, AvsdPicHeader_t *ph) in get_extend_header() argument
120 READ_ONEBIT(bitctx, &ph->loop_filter_disable); in get_extend_header()
121 if (!ph->loop_filter_disable) { in get_extend_header()
122 READ_ONEBIT(bitctx, &ph->loop_filter_parameter_flag); in get_extend_header()
123 if (ph->loop_filter_parameter_flag) { in get_extend_header()
124 READ_SE(bitctx, &ph->alpha_c_offset); in get_extend_header()
125 READ_SE(bitctx, &ph->beta_offset); in get_extend_header()
128 ph->chroma_quant_param_delta_cb = 0; in get_extend_header()
129 ph->chroma_quant_param_delta_cr = 0; in get_extend_header()
131 ph->weighting_quant_param_delta1[i] = 0; in get_extend_header()
132 ph->weighting_quant_param_delta2[i] = 0; in get_extend_header()
135 READ_ONEBIT(bitctx, &ph->weighting_quant_flag); in get_extend_header()
136 if (ph->weighting_quant_flag) { in get_extend_header()
138 READ_ONEBIT(bitctx, &ph->chroma_quant_param_disable); in get_extend_header()
139 if (!ph->chroma_quant_param_disable) { in get_extend_header()
140 READ_SE(bitctx, &ph->chroma_quant_param_delta_cb); in get_extend_header()
141 READ_SE(bitctx, &ph->chroma_quant_param_delta_cr); in get_extend_header()
143 READ_BITS(bitctx, 2, &ph->weighting_quant_param_index); in get_extend_header()
144 READ_BITS(bitctx, 2, &ph->weighting_quant_model); in get_extend_header()
145 if (ph->weighting_quant_param_index == 1) { in get_extend_header()
147 READ_SE(bitctx, &ph->weighting_quant_param_delta1[i]); in get_extend_header()
149 } else if (ph->weighting_quant_param_index == 2) { in get_extend_header()
151 READ_SE(bitctx, &ph->weighting_quant_param_delta2[i]); in get_extend_header()
155 gen_weight_quant_param(ph); //!< generate wqP[m][6] in get_extend_header()
157 READ_ONEBIT(bitctx, &ph->aec_enable); in get_extend_header()
213 static MPP_RET get_i_picture_header(BitReadCtx_t *bitctx, AvsdSeqHeader_t *vsh, AvsdPicHeader_t *ph) in get_i_picture_header() argument
217 ph->picture_coding_type = I_PICTURE; in get_i_picture_header()
219 READ_BITS(bitctx, 16, &ph->bbv_delay); in get_i_picture_header()
222 READ_BITS(bitctx, 7, &ph->bbv_delay_extension); in get_i_picture_header()
224 READ_ONEBIT(bitctx, &ph->time_code_flag); in get_i_picture_header()
225 if (ph->time_code_flag) { in get_i_picture_header()
226 READ_BITS(bitctx, 24, &ph->time_code); in get_i_picture_header()
250 READ_BITS(bitctx, 8, &ph->picture_distance); in get_i_picture_header()
253 READ_UE(bitctx, &ph->bbv_check_times); in get_i_picture_header()
255 READ_ONEBIT(bitctx, &ph->progressive_frame); in get_i_picture_header()
257 ph->picture_structure = 1; // default frame in get_i_picture_header()
258 if (!ph->progressive_frame) in get_i_picture_header()
259 READ_ONEBIT(bitctx, &ph->picture_structure); in get_i_picture_header()
261 READ_ONEBIT(bitctx, &ph->top_field_first); in get_i_picture_header()
262 READ_ONEBIT(bitctx, &ph->repeat_first_field); in get_i_picture_header()
263 READ_ONEBIT(bitctx, &ph->fixed_picture_qp); in get_i_picture_header()
264 READ_BITS(bitctx, 6, &ph->picture_qp); in get_i_picture_header()
265 ph->skip_mode_flag = 0; in get_i_picture_header()
266 if (!ph->progressive_frame && !ph->picture_structure) in get_i_picture_header()
267 READ_ONEBIT(bitctx, &ph->skip_mode_flag); in get_i_picture_header()
272 ph->no_forward_reference_flag = 0; in get_i_picture_header()
273 ph->pb_field_enhanced_flag = 0; in get_i_picture_header()
274 ph->weighting_quant_flag = 0; in get_i_picture_header()
275 ph->aec_enable = 0; in get_i_picture_header()
277 FUN_CHECK(ret = get_extend_header(bitctx, vsh, ph)); in get_i_picture_header()
286 …atic MPP_RET get_pb_picture_header(BitReadCtx_t *bitctx, AvsdSeqHeader_t *vsh, AvsdPicHeader_t *ph) in get_pb_picture_header() argument
291 READ_BITS(bitctx, 16, &ph->bbv_delay); in get_pb_picture_header()
294 READ_BITS(bitctx, 7, &ph->bbv_delay_extension); in get_pb_picture_header()
296 READ_BITS(bitctx, 2, &ph->picture_coding_type); in get_pb_picture_header()
297 READ_BITS(bitctx, 8, &ph->picture_distance); in get_pb_picture_header()
299 READ_UE(bitctx, &ph->bbv_check_times); in get_pb_picture_header()
301 READ_ONEBIT(bitctx, &ph->progressive_frame); in get_pb_picture_header()
303 if (!ph->progressive_frame) { in get_pb_picture_header()
304 READ_ONEBIT(bitctx, &ph->picture_structure); in get_pb_picture_header()
305 if (!ph->picture_structure) { in get_pb_picture_header()
306 READ_ONEBIT(bitctx, &ph->advanced_pred_mode_disable); in get_pb_picture_header()
309 ph->picture_structure = 1; //!< frame picture in get_pb_picture_header()
311 READ_ONEBIT(bitctx, &ph->top_field_first); in get_pb_picture_header()
312 READ_ONEBIT(bitctx, &ph->repeat_first_field); in get_pb_picture_header()
313 READ_ONEBIT(bitctx, &ph->fixed_picture_qp); in get_pb_picture_header()
314 READ_BITS(bitctx, 6, &ph->picture_qp); in get_pb_picture_header()
315 if (!(ph->picture_coding_type == B_PICTURE && ph->picture_structure == P_PICTURE)) { in get_pb_picture_header()
316 READ_ONEBIT(bitctx, &ph->picture_reference_flag); in get_pb_picture_header()
318 READ_ONEBIT(bitctx, &ph->no_forward_reference_flag); in get_pb_picture_header()
319 READ_ONEBIT(bitctx, &ph->pb_field_enhanced_flag); in get_pb_picture_header()
321 ph->no_forward_reference_flag = 0; in get_pb_picture_header()
322 ph->pb_field_enhanced_flag = 0; in get_pb_picture_header()
324 ph->weighting_quant_flag = 0; in get_pb_picture_header()
325 ph->aec_enable = 0; in get_pb_picture_header()
331 READ_ONEBIT(bitctx, &ph->skip_mode_flag); in get_pb_picture_header()
333 FUN_CHECK(ret = get_extend_header(bitctx, vsh, ph)); in get_pb_picture_header()
453 p_cur->pic_type = p_dec->ph.picture_coding_type; in avsd_set_dpb()
469 if (p_dec->ph.picture_structure) { //!< data combine 2 field in avsd_set_dpb()
471 if (p_dec->ph.top_field_first) { in avsd_set_dpb()
496 if (p_dec->ph.picture_coding_type == B_PICTURE) { in avsd_set_dpb()
505 if (p_dec->ph.picture_coding_type == B_PICTURE) { in avsd_set_dpb()
513 if (p_dec->ph.picture_coding_type == I_PICTURE) { in avsd_set_dpb()
516 } else if (p_dec->ph.picture_coding_type == P_PICTURE) { in avsd_set_dpb()
523 } else if (p_dec->ph.picture_coding_type == B_PICTURE) { in avsd_set_dpb()
564 if (p_dec->ph.picture_coding_type != B_PICTURE) { in avsd_update_dpb()
614 pp->picCodingType = p_dec->ph.picture_coding_type; in avsd_fill_parameters()
615 pp->bbvDelay = p_dec->ph.bbv_delay; in avsd_fill_parameters()
616 pp->bbvDelayExtension = p_dec->ph.bbv_delay_extension; in avsd_fill_parameters()
617 pp->timeCodeFlag = p_dec->ph.time_code_flag; in avsd_fill_parameters()
618 pp->timeCode = p_dec->ph.time_code; in avsd_fill_parameters()
620 pp->pictureDistance = p_dec->ph.picture_distance; in avsd_fill_parameters()
621 pp->progressiveFrame = p_dec->ph.progressive_frame; in avsd_fill_parameters()
622 pp->pictureStructure = p_dec->ph.picture_structure; in avsd_fill_parameters()
623 pp->advancedPredModeDisable = p_dec->ph.advanced_pred_mode_disable; in avsd_fill_parameters()
624 pp->topFieldFirst = p_dec->ph.top_field_first; in avsd_fill_parameters()
625 pp->repeatFirstField = p_dec->ph.repeat_first_field; in avsd_fill_parameters()
626 pp->fixedPictureQp = p_dec->ph.fixed_picture_qp; in avsd_fill_parameters()
627 pp->pictureQp = p_dec->ph.picture_qp; in avsd_fill_parameters()
628 pp->pictureReferenceFlag = p_dec->ph.picture_reference_flag; in avsd_fill_parameters()
629 pp->skipModeFlag = p_dec->ph.skip_mode_flag; in avsd_fill_parameters()
630 pp->loopFilterDisable = p_dec->ph.loop_filter_disable; in avsd_fill_parameters()
631 pp->alphaOffset = p_dec->ph.alpha_c_offset; in avsd_fill_parameters()
632 pp->betaOffset = p_dec->ph.beta_offset; in avsd_fill_parameters()
635 pp->weightingQuantFlag = p_dec->ph.weighting_quant_flag; in avsd_fill_parameters()
636 pp->chromaQuantParamDisable = p_dec->ph.chroma_quant_param_disable; in avsd_fill_parameters()
637 pp->chromaQuantParamDeltaCb = p_dec->ph.chroma_quant_param_delta_cb; in avsd_fill_parameters()
638 pp->chromaQuantParamDeltaCr = p_dec->ph.chroma_quant_param_delta_cr; in avsd_fill_parameters()
639 pp->weightingQuantParamIndex = p_dec->ph.weighting_quant_param_index; in avsd_fill_parameters()
640 pp->weightingQuantModel = p_dec->ph.weighting_quant_model; in avsd_fill_parameters()
642 pp->weightingQuantParamDelta1[i] = p_dec->ph.weighting_quant_param_delta1[i]; in avsd_fill_parameters()
643 pp->weightingQuantParamDelta2[i] = p_dec->ph.weighting_quant_param_delta2[i]; in avsd_fill_parameters()
644 pp->weightingQuantParam[i] = p_dec->ph.weighting_quant_param[i]; in avsd_fill_parameters()
647 pp->aecEnable = p_dec->ph.aec_enable; in avsd_fill_parameters()
650 pp->noForwardReferenceFlag = p_dec->ph.no_forward_reference_flag; in avsd_fill_parameters()
651 pp->pbFieldEnhancedFlag = p_dec->ph.pb_field_enhanced_flag; in avsd_fill_parameters()
789 ret = get_i_picture_header(p_dec->bx, &p_dec->vsh, &p_dec->ph); in avsd_parse_stream()
806 ret = get_pb_picture_header(p_dec->bx, &p_dec->vsh, &p_dec->ph); in avsd_parse_stream()
811 p_dec->cur->pic_type = pic_type = p_dec->ph.picture_coding_type; in avsd_parse_stream()