Home | History | Annotate | Download | only in encoder

Lines Matching refs:oxcf

430   cpi->rd_thresh_mult[i] = is_slowest_mode(cpi->oxcf.mode) ? -500 : 0;
511 cpi->rd_thresh_mult_sub8x8[i] = is_slowest_mode(cpi->oxcf.mode) ? -500 : 0;
554 if (cpi->oxcf.lossless || cpi->mb.e_mbd.lossless) {
561 const VP9_CONFIG *oxcf = &cpi->oxcf;
563 cpi->lookahead = vp9_lookahead_init(oxcf->width, oxcf->height,
565 oxcf->lag_in_frames);
571 oxcf->width, oxcf->height,
693 VP9_CONFIG *const oxcf = &cpi->oxcf;
696 oxcf->framerate = framerate < 0.1 ? 30 : framerate;
697 cpi->output_framerate = cpi->oxcf.framerate;
698 rc->av_per_frame_bandwidth = (int)(oxcf->target_bandwidth /
701 oxcf->two_pass_vbrmin_section / 100);
714 oxcf->two_pass_vbrmax_section) / 100);
725 if (oxcf->play_alternate && oxcf->lag_in_frames) {
726 if (rc->max_gf_interval > oxcf->lag_in_frames - 1)
727 rc->max_gf_interval = oxcf->lag_in_frames - 1;
729 if (rc->static_scene_max_gf_interval > oxcf->lag_in_frames - 1)
730 rc->static_scene_max_gf_interval = oxcf->lag_in_frames - 1;
751 cm->log2_tile_cols = clamp(cpi->oxcf.tile_columns,
753 cm->log2_tile_rows = cpi->oxcf.tile_rows;
756 static void init_rate_control(const VP9_CONFIG *oxcf, int pass,
758 if (pass == 0 && oxcf->end_usage == USAGE_STREAM_FROM_SERVER) {
759 rc->avg_frame_qindex[0] = oxcf->worst_allowed_q;
760 rc->avg_frame_qindex[1] = oxcf->worst_allowed_q;
761 rc->avg_frame_qindex[2] = oxcf->worst_allowed_q;
763 rc->avg_frame_qindex[0] = (oxcf->worst_allowed_q +
764 oxcf->best_allowed_q) / 2;
765 rc->avg_frame_qindex[1] = (oxcf->worst_allowed_q +
766 oxcf->best_allowed_q) / 2;
767 rc->avg_frame_qindex[2] = (oxcf->worst_allowed_q +
768 oxcf->best_allowed_q) / 2;
771 rc->last_q[0] = oxcf->best_allowed_q;
772 rc->last_q[1] = oxcf->best_allowed_q;
773 rc->last_q[2] = oxcf->best_allowed_q;
775 rc->buffer_level = oxcf->starting_buffer_level;
776 rc->bits_off_target = oxcf->starting_buffer_level;
787 static void init_config(struct VP9_COMP *cpi, VP9_CONFIG *oxcf) {
791 cpi->oxcf = *oxcf;
793 cm->version = oxcf->version;
795 cm->width = oxcf->width;
796 cm->height = oxcf->height;
802 cpi->svc.number_spatial_layers = oxcf->ss_number_layers;
804 cpi->svc.number_temporal_layers = oxcf->ts_number_layers;
807 cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) ||
809 cpi->oxcf.mode == MODE_SECONDPASS_BEST)) {
814 vp9_change_config(cpi, oxcf);
829 void vp9_change_config(struct VP9_COMP *cpi, const VP9_CONFIG *oxcf) {
833 if (cm->version != oxcf->version)
834 cm->version = oxcf->version;
836 cpi->oxcf = *oxcf;
838 if (cpi->oxcf.cpu_used == -6)
839 cpi->oxcf.play_alternate = 0;
841 switch (cpi->oxcf.mode) {
845 cpi->oxcf.cpu_used = clamp(cpi->oxcf.cpu_used, -5, 5);
858 cpi->oxcf.cpu_used = clamp(cpi->oxcf.cpu_used, -5, 5);
870 cpi->oxcf.worst_allowed_q = q_trans[oxcf->worst_allowed_q];
871 cpi->oxcf.best_allowed_q = q_trans[oxcf->best_allowed_q];
872 cpi->oxcf.cq_level = q_trans[cpi->oxcf.cq_level];
874 cpi->oxcf.lossless = oxcf->lossless;
875 if (cpi->oxcf.lossless) {
878 cpi->oxcf.worst_allowed_q = 0;
879 cpi->oxcf.best_allowed_q = 0;
899 cpi->segment_encode_breakout[i] = cpi->oxcf.encode_breakout;
901 cpi->encode_breakout = cpi->oxcf.encode_breakout;
904 if (cpi->oxcf.end_usage == USAGE_LOCAL_FILE_PLAYBACK) {
905 cpi->oxcf.starting_buffer_level = 60000;
906 cpi->oxcf.optimal_buffer_level = 60000;
907 cpi->oxcf.maximum_buffer_size = 240000;
911 cpi->oxcf.target_bandwidth *= 1000;
913 cpi->oxcf.starting_buffer_level =
914 vp9_rescale(cpi->oxcf.starting_buffer_level,
915 cpi->oxcf.target_bandwidth, 1000);
918 if (cpi->oxcf.optimal_buffer_level == 0)
919 cpi->oxcf.optimal_buffer_level = cpi->oxcf.target_bandwidth / 8;
921 cpi->oxcf.optimal_buffer_level =
922 vp9_rescale(cpi->oxcf.optimal_buffer_level,
923 cpi->oxcf.target_bandwidth, 1000);
925 if (cpi->oxcf.maximum_buffer_size == 0)
926 cpi->oxcf.maximum_buffer_size = cpi->oxcf.target_bandwidth / 8;
928 cpi->oxcf.maximum_buffer_size =
929 vp9_rescale(cpi->oxcf.maximum_buffer_size,
930 cpi->oxcf.target_bandwidth, 1000);
933 rc->bits_off_target = MIN(rc->bits_off_target, cpi->oxcf.maximum_buffer_size);
934 rc->buffer_level = MIN(rc->buffer_level, cpi->oxcf.maximum_buffer_size);
937 vp9_new_framerate(cpi, cpi->oxcf.framerate);
940 rc->worst_quality = cpi->oxcf.worst_allowed_q;
941 rc->best_quality = cpi->oxcf.best_allowed_q;
945 cpi->cq_target_quality = cpi->oxcf.cq_level;
949 cm->display_width = cpi->oxcf.width;
950 cm->display_height = cpi->oxcf.height;
953 cpi->oxcf.sharpness = MIN(7, cpi->oxcf.sharpness);
955 cpi->common.lf.sharpness_level = cpi->oxcf.sharpness;
967 cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) ||
970 (int)cpi->oxcf.target_bandwidth);
973 cpi->speed = abs(cpi->oxcf.cpu_used);
976 if (cpi->oxcf.lag_in_frames > MAX_LAG_BUFFERS)
977 cpi->oxcf.lag_in_frames = MAX_LAG_BUFFERS;
1157 VP9_COMP *vp9_create_compressor(VP9_CONFIG *oxcf) {
1183 init_config(cpi, oxcf);
1184 init_rate_control(&cpi->oxcf, cpi->pass, &cpi->rc);
1228 cpi->key_frame_frequency = cpi->oxcf.key_freq;
1293 rc->ni_av_qi = cpi->oxcf.worst_allowed_q;
1297 rc->avg_q = vp9_convert_qindex_to_q(cpi->oxcf.worst_allowed_q);
1328 cpi->output_pkt_list = oxcf->output_pkt_list;
1336 const int packets = (int)(oxcf->two_pass_stats_in.sz / packet_sz);
1340 FIRSTPASS_STATS *const stats = oxcf->two_pass_stats_in.buf;
1344 for (i = 0; i < oxcf->ss_number_layers; ++i) {
1346 &stats[packets - oxcf->ss_number_layers + i];
1349 if (layer_id >= 0 && layer_id < oxcf->ss_number_layers) {
1367 if (layer_id >= 0 && layer_id < oxcf->ss_number_layers
1376 cpi->twopass.stats_in_start = oxcf->two_pass_stats_in.buf;
2029 } else if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) {
2201 (cpi->oxcf.starting_buffer_level - cpi->rc.bits_off_target),
2260 if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
2262 } else if (cpi->oxcf.aq_mode == COMPLEXITY_AQ) {
2264 } else if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) {
2320 if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
2322 } else if (cpi->oxcf.aq_mode == COMPLEXITY_AQ) {
2351 if (cpi->oxcf.end_usage == USAGE_CONSTANT_QUALITY) {
2449 if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY &&
2625 cm->error_resilient_mode = (cpi->oxcf.error_resilient_mode != 0);
2627 (cpi->oxcf.frame_parallel_decoding_mode != 0);
2652 cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER &&
2666 if (cpi->oxcf.noise_sensitivity > 0) {
2668 switch (cpi->oxcf.noise_sensitivity) {
2859 if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
2976 double avg_duration = 10000000.0 / cpi->oxcf.framerate;
3019 if (cpi->oxcf.play_alternate && rc->source_alt_ref_pending) {
3042 if (cpi->oxcf.arnr_max_frames > 0) {
3150 cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
3202 if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
3233 cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) ||
3427 cm->width = (hs - 1 + cpi->oxcf.width * hr) / hs;
3428 cm->height = (vs - 1 + cpi->oxcf.height * vr) / vs;