Lines Matching refs:ps_rd_model
81 void init_frm_rc_rd_model(rc_rd_model_t *ps_rd_model, UWORD8 u1_max_frames_modelled) in init_frm_rc_rd_model() argument
85 ps_rd_model->u1_num_frms_in_model = 0; in init_frm_rc_rd_model()
86 ps_rd_model->u1_curr_frm_counter = 0; in init_frm_rc_rd_model()
87 ps_rd_model->u1_max_frms_to_model = u1_max_frames_modelled; in init_frm_rc_rd_model()
93 ps_rd_model->model_coeff_a_quad = 0; in init_frm_rc_rd_model()
94 ps_rd_model->model_coeff_b_quad = 0; in init_frm_rc_rd_model()
95 ps_rd_model->model_coeff_c_quad = 0; in init_frm_rc_rd_model()
97 ps_rd_model->model_coeff_a_lin = 0; in init_frm_rc_rd_model()
98 ps_rd_model->model_coeff_b_lin = 0; in init_frm_rc_rd_model()
99 ps_rd_model->model_coeff_c_lin = 0; in init_frm_rc_rd_model()
101 ps_rd_model->model_coeff_a_lin_wo_int = 0; in init_frm_rc_rd_model()
102 ps_rd_model->model_coeff_b_lin_wo_int = 0; in init_frm_rc_rd_model()
103 ps_rd_model->model_coeff_c_lin_wo_int = 0; in init_frm_rc_rd_model()
106 void reset_frm_rc_rd_model(rc_rd_model_t *ps_rd_model) in reset_frm_rc_rd_model() argument
110 ps_rd_model->u1_num_frms_in_model = 0; in reset_frm_rc_rd_model()
111 ps_rd_model->u1_curr_frm_counter = 0; in reset_frm_rc_rd_model()
112 ps_rd_model->model_coeff_a_quad = 0; in reset_frm_rc_rd_model()
113 ps_rd_model->model_coeff_b_quad = 0; in reset_frm_rc_rd_model()
114 ps_rd_model->model_coeff_c_quad = 0; in reset_frm_rc_rd_model()
116 ps_rd_model->model_coeff_a_lin = 0; in reset_frm_rc_rd_model()
117 ps_rd_model->model_coeff_b_lin = 0; in reset_frm_rc_rd_model()
118 ps_rd_model->model_coeff_c_lin = 0; in reset_frm_rc_rd_model()
120 ps_rd_model->model_coeff_a_lin_wo_int = 0; in reset_frm_rc_rd_model()
121 ps_rd_model->model_coeff_b_lin_wo_int = 0; in reset_frm_rc_rd_model()
122 ps_rd_model->model_coeff_c_lin_wo_int = 0; in reset_frm_rc_rd_model()
138 rc_rd_model_t *ps_rd_model) in find_model_coeffs() argument
246 u1_curr_frame_index = ps_rd_model->u1_curr_frm_counter; in find_model_coeffs()
252 u1_avgqp_prvfrm = ps_rd_model->pu1_avg_qp[u1_curr_frame_index]; in find_model_coeffs()
253 u4_prevfrm_bits = ps_rd_model->pi4_res_bits[u1_curr_frame_index]; in find_model_coeffs()
254 u4_prevfrm_sad = ps_rd_model->pi4_sad[u1_curr_frame_index]; in find_model_coeffs()
386 static void update_frame_rd_model(rc_rd_model_t *ps_rd_model) in update_frame_rd_model() argument
409 u1_curr_frame_index = ps_rd_model->u1_curr_frm_counter; in update_frame_rd_model()
411 ps_rd_model->u1_model_used = QUAD_MODEL; in update_frame_rd_model()
430 u1_num_active_frames = ps_rd_model->u1_num_frms_in_model; in update_frame_rd_model()
442 u1_num_skips_temp = ps_rd_model->pu1_num_skips[u1_curr_frame_index]; in update_frame_rd_model()
443 u1_avg_mpeg2_qp_temp = ps_rd_model->pu1_avg_qp[u1_curr_frame_index]; in update_frame_rd_model()
486 for(; i < ps_rd_model->u1_num_frms_in_model; i++) in update_frame_rd_model()
488 u1_num_skips_temp = ps_rd_model->pu1_num_skips[u1_curr_frame_index]; in update_frame_rd_model()
489 u1_avg_mpeg2_qp_temp = ps_rd_model->pu1_avg_qp[u1_curr_frame_index]; in update_frame_rd_model()
524 if(QUAD_MODEL == ps_rd_model->u1_model_used) in update_frame_rd_model()
527 ps_rd_model->u1_model_used = LIN_MODEL; in update_frame_rd_model()
529 ps_rd_model->u1_model_used = LIN_MODEL; in update_frame_rd_model()
532 if(LIN_MODEL == ps_rd_model->u1_model_used) in update_frame_rd_model()
535 ps_rd_model->u1_model_used = PREV_FRAME_MODEL; in update_frame_rd_model()
537 ps_rd_model->u1_model_used = PREV_FRAME_MODEL; in update_frame_rd_model()
541 ps_rd_model->u1_model_used = find_model_coeffs( in update_frame_rd_model()
542 ps_rd_model->pi4_res_bits, in update_frame_rd_model()
543 ps_rd_model->pi4_sad, in update_frame_rd_model()
544 ps_rd_model->pu1_num_skips, in update_frame_rd_model()
545 ps_rd_model->pu1_avg_qp, in update_frame_rd_model()
547 ps_rd_model->u1_model_used, in update_frame_rd_model()
552 ps_rd_model); in update_frame_rd_model()
561 ps_rd_model->pi4_res_bits, in update_frame_rd_model()
562 ps_rd_model->pi4_sad, in update_frame_rd_model()
563 ps_rd_model->pu1_num_skips, in update_frame_rd_model()
564 ps_rd_model->pu1_avg_qp, in update_frame_rd_model()
571 if(QUAD_MODEL == ps_rd_model->u1_model_used) in update_frame_rd_model()
574 ps_rd_model->pi4_res_bits, in update_frame_rd_model()
575 ps_rd_model->pi4_sad, in update_frame_rd_model()
576 ps_rd_model->pu1_num_skips, in update_frame_rd_model()
577 ps_rd_model->pu1_avg_qp, in update_frame_rd_model()
585 ps_rd_model->u1_model_used = QUAD_MODEL; in update_frame_rd_model()
595 ps_rd_model->u1_model_used = find_model_coeffs( in update_frame_rd_model()
596 ps_rd_model->pi4_res_bits, in update_frame_rd_model()
597 ps_rd_model->pi4_sad, in update_frame_rd_model()
598 ps_rd_model->pu1_num_skips, in update_frame_rd_model()
599 ps_rd_model->pu1_avg_qp, in update_frame_rd_model()
601 ps_rd_model->u1_model_used, in update_frame_rd_model()
606 ps_rd_model); in update_frame_rd_model()
609 ps_rd_model->pi4_res_bits, in update_frame_rd_model()
610 ps_rd_model->pi4_sad, in update_frame_rd_model()
611 ps_rd_model->pu1_num_skips, in update_frame_rd_model()
612 ps_rd_model->pu1_avg_qp, in update_frame_rd_model()
623 ps_rd_model->u1_model_used = LIN_MODEL; in update_frame_rd_model()
628 if(QUAD_MODEL == ps_rd_model->u1_model_used) in update_frame_rd_model()
634 ps_rd_model->u1_model_used = LIN_MODEL; in update_frame_rd_model()
639 if(LIN_MODEL == ps_rd_model->u1_model_used) in update_frame_rd_model()
642 ps_rd_model->u1_model_used = PREV_FRAME_MODEL; in update_frame_rd_model()
647 if((QUAD_MODEL == ps_rd_model->u1_model_used) && (fl_quad_avg_dev > .25)) in update_frame_rd_model()
648 ps_rd_model->u1_model_used = PREV_FRAME_MODEL; in update_frame_rd_model()
650 if((LIN_MODEL == ps_rd_model->u1_model_used) && (fl_lin_avg_dev > .25)) in update_frame_rd_model()
651 ps_rd_model->u1_model_used = PREV_FRAME_MODEL; in update_frame_rd_model()
654 ps_rd_model->model_coeff_b_quad = model_coeff_array[0]; in update_frame_rd_model()
655 ps_rd_model->model_coeff_a_quad = model_coeff_array[1]; in update_frame_rd_model()
656 ps_rd_model->model_coeff_c_quad = model_coeff_array[2]; in update_frame_rd_model()
658 ps_rd_model->model_coeff_b_lin = model_coeff_array_lin[0]; in update_frame_rd_model()
659 ps_rd_model->model_coeff_a_lin = model_coeff_array_lin[1]; in update_frame_rd_model()
660 ps_rd_model->model_coeff_c_lin = model_coeff_array_lin[2]; in update_frame_rd_model()
662 ps_rd_model->model_coeff_b_lin_wo_int = model_coeff_array_lin_wo_int[0]; in update_frame_rd_model()
663 ps_rd_model->model_coeff_a_lin_wo_int = model_coeff_array_lin_wo_int[1]; in update_frame_rd_model()
664 ps_rd_model->model_coeff_c_lin_wo_int = model_coeff_array_lin_wo_int[2]; in update_frame_rd_model()
670 UWORD32 estimate_bits_for_qp(rc_rd_model_t *ps_rd_model, UWORD32 u4_estimated_sad, UWORD8 u1_avg_qp) in estimate_bits_for_qp() argument
677 ps_rd_model->model_coeff_a_lin_wo_int * ((float)(u4_estimated_sad / u1_avg_qp)); in estimate_bits_for_qp()
684 rc_rd_model_t *ps_rd_model, in find_qp_for_target_bits() argument
694 if(QUAD_MODEL == ps_rd_model->u1_model_used) in find_qp_for_target_bits()
697 det = (ps_rd_model->model_coeff_a_quad * ps_rd_model->model_coeff_a_quad) - in find_qp_for_target_bits()
698 (4 * (ps_rd_model->model_coeff_b_quad) * in find_qp_for_target_bits()
699 (ps_rd_model->model_coeff_c_quad - u4_target_res_bits)); in find_qp_for_target_bits()
706 (x_value - ps_rd_model->model_coeff_a_quad) / (2 * ps_rd_model->model_coeff_b_quad); in find_qp_for_target_bits()
709 ps_rd_model->u1_model_used = PREV_FRAME_MODEL; in find_qp_for_target_bits()
712 if(LIN_MODEL == ps_rd_model->u1_model_used) in find_qp_for_target_bits()
714 x_value = ((float)u4_target_res_bits - ps_rd_model->model_coeff_c_lin) / in find_qp_for_target_bits()
715 (ps_rd_model->model_coeff_b_lin); in find_qp_for_target_bits()
718 ps_rd_model->u1_model_used = PREV_FRAME_MODEL; in find_qp_for_target_bits()
721 if(PREV_FRAME_MODEL == ps_rd_model->u1_model_used) in find_qp_for_target_bits()
723 x_value = (float)u4_target_res_bits / ps_rd_model->model_coeff_a_lin_wo_int; in find_qp_for_target_bits()
746 rc_rd_model_t *ps_rd_model, in add_frame_to_rd_model() argument
754 u1_curr_frame_index = ps_rd_model->u1_curr_frm_counter; in add_frame_to_rd_model()
756 ps_rd_model->pi4_res_bits[u1_curr_frame_index] = i4_res_bits; in add_frame_to_rd_model()
757 ps_rd_model->pi4_sad[u1_curr_frame_index] = i4_sad_h264; in add_frame_to_rd_model()
758 ps_rd_model->pu1_num_skips[u1_curr_frame_index] = u1_num_skips; in add_frame_to_rd_model()
759 ps_rd_model->pu1_avg_qp[u1_curr_frame_index] = u1_avg_mp2qp; in add_frame_to_rd_model()
761 ps_rd_model->u1_curr_frm_counter++; in add_frame_to_rd_model()
762 if(MAX_FRAMES_MODELLED == ps_rd_model->u1_curr_frm_counter) in add_frame_to_rd_model()
763 ps_rd_model->u1_curr_frm_counter = 0; in add_frame_to_rd_model()
765 if(ps_rd_model->u1_num_frms_in_model < ps_rd_model->u1_max_frms_to_model) in add_frame_to_rd_model()
767 ps_rd_model->u1_num_frms_in_model++; in add_frame_to_rd_model()
769 update_frame_rd_model(ps_rd_model); in add_frame_to_rd_model()
773 rc_rd_model_t *ps_rd_model, /* array of model structs */ in calc_per_frm_bits() argument
803 update_frame_rd_model(&ps_rd_model[u1_i]); in calc_per_frm_bits()
819 ps_rd_model_of_pic_type = ps_rd_model + u1_i; in calc_per_frm_bits()
833 ps_rd_model_of_pic_type = ps_rd_model + u1_i; in calc_per_frm_bits()
864 ps_rd_model_of_pic_type = ps_rd_model + u1_i; in calc_per_frm_bits()
896 ps_rd_model_of_pic_type = ps_rd_model + u1_curr_pic_type; in calc_per_frm_bits()
914 ps_rd_model_of_pic_type = ps_rd_model + u1_i; in calc_per_frm_bits()
939 ps_rd_model_of_pic_type = ps_rd_model + u1_curr_pic_type; in calc_per_frm_bits()
955 ps_rd_model_of_pic_type = ps_rd_model + u1_i; in calc_per_frm_bits()
967 ps_rd_model_of_pic_type = ps_rd_model + u1_curr_pic_type; in calc_per_frm_bits()
975 ps_rd_model_of_pic_type = ps_rd_model + u1_curr_pic_type; in calc_per_frm_bits()
994 model_coeff get_linear_coefficient(rc_rd_model_t *ps_rd_model) in get_linear_coefficient() argument
998 return (ps_rd_model->model_coeff_a_lin_wo_int); in get_linear_coefficient()