Home | History | Annotate | Download | only in encoder

Lines Matching refs:oxcf

1036             if (cpi->oxcf.encode_breakout > 2000)
1037 min = cpi->oxcf.encode_breakout;
1205 buffers = cpi->oxcf.lag_in_frames;
1215 cpi->oxcf.Width, cpi->oxcf.Height,
1223 cpi->oxcf.Width, cpi->oxcf.Height, 16))
1328 cpi->oxcf.frame_rate = framerate;
1329 cpi->output_frame_rate = cpi->oxcf.frame_rate;
1330 cpi->per_frame_bandwidth = (int)(cpi->oxcf.target_bandwidth / cpi->output_frame_rate);
1331 cpi->av_per_frame_bandwidth = (int)(cpi->oxcf.target_bandwidth / cpi->output_frame_rate);
1332 cpi->min_frame_bandwidth = (int)(cpi->av_per_frame_bandwidth * cpi->oxcf.two_pass_vbrmin_section / 100);
1348 if (cpi->oxcf.play_alternate && cpi->oxcf.lag_in_frames)
1350 if (cpi->max_gf_interval > cpi->oxcf.lag_in_frames - 1)
1351 cpi->max_gf_interval = cpi->oxcf.lag_in_frames - 1;
1367 void vp8_init_config(VP8_PTR ptr, VP8_CONFIG *oxcf)
1382 cm->version = oxcf->Version;
1385 if (oxcf == 0)
1390 cpi->oxcf.best_allowed_q = MINQ;
1391 cpi->oxcf.worst_allowed_q = MAXQ;
1393 cpi->oxcf.end_usage = USAGE_STREAM_FROM_SERVER;
1394 cpi->oxcf.starting_buffer_level = 4000;
1395 cpi->oxcf.optimal_buffer_level = 5000;
1396 cpi->oxcf.maximum_buffer_size = 6000;
1397 cpi->oxcf.under_shoot_pct = 90;
1398 cpi->oxcf.allow_df = 0;
1399 cpi->oxcf.drop_frames_water_mark = 20;
1401 cpi->oxcf.allow_spatial_resampling = 0;
1402 cpi->oxcf.resample_down_water_mark = 40;
1403 cpi->oxcf.resample_up_water_mark = 60;
1405 cpi->oxcf.fixed_q = cpi->interquantizer;
1415 cpi->oxcf.two_pass_vbrbias = 50;
1416 cpi->oxcf.two_pass_vbrmax_section = 400;
1417 cpi->oxcf.two_pass_vbrmin_section = 0;
1419 cpi->oxcf.Sharpness = 0;
1420 cpi->oxcf.noise_sensitivity = 0;
1423 cpi->oxcf = *oxcf;
1426 switch (cpi->oxcf.Mode)
1433 if (cpi->oxcf.cpu_used < -16)
1435 cpi->oxcf.cpu_used = -16;
1438 if (cpi->oxcf.cpu_used > 16)
1439 cpi->oxcf.cpu_used = 16;
1448 if (cpi->oxcf.cpu_used < -5)
1450 cpi->oxcf.cpu_used = -5;
1453 if (cpi->oxcf.cpu_used > 5)
1454 cpi->oxcf.cpu_used = 5;
1471 if (cpi->oxcf.cpu_used < -5)
1473 cpi->oxcf.cpu_used = -5;
1476 if (cpi->oxcf.cpu_used > 5)
1477 cpi->oxcf.cpu_used = 5;
1490 cpi->oxcf.worst_allowed_q = q_trans[oxcf->worst_allowed_q];
1491 cpi->oxcf.best_allowed_q = q_trans[oxcf->best_allowed_q];
1493 if (oxcf->fixed_q >= 0)
1495 if (oxcf->worst_allowed_q < 0)
1496 cpi->oxcf.fixed_q = q_trans[0];
1498 cpi->oxcf.fixed_q = q_trans[oxcf->worst_allowed_q];
1500 if (oxcf->alt_q < 0)
1501 cpi->oxcf.alt_q = q_trans[0];
1503 cpi->oxcf.alt_q = q_trans[oxcf->alt_q];
1505 if (oxcf->key_q < 0)
1506 cpi->oxcf.key_q = q_trans[0];
1508 cpi->oxcf.key_q = q_trans[oxcf->key_q];
1510 if (oxcf->gold_q < 0)
1511 cpi->oxcf.gold_q = q_trans[0];
1513 cpi->oxcf.gold_q = q_trans[oxcf->gold_q];
1517 cpi->baseline_gf_interval = cpi->oxcf.alt_freq ? cpi->oxcf.alt_freq : DEFAULT_GF_INTERVAL;
1526 if (cpi->oxcf.token_partitions >= 0 && cpi->oxcf.token_partitions <= 3)
1527 cm->multi_token_partition = (TOKEN_PARTITION) cpi->oxcf.token_partitions;
1535 cpi->segment_encode_breakout[i] = cpi->oxcf.encode_breakout;
1539 if (cpi->oxcf.fixed_q > MAXQ)
1540 cpi->oxcf.fixed_q = MAXQ;
1543 if (cpi->oxcf.end_usage == USAGE_LOCAL_FILE_PLAYBACK)
1545 cpi->oxcf.starting_buffer_level = 60000;
1546 cpi->oxcf.optimal_buffer_level = 60000;
1547 cpi->oxcf.maximum_buffer_size = 240000;
1553 cpi->oxcf.target_bandwidth *= 1000;
1554 cpi->oxcf.starting_buffer_level =
1555 rescale(cpi->oxcf.starting_buffer_level,
1556 cpi->oxcf.target_bandwidth, 1000);
1558 if (cpi->oxcf.optimal_buffer_level == 0)
1559 cpi->oxcf.optimal_buffer_level = cpi->oxcf.target_bandwidth / 8;
1561 cpi->oxcf.optimal_buffer_level =
1562 rescale(cpi->oxcf.optimal_buffer_level,
1563 cpi->oxcf.target_bandwidth, 1000);
1565 if (cpi->oxcf.maximum_buffer_size == 0)
1566 cpi->oxcf.maximum_buffer_size = cpi->oxcf.target_bandwidth / 8;
1568 cpi->oxcf.maximum_buffer_size =
1569 rescale(cpi->oxcf.maximum_buffer_size,
1570 cpi->oxcf.target_bandwidth, 1000);
1572 cpi->buffer_level = cpi->oxcf.starting_buffer_level;
1573 cpi->bits_off_target = cpi->oxcf.starting_buffer_level;
1575 vp8_new_frame_rate(cpi, cpi->oxcf.frame_rate);
1576 cpi->worst_quality = cpi->oxcf.worst_allowed_q;
1577 oxcf.worst_allowed_q;
1578 cpi->avg_frame_qindex = cpi->oxcf.worst_allowed_q;
1579 cpi->best_quality = cpi->oxcf.best_allowed_q;
1580 cpi->active_best_quality = cpi->oxcf.best_allowed_q;
1581 cpi->buffered_mode = (cpi->oxcf.optimal_buffer_level > 0) ? TRUE : FALSE;
1588 cpi->drop_frames_allowed = cpi->oxcf.allow_df && cpi->buffered_mode;
1597 cpi->target_bandwidth = cpi->oxcf.target_bandwidth;
1599 cm->Width = cpi->oxcf.Width ;
1600 cm->Height = cpi->oxcf.Height ;
1608 if (cpi->oxcf.Sharpness > 7)
1609 cpi->oxcf.Sharpness = 7;
1611 cm->sharpness_level = cpi->oxcf.Sharpness;
1622 cm->Width = (hs - 1 + cpi->oxcf.Width * hr) / hs;
1623 cm->Height = (vs - 1 + cpi->oxcf.Height * vr) / vs;
1638 if (cpi->oxcf.fixed_q >= 0)
1640 cpi->last_q[0] = cpi->oxcf.fixed_q;
1641 cpi->last_q[1] = cpi->oxcf.fixed_q;
1644 cpi->Speed = cpi->oxcf.cpu_used;
1647 if (cpi->oxcf.lag_in_frames == 0)
1649 cpi->oxcf.allow_lag = 0;
1652 else if (cpi->oxcf.lag_in_frames > MAX_LAG_BUFFERS)
1653 cpi->oxcf.lag_in_frames = MAX_LAG_BUFFERS;
1684 void vp8_change_config(VP8_PTR ptr, VP8_CONFIG *oxcf)
1692 if (!oxcf)
1695 if (cm->version != oxcf->Version)
1697 cm->version = oxcf->Version;
1701 cpi->oxcf = *oxcf;
1703 switch (cpi->oxcf.Mode)
1710 if (cpi->oxcf.cpu_used < -16)
1712 cpi->oxcf.cpu_used = -16;
1715 if (cpi->oxcf.cpu_used > 16)
1716 cpi->oxcf.cpu_used = 16;
1725 if (cpi->oxcf.cpu_used < -5)
1727 cpi->oxcf.cpu_used = -5;
1730 if (cpi->oxcf.cpu_used > 5)
1731 cpi->oxcf.cpu_used = 5;
1748 if (cpi->oxcf.cpu_used < -5)
1750 cpi->oxcf.cpu_used = -5;
1753 if (cpi->oxcf.cpu_used > 5)
1754 cpi->oxcf.cpu_used = 5;
1767 cpi->oxcf.worst_allowed_q = q_trans[oxcf->worst_allowed_q];
1768 cpi->oxcf.best_allowed_q = q_trans[oxcf->best_allowed_q];
1770 if (oxcf->fixed_q >= 0)
1772 if (oxcf->worst_allowed_q < 0)
1773 cpi->oxcf.fixed_q = q_trans[0];
1775 cpi->oxcf.fixed_q = q_trans[oxcf->worst_allowed_q];
1777 if (oxcf->alt_q < 0)
1778 cpi->oxcf.alt_q = q_trans[0];
1780 cpi->oxcf.alt_q = q_trans[oxcf->alt_q];
1782 if (oxcf->key_q < 0)
1783 cpi->oxcf.key_q = q_trans[0];
1785 cpi->oxcf.key_q = q_trans[oxcf->key_q];
1787 if (oxcf->gold_q < 0)
1788 cpi->oxcf.gold_q = q_trans[0];
1790 cpi->oxcf.gold_q = q_trans[oxcf->gold_q];
1794 cpi->baseline_gf_interval = cpi->oxcf.alt_freq ? cpi->oxcf.alt_freq : DEFAULT_GF_INTERVAL;
1804 if (cpi->oxcf.token_partitions >= 0 && cpi->oxcf.token_partitions <= 3)
1805 cm->multi_token_partition = (TOKEN_PARTITION) cpi->oxcf.token_partitions;
1813 cpi->segment_encode_breakout[i] = cpi->oxcf.encode_breakout;
1817 if (cpi->oxcf.fixed_q > MAXQ)
1818 cpi->oxcf.fixed_q = MAXQ;
1821 if (cpi->oxcf.end_usage == USAGE_LOCAL_FILE_PLAYBACK)
1823 cpi->oxcf.starting_buffer_level = 60000;
1824 cpi->oxcf.optimal_buffer_level = 60000;
1825 cpi->oxcf.maximum_buffer_size = 240000;
1830 cpi->oxcf.target_bandwidth *= 1000;
1832 cpi->oxcf.starting_buffer_level =
1833 rescale(cpi->oxcf.starting_buffer_level,
1834 cpi->oxcf.target_bandwidth, 1000);
1836 if (cpi->oxcf.optimal_buffer_level == 0)
1837 cpi->oxcf.optimal_buffer_level = cpi->oxcf.target_bandwidth / 8;
1839 cpi->oxcf.optimal_buffer_level =
1840 rescale(cpi->oxcf.optimal_buffer_level,
1841 cpi->oxcf.target_bandwidth, 1000);
1843 if (cpi->oxcf.maximum_buffer_size == 0)
1844 cpi->oxcf.maximum_buffer_size = cpi->oxcf.target_bandwidth / 8;
1846 cpi->oxcf.maximum_buffer_size =
1847 rescale(cpi->oxcf.maximum_buffer_size,
1848 cpi->oxcf.target_bandwidth, 1000);
1850 cpi->buffer_level = cpi->oxcf.starting_buffer_level;
1851 cpi->bits_off_target = cpi->oxcf.starting_buffer_level;
1853 vp8_new_frame_rate(cpi, cpi->oxcf.frame_rate);
1854 cpi->worst_quality = cpi->oxcf.worst_allowed_q;
1855 cpi->active_worst_quality = cpi->oxcf.worst_allowed_q;
1856 cpi->avg_frame_qindex = cpi->oxcf.worst_allowed_q;
1857 cpi->best_quality = cpi->oxcf.best_allowed_q;
1858 cpi->active_best_quality = cpi->oxcf.best_allowed_q;
1859 cpi->buffered_mode = (cpi->oxcf.optimal_buffer_level > 0) ? TRUE : FALSE;
1866 cpi->drop_frames_allowed = cpi->oxcf.allow_df && cpi->buffered_mode;
1875 cpi->target_bandwidth = cpi->oxcf.target_bandwidth;
1877 cm->Width = cpi->oxcf.Width ;
1878 cm->Height = cpi->oxcf.Height ;
1886 if (cpi->oxcf.Sharpness > 7)
1887 cpi->oxcf.Sharpness = 7;
1889 cm->sharpness_level = cpi->oxcf.Sharpness;
1900 cm->Width = (hs - 1 + cpi->oxcf.Width * hr) / hs;
1901 cm->Height = (vs - 1 + cpi->oxcf.Height * vr) / vs;
1916 if (cpi->oxcf.fixed_q >= 0)
1918 cpi->last_q[0] = cpi->oxcf.fixed_q;
1919 cpi->last_q[1] = cpi->oxcf.fixed_q;
1922 cpi->Speed = cpi->oxcf.cpu_used;
1925 if (cpi->oxcf.lag_in_frames == 0)
1927 cpi->oxcf.allow_lag = 0;
1930 else if (cpi->oxcf.lag_in_frames > MAX_LAG_BUFFERS)
1931 cpi->oxcf.lag_in_frames = MAX_LAG_BUFFERS;
1965 VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf)
2003 vp8_init_config((VP8_PTR)cpi, oxcf);
2069 cpi->cyclic_refresh_mode_enabled = cpi->oxcf.error_resilient_mode;
2098 cpi->key_frame_frequency = cpi->oxcf.key_freq;
2147 cpi->ni_av_qi = cpi->oxcf.worst_allowed_q;
2187 cpi->output_pkt_list = oxcf->output_pkt_list;
2197 cpi->stats_in = oxcf->two_pass_stats_in.buf;
2199 + oxcf->two_pass_stats_in.sz / sizeof(FIRSTPASS_STATS)
2318 fprintf(f, "minq:%d -maxq:%d skipture:skipfalse = %d:%d\n", cpi->oxcf.best_allowed_q, cpi->oxcf.worst_allowed_q, skiptruecount, skipfalsecount);
2350 double dr = (double)cpi->oxcf.frame_rate * (double)bytes * (double)8 / (double)count / (double)1000 ;
2766 if (cpi->oxcf.allow_spatial_resampling && (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER))
2773 if (cpi->buffer_level < (cpi->oxcf.resample_down_water_mark * cpi->oxcf.optimal_buffer_level / 100))
2779 else if (cpi->buffer_level > (cpi->oxcf.resample_up_water_mark * cpi->oxcf.optimal_buffer_level / 100))
2788 new_width = ((hs - 1) + (cpi->oxcf.Width * hr)) / hs;
2789 new_height = ((vs - 1) + (cpi->oxcf.Height * vr)) / vs;
2820 cpi->this_frame_target = cpi->oxcf.target_bandwidth / 2;
2824 if (cpi->oxcf.error_resilient_mode == 1 || (cpi->compressor_speed == 2))
2983 if (cpi->oxcf.fixed_q >= 0 &&
2984 cpi->oxcf.play_alternate && !cpi->common.refresh_alt_ref_frame)
3397 int strength = cpi->oxcf.arnr_strength;
3399 int blur_type = cpi->oxcf.arnr_type;
3401 int new_max_frames = cpi->oxcf.arnr_max_frames;
3409 num_frames_backward += cpi->oxcf.lag_in_frames;
3411 num_frames_forward = cpi->oxcf.lag_in_frames - (num_frames_backward + 1);
3484 start_frame = (cpi->last_alt_ref_sei + frames_to_blur_forward) % cpi->oxcf.lag_in_frames;
3505 which_buffer += cpi->oxcf.lag_in_frames;
3532 which_buffer += cpi->oxcf.lag_in_frames;
3557 which_buffer += cpi->oxcf.lag_in_frames;
3602 int drop_mark = cpi->oxcf.drop_frames_water_mark * cpi->oxcf.optimal_buffer_level / 100;
3649 (cpi->oxcf.auto_key && (cpi->frames_since_key % cpi->key_frame_frequency == 0)))
3764 if ((cm->frame_type == KEY_FRAME)) // && cpi->oxcf.allow_spatial_resampling )
3800 if ((cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) &&
3801 (cpi->buffer_level >= cpi->oxcf.optimal_buffer_level) && cpi->buffered_mode)
3810 if (cpi->buffer_level < cpi->oxcf.maximum_buffer_size)
3812 buff_lvl_step = (cpi->oxcf.maximum_buffer_size - cpi->oxcf.optimal_buffer_level) / Adjustment;
3816 Adjustment = (cpi->buffer_level - cpi->oxcf.optimal_buffer_level) / buff_lvl_step;
3915 if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)
3918 if (cpi->buffer_level >= cpi->oxcf.maximum_buffer_size)
3921 else if (cpi->buffer_level > cpi->oxcf.optimal_buffer_level)
3923 int Fraction = ((cpi->buffer_level - cpi->oxcf.optimal_buffer_level) * 128) / (cpi->oxcf.maximum_buffer_size - cpi->oxcf.optimal_buffer_level);
3974 if (cpi->oxcf.noise_sensitivity > 0)
3979 switch (cpi->oxcf.noise_sensitivity)
4020 // cpi->oxcf.noise_sensitivity);
4125 if (cpi->pass != 2 && cpi->oxcf.auto_key && cm->frame_type != KEY_FRAME)
4178 if (((cpi->pass != 2) || (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)) &&
4367 if (!cpi->oxcf.error_resilient_mode && cm->refresh_golden_frame)
4415 if (cpi->oxcf.error_resilient_mode == 1)
4528 (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) &&
4529 (cpi->buffer_level < cpi->oxcf.drop_frames_water_mark * cpi->oxcf.optimal_buffer_level / 100) &&
4616 fprintf(f, "%10d %10d %10d %10d %10d %10d %10d %10d %6ld %6ld %6ld %6ld %5ld %5ld %5ld %8ld %8.2f %10d %10.3f %10.3f %8ld\n", cpi->common.current_video_frame, cpi->this_frame_target, cpi->projected_frame_size, (cpi->projected_frame_size - cpi->this_frame_target), (int)cpi->total_target_vs_actual, (cpi->oxcf.starting_buffer_level - cpi->bits_off_target), (int)cpi->total_actual_bits, cm->base_qindex, cpi->active_best_quality, cpi->active_worst_quality, cpi->avg_frame_qindex, cpi->zbin_over_quant, cm->refresh_golden_frame, cm->refresh_alt_ref_frame, cm->frame_type, cpi->gfu_boost, cpi->est_max_qcorrection_factor, (int)cpi->bits_left, cpi->total_coded_error_left, (double)cpi->bits_left / cpi->total_coded_error_left, cpi->tot_recode_hits);
4618 fprintf(f, "%10d %10d %10d %10d %10d %10d %10d %10d %6ld %6ld %6ld %6ld %5ld %5ld %5ld %8ld %8.2f %10d %10.3f %8ld\n", cpi->common.current_video_frame, cpi->this_frame_target, cpi->projected_frame_size, (cpi->projected_frame_size - cpi->this_frame_target), (int)cpi->total_target_vs_actual, (cpi->oxcf.starting_buffer_level - cpi->bits_off_target), (int)cpi->total_actual_bits, cm->base_qindex, cpi->active_best_quality, cpi->active_worst_quality, cpi->avg_frame_qindex, cpi->zbin_over_quant, cm->refresh_golden_frame, cm->refresh_alt_ref_frame, cm->frame_type, cpi->gfu_boost, cpi->est_max_qcorrection_factor, (int)cpi->bits_left, cpi->total_coded_error_left, cpi->tot_recode_hits);
4681 if (cpi->oxcf.error_resilient_mode)
4692 if (cpi->oxcf.play_alternate && cpi->common.refresh_alt_ref_frame)
4830 double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth
4831 *cpi->oxcf.two_pass_vbrmin_section / 100);
4832 cpi->bits_left += (long long)(two_pass_min_rate / cpi->oxcf.frame_rate);
4859 if (cpi->source_buffer_count != 0 && cpi->source_buffer_count >= cpi->oxcf.lag_in_frames)
4874 if (cpi->oxcf.allow_lag)
4880 which_buffer = cpi->oxcf.lag_in_frames - 1;
4882 if (cpi->source_buffer_count < cpi->oxcf.lag_in_frames - 1)
4941 if ((cpi->source_buffer_count == cpi->oxcf.lag_in_frames && cpi->oxcf.lag_in_frames > 0)
4942 || (!cpi->oxcf.allow_lag && cpi->source_buffer_count > 0)
4955 if (cpi->oxcf.error_resilient_mode == 0 &&
4956 cpi->oxcf.play_alternate &&
4959 cpi->oxcf.lag_in_frames != 0)
4961 cpi->last_alt_ref_sei = (cpi->source_encode_index + cpi->frames_till_gf_update_due) % cpi->oxcf.lag_in_frames;
4965 if (cpi->oxcf.arnr_max_frames > 0)
4971 int i, besti = -1, pastin = cpi->oxcf.arnr_strength;
4976 start_frame += cpi->oxcf.lag_in_frames;
4984 cpi->oxcf.arnr_strength = i;
4999 cpi->oxcf.arnr_strength = besti;
5040 if (cpi->oxcf.allow_lag)
5050 cpi->source_encode_index = (cpi->source_encode_index + 1) % cpi->oxcf.lag_in_frames;
5106 vp8_new_frame_rate(cpi, (7 * cpi->oxcf.frame_rate + this_fps) / 8);
5286 if (cpi->common.frame_type != 0 && cpi->common.base_qindex == cpi->oxcf.worst_allowed_q)