Lines Matching refs:bitctx

212 static MPP_RET parse_sequence_wqm(BitReadCtx_t *bitctx, Avs2dSeqHeader_t *vsh)  in parse_sequence_wqm()  argument
219 READ_ONEBIT(bitctx, &load_seq_wquant_data_flag); in parse_sequence_wqm()
226 READ_UE(bitctx, &vsh->seq_wq_matrix[size_id][j * wqm_size + i]); in parse_sequence_wqm()
239 return ret = bitctx->ret; in parse_sequence_wqm()
242 static MPP_RET parse_one_rps(BitReadCtx_t *bitctx, Avs2dRps_t *rps) in parse_one_rps() argument
248 READ_ONEBIT(bitctx, &rps->refered_by_others); in parse_one_rps()
250 READ_BITS(bitctx, 3, &rps->num_of_ref); in parse_one_rps()
258 READ_BITS(bitctx, 6, &rps->ref_pic[j]); in parse_one_rps()
262 READ_BITS(bitctx, 3, &rps->num_to_remove); in parse_one_rps()
264 READ_BITS(bitctx, 6, &rps->remove_pic[j]); in parse_one_rps()
268 READ_MARKER_BIT(bitctx); in parse_one_rps()
273 return ret = bitctx->ret; in parse_one_rps()
285 BitReadCtx_t *bitctx = &p_dec->bitctx; in avs2d_parse_sequence_header() local
288 …("Bitread buf %p, data %p, buf_len %d, left %d\n", bitctx->buf, bitctx->data_, bitctx->buf_len, bi… in avs2d_parse_sequence_header()
290 READ_BITS(bitctx, 8, &vsh->profile_id); in avs2d_parse_sequence_header()
297 READ_BITS(bitctx, 8, &vsh->level_id); in avs2d_parse_sequence_header()
303 READ_ONEBIT(bitctx, &vsh->progressive_sequence); in avs2d_parse_sequence_header()
304 READ_ONEBIT(bitctx, &vsh->field_coded_sequence); in avs2d_parse_sequence_header()
305 READ_BITS(bitctx, 14, &vsh->horizontal_size); in avs2d_parse_sequence_header()
306 READ_BITS(bitctx, 14, &vsh->vertical_size); in avs2d_parse_sequence_header()
314 READ_BITS(bitctx, 2, &vsh->chroma_format); in avs2d_parse_sequence_header()
320 READ_BITS(bitctx, 3, &vsh->sample_precision); in avs2d_parse_sequence_header()
322 READ_BITS(bitctx, 3, &vsh->encoding_precision); in avs2d_parse_sequence_header()
339 READ_BITS(bitctx, 4, &vsh->aspect_ratio); in avs2d_parse_sequence_header()
340 READ_BITS(bitctx, 4, &vsh->frame_rate_code); in avs2d_parse_sequence_header()
341 READ_BITS(bitctx, 18, &val_temp); //!< bit_rate_lower_18 in avs2d_parse_sequence_header()
343 READ_MARKER_BIT(bitctx); in avs2d_parse_sequence_header()
344 READ_BITS(bitctx, 12, &val_temp); //!< bit_rate_upper_12 in avs2d_parse_sequence_header()
346 READ_ONEBIT(bitctx, &vsh->low_delay); in avs2d_parse_sequence_header()
347 READ_MARKER_BIT(bitctx); in avs2d_parse_sequence_header()
348 READ_ONEBIT(bitctx, &vsh->enable_temporal_id); in avs2d_parse_sequence_header()
349 READ_BITS(bitctx, 18, &vsh->bbv_buffer_size); in avs2d_parse_sequence_header()
350 READ_BITS(bitctx, 3, &vsh->lcu_size); in avs2d_parse_sequence_header()
357 READ_ONEBIT(bitctx, &vsh->enable_weighted_quant); in avs2d_parse_sequence_header()
359 parse_sequence_wqm(bitctx, vsh); in avs2d_parse_sequence_header()
362 READ_ONEBIT(bitctx, &val_temp); in avs2d_parse_sequence_header()
364 READ_ONEBIT(bitctx, &vsh->enable_mhp_skip); in avs2d_parse_sequence_header()
365 READ_ONEBIT(bitctx, &vsh->enable_dhp); in avs2d_parse_sequence_header()
366 READ_ONEBIT(bitctx, &vsh->enable_wsm); in avs2d_parse_sequence_header()
367 READ_ONEBIT(bitctx, &vsh->enable_amp); in avs2d_parse_sequence_header()
368 READ_ONEBIT(bitctx, &vsh->enable_nsqt); in avs2d_parse_sequence_header()
369 READ_ONEBIT(bitctx, &vsh->enable_nsip); in avs2d_parse_sequence_header()
370 READ_ONEBIT(bitctx, &vsh->enable_2nd_transform); in avs2d_parse_sequence_header()
371 READ_ONEBIT(bitctx, &vsh->enable_sao); in avs2d_parse_sequence_header()
372 READ_ONEBIT(bitctx, &vsh->enable_alf); in avs2d_parse_sequence_header()
373 READ_ONEBIT(bitctx, &vsh->enable_pmvr); in avs2d_parse_sequence_header()
374 READ_MARKER_BIT(bitctx); in avs2d_parse_sequence_header()
377 READ_BITS(bitctx, 6, &vsh->num_of_rps); in avs2d_parse_sequence_header()
381 FUN_CHECK(ret = parse_one_rps(bitctx, rps)); in avs2d_parse_sequence_header()
385 READ_BITS(bitctx, 5, &vsh->picture_reorder_delay); in avs2d_parse_sequence_header()
389 READ_ONEBIT(bitctx, &vsh->enable_clf); in avs2d_parse_sequence_header()
390 READ_BITS(bitctx, 2, &val_temp); //!< reserved 2bits 00 in avs2d_parse_sequence_header()
396 return ret = bitctx->ret; in avs2d_parse_sequence_header()
401 static MPP_RET read_pic_alf_coeff(BitReadCtx_t *bitctx, RK_S32 *alf_coeff) in read_pic_alf_coeff() argument
408 READ_SE(bitctx, &alf_coeff[j]); in read_pic_alf_coeff()
423 return ret = bitctx->ret; in read_pic_alf_coeff()
428 static MPP_RET parse_pic_alf_params(BitReadCtx_t *bitctx, Avs2dPicHeader_t *ph) in parse_pic_alf_params() argument
433 READ_ONEBIT(bitctx, &ph->enable_pic_alf_y); in parse_pic_alf_params()
434 READ_ONEBIT(bitctx, &ph->enable_pic_alf_cb); in parse_pic_alf_params()
435 READ_ONEBIT(bitctx, &ph->enable_pic_alf_cr); in parse_pic_alf_params()
441 READ_UE(bitctx, &ph->alf_filter_num); in parse_pic_alf_params()
452 READ_UE(bitctx, &symbol); in parse_pic_alf_params()
460 FUN_CHECK(ret = read_pic_alf_coeff(bitctx, ph->alf_coeff_y[i])); in parse_pic_alf_params()
478 FUN_CHECK(ret = read_pic_alf_coeff(bitctx, ph->alf_coeff_cb)); in parse_pic_alf_params()
482 FUN_CHECK(ret = read_pic_alf_coeff(bitctx, ph->alf_coeff_cr)); in parse_pic_alf_params()
486 return ret = bitctx->ret; in parse_pic_alf_params()
497 BitReadCtx_t *bitctx = &p_dec->bitctx; in parse_picture_header_comm() local
502 READ_ONEBIT(bitctx, &val_temp); in parse_picture_header_comm()
505 READ_ONEBIT(bitctx, &ph->loop_filter_parameter_flag); in parse_picture_header_comm()
507 READ_SE(bitctx, &ph->alpha_c_offset); in parse_picture_header_comm()
508 READ_SE(bitctx, &ph->beta_offset); in parse_picture_header_comm()
521 READ_ONEBIT(bitctx, &val_temp); in parse_picture_header_comm()
524 READ_SE(bitctx, &ph->chroma_quant_param_delta_cb); in parse_picture_header_comm()
525 READ_SE(bitctx, &ph->chroma_quant_param_delta_cr); in parse_picture_header_comm()
539 READ_ONEBIT(bitctx, &ph->enable_pic_weight_quant); in parse_picture_header_comm()
542 READ_BITS(bitctx, 2, &ph->pic_wq_data_index); in parse_picture_header_comm()
544 SKIP_BITS(bitctx, 1); in parse_picture_header_comm()
545 READ_BITS(bitctx, 2, &ph->wq_param_index); in parse_picture_header_comm()
546 READ_BITS(bitctx, 2, &ph->wq_model); in parse_picture_header_comm()
549 READ_SE(bitctx, &ph->wq_param_delta1[i]); in parse_picture_header_comm()
553 READ_SE(bitctx, &ph->wq_param_delta2[i]); in parse_picture_header_comm()
562 READ_UE(bitctx, &ph->pic_wq_matrix[size_id][j * wqm_size + i]); in parse_picture_header_comm()
572 FUN_CHECK(ret = parse_pic_alf_params(bitctx, ph)); in parse_picture_header_comm()
579 return ret = bitctx->ret; in parse_picture_header_comm()
590 BitReadCtx_t *bitctx = &p_dec->bitctx; in parse_picture_header_intra() local
599 …("Bitread buf %p, data %p, buf_len %d, left %d\n", bitctx->buf, bitctx->data_, bitctx->buf_len, bi… in parse_picture_header_intra()
600 READ_BITS_LONG(bitctx, 32, &ph->bbv_delay); in parse_picture_header_intra()
602 READ_ONEBIT(bitctx, &ph->time_code_flag); in parse_picture_header_intra()
605 READ_BITS(bitctx, 24, &ph->time_code); in parse_picture_header_intra()
610 READ_ONEBIT(bitctx, &ph->background_picture_flag); in parse_picture_header_intra()
613 READ_ONEBIT(bitctx, &ph->background_picture_output_flag); in parse_picture_header_intra()
623 READ_BITS(bitctx, 8, &ph->doi); in parse_picture_header_intra()
626 READ_BITS(bitctx, 3, &ph->temporal_id); in parse_picture_header_intra()
631 READ_UE(bitctx, &ph->picture_output_delay); in parse_picture_header_intra()
642 READ_ONEBIT(bitctx, &predict); in parse_picture_header_intra()
646 READ_BITS(bitctx, 5, &rcs_index); in parse_picture_header_intra()
650 FUN_CHECK(ret = parse_one_rps(bitctx, &p_dec->frm_mgr.cur_rps)); in parse_picture_header_intra()
655 READ_UE(bitctx, &ph->bbv_check_times); in parse_picture_header_intra()
659 READ_ONEBIT(bitctx, &ph->progressive_frame); in parse_picture_header_intra()
662 READ_ONEBIT(bitctx, &ph->picture_structure); in parse_picture_header_intra()
667 READ_ONEBIT(bitctx, &ph->top_field_first); in parse_picture_header_intra()
669 READ_ONEBIT(bitctx, &ph->repeat_first_field); in parse_picture_header_intra()
672 READ_ONEBIT(bitctx, &ph->is_top_field); in parse_picture_header_intra()
674 SKIP_BITS(bitctx, 1); in parse_picture_header_intra()
677 READ_ONEBIT(bitctx, &ph->fixed_picture_qp); in parse_picture_header_intra()
679 READ_BITS(bitctx, 7, &ph->picture_qp); in parse_picture_header_intra()
693 return ret = bitctx->ret; in parse_picture_header_intra()
704 BitReadCtx_t *bitctx = &p_dec->bitctx; in parse_picture_header_inter() local
709 READ_BITS_LONG(bitctx, 32, &ph->bbv_delay); in parse_picture_header_inter()
710 READ_BITS(bitctx, 2, &ph->picture_coding_type); in parse_picture_header_inter()
713 READ_ONEBIT(bitctx, &ph->background_pred_flag); in parse_picture_header_inter()
717 READ_ONEBIT(bitctx, &ph->background_reference_flag); //!< P/F ref G/GB in parse_picture_header_inter()
733 READ_BITS(bitctx, 8, &ph->doi); in parse_picture_header_inter()
736 READ_BITS(bitctx, 3, &ph->temporal_id); in parse_picture_header_inter()
740 READ_UE(bitctx, &ph->picture_output_delay); in parse_picture_header_inter()
751 READ_ONEBIT(bitctx, &predict); in parse_picture_header_inter()
755 READ_BITS(bitctx, 5, &rcs_index); in parse_picture_header_inter()
758 FUN_CHECK(ret = parse_one_rps(bitctx, &p_dec->frm_mgr.cur_rps)); in parse_picture_header_inter()
763 READ_UE(bitctx, &ph->bbv_check_times); in parse_picture_header_inter()
766 READ_ONEBIT(bitctx, &ph->progressive_frame); in parse_picture_header_inter()
768 READ_ONEBIT(bitctx, &ph->picture_structure); in parse_picture_header_inter()
772 READ_ONEBIT(bitctx, &ph->top_field_first); in parse_picture_header_inter()
773 READ_ONEBIT(bitctx, &ph->repeat_first_field); in parse_picture_header_inter()
775 READ_ONEBIT(bitctx, &ph->is_top_field); in parse_picture_header_inter()
776 SKIP_BITS(bitctx, 1); in parse_picture_header_inter()
778 READ_ONEBIT(bitctx, &ph->fixed_picture_qp); in parse_picture_header_inter()
779 READ_BITS(bitctx, 7, &ph->picture_qp); in parse_picture_header_inter()
786 SKIP_BITS(bitctx, 1); in parse_picture_header_inter()
788 READ_ONEBIT(bitctx, &ph->enable_random_decodable); in parse_picture_header_inter()
794 return ret = bitctx->ret; in parse_picture_header_inter()