Lines Matching full:double
63 #define POW1 (double)cpi->oxcf.two_pass_vbrbias/100.0
64 #define POW2 (double)cpi->oxcf.two_pass_vbrbias/100.0
131 static double calculate_modified_err(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
133 double av_err = cpi->total_stats->ssim_weighted_pred_err;
134 double this_err = this_frame->ssim_weighted_pred_err;
135 double modified_err;
137 //double relative_next_iiratio;
138 //double next_iiratio;
139 //double sum_iiratio;
158 relative_next_iiratio = sum_iiratio / DOUBLE_DIVIDE_CHECK(cpi->avg_iiratio * (double)i);
179 static const double weight_table[256] = {
214 static double simple_weight(YV12_BUFFER_CONFIG *source)
219 double sum_weights = 0.0;
251 double buffer_fullness_ratio = (double)cpi->buffer_level / DOUBLE_DIVIDE_CHECK((double)cpi->oxcf.optimal_buffer_level);
254 max_bits = (int)(cpi->av_per_frame_bandwidth * ((double)cpi->oxcf.two_pass_vbrmax_section / 100.0));
272 max_bits = (int)(((double)cpi->bits_left / (cpi->total_stats->count - (double)cpi->common.current_video_frame)) * ((double)cpi->oxcf.two_pass_vbrmax_section / 100.0));
747 double weight = 0.0;
773 fps.pcnt_inter = 1.0 * (double)intercount / cm->MBs;
774 fps.pcnt_second_ref = 1.0 * (double)second_ref_count / cm->MBs;
775 fps.pcnt_neutral = 1.0 * (double)neutral_count / cm->MBs;
779 fps.MVr = (double)sum_mvr / (double)mvcount;
780 fps.mvr_abs = (double)sum_mvr_abs / (double)mvcount;
781 fps.MVc = (double)sum_mvc / (double)mvcount;
782 fps.mvc_abs = (double)sum_mvc_abs / (double)mvcount;
783 fps.MVrv = ((double)sum_mvrs - (fps.MVr * fps.MVr / (double)mvcount)) / (double)mvcount;
784 fps.MVcv = ((double)sum_mvcs - (fps.MVc * fps.MVc / (double)mvcount)) / (double)mvcount;
785 fps.mv_in_out_count = (double)sum_in_vectors / (double)(mvcount * 2);
787 fps.pcnt_motion = 1.0 * (double)mvcount / cpi->common.MBs;
843 static int estimate_max_q(VP8_COMP *cpi, double section_err, int section_target_bandwitdh)
849 double err_per_mb = section_err / num_mbs;
850 double correction_factor;
851 double corr_high;
852 double speed_correction = 1.0;
853 double rolling_ratio;
855 double pow_highq = 0.90;
856 double pow_lowq = 0.40;
866 //double adjustment_rate = 0.985 + (0.00005 * cpi->active_worst_quality);
867 double adjustment_rate = 0.99;
869 rolling_ratio = (double)cpi->rolling_actual_bits / (double)cpi->rolling_target_bits;
912 bits_per_mb_at_this_q = (int)(.5 + correction_factor * speed_correction * cpi->est_max_qcorrection_factor * cpi->section_max_qfactor * (double)vp8_bits_per_mb[INTER_FRAME][Q] / 1.0);
913 //bits_per_mb_at_this_q = (int)(.5 + correction_factor * speed_correction * cpi->est_max_qcorrection_factor * (double)vp8_bits_per_mb[INTER_FRAME][Q] / 1.0);
943 static int estimate_q(VP8_COMP *cpi, double section_err, int section_target_bandwitdh)
949 double err_per_mb = section_err / num_mbs;
950 double correction_factor;
951 double corr_high;
952 double speed_correction = 1.0;
953 double pow_highq = 0.90;
954 double pow_lowq = 0.40;
984 bits_per_mb_at_this_q = (int)(.5 + correction_factor * speed_correction * cpi->est_max_qcorrection_factor * (double)vp8_bits_per_mb[INTER_FRAME][Q] / 1.0);
994 static int estimate_kf_group_q(VP8_COMP *cpi, double section_err, int section_target_bandwitdh, double group_iiratio)
1001 double err_per_mb = section_err / num_mbs;
1002 double err_correction_factor;
1003 double corr_high;
1004 double speed_correction = 1.0;
1005 double current_spend_ratio = 1.0;
1007 double pow_highq = (POW1 < 0.6) ? POW1 + 0.3 : 0.90;
1008 double pow_lowq = (POW1 < 0.7) ? POW1 + 0.1 : 0.80;
1010 double iiratio_correction_factor = 1.0;
1012 double combined_correction_factor;
1024 current_spend_ratio = (double)cpi->long_rolling_actual_bits / (double)cpi->long_rolling_target_bits;
1063 bits_per_mb_at_this_q = (int)(.5 + err_correction_factor * combined_correction_factor * (double)vp8_bits_per_mb[INTER_FRAME][Q]);
1083 (double)cpi->buffer_level / (double)cpi->oxcf.optimal_buffer_level, Q);
1092 static int estimate_cq(VP8_COMP *cpi, double section_err, int section_target_bandwitdh)
1098 double err_per_mb = section_err / num_mbs;
1099 double correction_factor;
1100 double corr_high;
1101 double speed_correction = 1.0;
1102 double pow_highq = 0.90;
1103 double pow_lowq = 0.40;
1104 double clip_iiratio;
1105 double clip_iifactor;
1152 (double)vp8_bits_per_mb[INTER_FRAME][Q] / 1.0);
1161 extern void vp8_new_frame_rate(VP8_COMP *cpi, double framerate);
1168 double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth * cpi->oxcf.two_pass_vbrmin_section / 100);
1182 //cpi->bits_left = (long long)(cpi->total_stats->count * cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->oxcf.frame_rate));
1183 //cpi->bits_left -= (long long)(cpi->total_stats->count * two_pass_min_rate / DOUBLE_DIVIDE_CHECK((double)cpi->oxcf.frame_rate));
1208 double sum_iiratio = 0.0;
1209 double IIRatio;
1220 cpi->avg_iiratio = sum_iiratio / DOUBLE_DIVIDE_CHECK((double)cpi->total_stats->count);
1257 static double get_prediction_decay_rate(VP8_COMP *cpi, FIRSTPASS_STATS *next_frame)
1259 double prediction_decay_rate;
1260 double motion_decay;
1261 double motion_pct = next_frame->pcnt_motion;
1274 double this_mv_rabs;
1275 double this_mv_cabs;
1276 double distance_factor;
1299 double loop_decay_rate,
1300 double decay_accumulator )
1314 double decay_rate;
1347 double boost_score = 0.0;
1348 double old_boost_score = 0.0;
1349 double gf_group_err = 0.0;
1350 double gf_first_frame_err = 0.0;
1351 double mod_frame_err = 0.0;
1353 double mv_accumulator_rabs = 0.0;
1354 double mv_accumulator_cabs = 0.0;
1355 double mv_ratio_accumulator = 0.0;
1356 double decay_accumulator = 1.0;
1358 double boost_factor = IIFACTOR;
1359 double loop_decay_rate = 1.00; // Starting decay rate
1361 double this_frame_mv_in_out = 0.0;
1362 double mv_in_out_accumulator = 0.0;
1363 double abs_mv_in_out_accumulator = 0.0;
1364 double mod_err_per_mb_accumulator = 0.0;
1402 double r;
1403 double this_frame_mvr_ratio;
1404 double this_frame_mvc_ratio;
1405 double motion_decay;
1406 //double motion_pct = next_frame.pcnt_motion;
1407 double motion_pct;
1417 mod_frame_err / DOUBLE_DIVIDE_CHECK((double)cpi->common.MBs);
1535 double max_boost;
1544 max_boost = ((double)((cpi->buffer_level - df_buffer_level) * 2 / 3) * 16.0) / DOUBLE_DIVIDE_CHECK((double)cpi->av_per_frame_bandwidth);
1550 max_boost = ((double)(cpi->buffer_level * 2 / 3) * 16.0) / DOUBLE_DIVIDE_CHECK((double)cpi->av_per_frame_bandwidth);
1569 ((mv_in_out_accumulator / (double)i > -0.2) || (mv_in_out_accumulator > -2.0)) &&
1589 group_bits = (int)((double)cpi->kf_group_bits * (gf_group_err / (double)cpi->kf_group_error_left));
1606 arf_frame_bits = (int)((double)Boost * (group_bits / (double)allocation_chunks));
1714 cpi->gf_group_bits = (int)((double)cpi->kf_group_bits * (gf_group_err / (double)cpi->kf_group_error_left));
1777 cpi->gf_bits = (int)((double)Boost * (cpi->gf_group_bits / (double)allocation_chunks));
1782 if (mod_frame_err < gf_group_err / (double)cpi->baseline_gf_interval)
1784 double alt_gf_grp_bits;
1788 (double)cpi->kf_group_bits *
1789 (mod_frame_err * (double)cpi->baseline_gf_interval) /
1790 DOUBLE_DIVIDE_CHECK((double)cpi->kf_group_error_left);
1792 alt_gf_bits = (int)((double)Boost * (alt_gf_grp_bits /
1793 (double)allocation_chunks));
1806 (int)((double)cpi->kf_group_bits *
1808 DOUBLE_DIVIDE_CHECK((double)cpi->kf_group_error_left));
1870 double Ratio;
1908 double modified_err;
1909 double err_fraction; // What portion of the remaining GF group error is used by this frame
1927 target_frame_size = (int)((double)cpi->gf_group_bits * err_fraction); // How many of those bits available for allocation should we give it?
1966 double this_frame_error;
1967 double this_frame_intra_error;
1968 double this_frame_coded_error;
2025 (double)(cpi->clip_bits_total - cpi->bits_left) /
2196 double boost_score = 0.0;
2197 double old_boost_score = 0.0;
2198 double decay_accumulator = 1.0;
2199 double next_iiratio;
2267 double decay_accumulator = 1.0;
2268 double boost_score = 0;
2269 double old_boost_score = 0.0;
2270 double loop_decay_rate;
2272 double kf_mod_err = 0.0;
2273 double kf_group_err = 0.0;
2274 double kf_group_intra_err = 0.0;
2275 double kf_group_coded_err = 0.0;
2276 double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth * cpi->oxcf.two_pass_vbrmin_section / 100);
2277 double recent_loop_decay[8] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0};
2478 (long long)((double)bits_below_av *
2479 (double)(buffer_lvl - opt_buffer_lvl) /
2480 (double)(high_water_mark - opt_buffer_lvl));
2498 double r;
2499 double motion_decay;
2500 double motion_pct;
2535 double Ratio;
2566 double max_boost;
2573 max_boost = ((double)((cpi->buffer_level - df_buffer_level) * 2 / 3) * 16.0) / DOUBLE_DIVIDE_CHECK((double)cpi->av_per_frame_bandwidth);
2579 max_boost = ((double)(cpi->buffer_level * 2 / 3) * 16.0) / DOUBLE_DIVIDE_CHECK((double)cpi->av_per_frame_bandwidth);
2625 kf_boost = (int)((double)kf_boost * 100.0) >> 4; // Scale 16 to 100
2650 cpi->kf_bits = (int)((double)kf_boost * ((double)cpi->kf_group_bits / (double)allocation_chunks));
2665 double alt_kf_grp_bits =
2666 ((double)cpi->bits_left *
2667 (kf_mod_err * (double)cpi->frames_to_key) /
2670 alt_kf_bits = (int)((double)kf_boost *
2671 (alt_kf_grp_bits / (double)allocation_chunks));
2684 (int)((double)cpi->bits_left *
2721 double projected_bits_perframe;
2722 double group_iiratio = (kf_group_intra_err - first_frame.intra_error) / (kf_group_coded_err - first_frame.coded_error);
2723 double err_per_frame = kf_group_err / cpi->frames_to_key;
2724 double bits_per_frame;
2725 double av_bits_per_frame;
2726 double effective_size_ratio;
2736 //av_bits_per_frame = cpi->bits_left/(double)(cpi->total_stats->count - cpi->common.current_video_frame);
2737 av_bits_per_frame = cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->oxcf.frame_rate);
2799 long long clip_bits = (long long)(cpi->total_stats->count * cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->oxcf.frame_rate));
2829 effective_size_ratio = (double)(new_width * new_height) / (double)(cpi->oxcf.Width * cpi->oxcf.Height);