Lines Matching refs:cfg

48   struct vp9_extracfg cfg;  member
81 vpx_codec_enc_cfg_t cfg; member
148 const vpx_codec_enc_cfg_t *cfg, in validate_config() argument
150 RANGE_CHECK(cfg, g_w, 1, 65535); // 16 bits available in validate_config()
151 RANGE_CHECK(cfg, g_h, 1, 65535); // 16 bits available in validate_config()
152 RANGE_CHECK(cfg, g_timebase.den, 1, 1000000000); in validate_config()
153 RANGE_CHECK(cfg, g_timebase.num, 1, cfg->g_timebase.den); in validate_config()
154 RANGE_CHECK_HI(cfg, g_profile, 3); in validate_config()
156 RANGE_CHECK_HI(cfg, rc_max_quantizer, 63); in validate_config()
157 RANGE_CHECK_HI(cfg, rc_min_quantizer, cfg->rc_max_quantizer); in validate_config()
161 RANGE_CHECK_HI(cfg, g_threads, 64); in validate_config()
162 RANGE_CHECK_HI(cfg, g_lag_in_frames, MAX_LAG_BUFFERS); in validate_config()
163 RANGE_CHECK(cfg, rc_end_usage, VPX_VBR, VPX_Q); in validate_config()
164 RANGE_CHECK_HI(cfg, rc_undershoot_pct, 1000); in validate_config()
165 RANGE_CHECK_HI(cfg, rc_overshoot_pct, 1000); in validate_config()
166 RANGE_CHECK_HI(cfg, rc_2pass_vbr_bias_pct, 100); in validate_config()
167 RANGE_CHECK(cfg, kf_mode, VPX_KF_DISABLED, VPX_KF_AUTO); in validate_config()
168 RANGE_CHECK_BOOL(cfg, rc_resize_allowed); in validate_config()
169 RANGE_CHECK_HI(cfg, rc_dropframe_thresh, 100); in validate_config()
170 RANGE_CHECK_HI(cfg, rc_resize_up_thresh, 100); in validate_config()
171 RANGE_CHECK_HI(cfg, rc_resize_down_thresh, 100); in validate_config()
172 RANGE_CHECK(cfg, g_pass, VPX_RC_ONE_PASS, VPX_RC_LAST_PASS); in validate_config()
174 if (cfg->rc_resize_allowed == 1) { in validate_config()
175 RANGE_CHECK(cfg, rc_scaled_width, 1, cfg->g_w); in validate_config()
176 RANGE_CHECK(cfg, rc_scaled_height, 1, cfg->g_h); in validate_config()
179 RANGE_CHECK(cfg, ss_number_layers, 1, VPX_SS_MAX_LAYERS); in validate_config()
182 if (cfg->ss_number_layers > 1) { in validate_config()
184 for (i = 0; i < cfg->ss_number_layers; ++i) { in validate_config()
185 if (cfg->ss_enable_auto_alt_ref[i]) in validate_config()
188 if (alt_ref_sum > REF_FRAMES - cfg->ss_number_layers) in validate_config()
193 RANGE_CHECK(cfg, ts_number_layers, 1, VPX_TS_MAX_LAYERS); in validate_config()
194 if (cfg->ts_number_layers > 1) { in validate_config()
196 for (i = 1; i < cfg->ts_number_layers; ++i) in validate_config()
197 if (cfg->ts_target_bitrate[i] < cfg->ts_target_bitrate[i - 1]) in validate_config()
200 RANGE_CHECK(cfg, ts_rate_decimator[cfg->ts_number_layers - 1], 1, 1); in validate_config()
201 for (i = cfg->ts_number_layers - 2; i > 0; --i) in validate_config()
202 if (cfg->ts_rate_decimator[i - 1] != 2 * cfg->ts_rate_decimator[i]) in validate_config()
208 if (cfg->kf_mode != VPX_KF_DISABLED && in validate_config()
209 cfg->kf_min_dist != cfg->kf_max_dist && in validate_config()
210 cfg->kf_min_dist > 0) in validate_config()
231 if (cfg->g_pass == VPX_RC_LAST_PASS) { in validate_config()
233 const int n_packets = (int)(cfg->rc_twopass_stats_in.sz / packet_sz); in validate_config()
236 if (cfg->rc_twopass_stats_in.buf == NULL) in validate_config()
239 if (cfg->rc_twopass_stats_in.sz % packet_sz) in validate_config()
242 if (cfg->ss_number_layers > 1) { in validate_config()
246 stats = cfg->rc_twopass_stats_in.buf; in validate_config()
249 if (layer_id >= 0 && layer_id < (int)cfg->ss_number_layers) { in validate_config()
254 for (i = 0; i < (int)cfg->ss_number_layers; ++i) { in validate_config()
261 stats = (const FIRSTPASS_STATS *)cfg->rc_twopass_stats_in.buf + in validate_config()
262 n_packets - cfg->ss_number_layers + i; in validate_config()
265 if (layer_id >= cfg->ss_number_layers in validate_config()
271 if (cfg->rc_twopass_stats_in.sz < 2 * packet_sz) in validate_config()
275 (const FIRSTPASS_STATS *)cfg->rc_twopass_stats_in.buf + n_packets - 1; in validate_config()
282 if (cfg->g_profile <= (unsigned int)PROFILE_1 && in validate_config()
285 if (cfg->g_profile > (unsigned int)PROFILE_1 && in validate_config()
307 if (img->d_w != ctx->cfg.g_w || img->d_h != ctx->cfg.g_h) in validate_img()
326 const vpx_codec_enc_cfg_t *cfg, in set_encoder_config() argument
328 oxcf->profile = cfg->g_profile; in set_encoder_config()
329 oxcf->width = cfg->g_w; in set_encoder_config()
330 oxcf->height = cfg->g_h; in set_encoder_config()
333 oxcf->framerate = (double)cfg->g_timebase.den / cfg->g_timebase.num; in set_encoder_config()
337 switch (cfg->g_pass) { in set_encoder_config()
352 oxcf->lag_in_frames = cfg->g_pass == VPX_RC_FIRST_PASS ? 0 in set_encoder_config()
353 : cfg->g_lag_in_frames; in set_encoder_config()
354 oxcf->rc_mode = cfg->rc_end_usage; in set_encoder_config()
357 oxcf->target_bandwidth = 1000 * cfg->rc_target_bitrate; in set_encoder_config()
361 extra_cfg->lossless ? 0 : vp9_quantizer_to_qindex(cfg->rc_min_quantizer); in set_encoder_config()
363 extra_cfg->lossless ? 0 : vp9_quantizer_to_qindex(cfg->rc_max_quantizer); in set_encoder_config()
367 oxcf->under_shoot_pct = cfg->rc_undershoot_pct; in set_encoder_config()
368 oxcf->over_shoot_pct = cfg->rc_overshoot_pct; in set_encoder_config()
370 oxcf->allow_spatial_resampling = cfg->rc_resize_allowed; in set_encoder_config()
371 oxcf->scaled_frame_width = cfg->rc_scaled_width; in set_encoder_config()
372 oxcf->scaled_frame_height = cfg->rc_scaled_height; in set_encoder_config()
374 oxcf->maximum_buffer_size_ms = cfg->rc_buf_sz; in set_encoder_config()
375 oxcf->starting_buffer_level_ms = cfg->rc_buf_initial_sz; in set_encoder_config()
376 oxcf->optimal_buffer_level_ms = cfg->rc_buf_optimal_sz; in set_encoder_config()
378 oxcf->drop_frames_water_mark = cfg->rc_dropframe_thresh; in set_encoder_config()
380 oxcf->two_pass_vbrbias = cfg->rc_2pass_vbr_bias_pct; in set_encoder_config()
381 oxcf->two_pass_vbrmin_section = cfg->rc_2pass_vbr_minsection_pct; in set_encoder_config()
382 oxcf->two_pass_vbrmax_section = cfg->rc_2pass_vbr_maxsection_pct; in set_encoder_config()
384 oxcf->auto_key = cfg->kf_mode == VPX_KF_AUTO && in set_encoder_config()
385 cfg->kf_min_dist != cfg->kf_max_dist; in set_encoder_config()
387 oxcf->key_freq = cfg->kf_max_dist; in set_encoder_config()
395 oxcf->two_pass_stats_in = cfg->rc_twopass_stats_in; in set_encoder_config()
399 oxcf->firstpass_mb_stats_in = cfg->rc_firstpass_mb_stats_in; in set_encoder_config()
412 oxcf->error_resilient_mode = cfg->g_error_resilient; in set_encoder_config()
419 oxcf->ss_number_layers = cfg->ss_number_layers; in set_encoder_config()
424 oxcf->ss_target_bitrate[i] = 1000 * cfg->ss_target_bitrate[i]; in set_encoder_config()
426 oxcf->ss_play_alternate[i] = cfg->ss_enable_auto_alt_ref[i]; in set_encoder_config()
433 oxcf->ts_number_layers = cfg->ts_number_layers; in set_encoder_config()
438 oxcf->ts_target_bitrate[i] = 1000 * cfg->ts_target_bitrate[i]; in set_encoder_config()
439 oxcf->ts_rate_decimator[i] = cfg->ts_rate_decimator[i]; in set_encoder_config()
482 const vpx_codec_enc_cfg_t *cfg) { in encoder_set_config() argument
485 if (cfg->g_w != ctx->cfg.g_w || cfg->g_h != ctx->cfg.g_h) in encoder_set_config()
492 if (cfg->g_lag_in_frames > ctx->cfg.g_lag_in_frames) in encoder_set_config()
495 res = validate_config(ctx, cfg, &ctx->extra_cfg); in encoder_set_config()
498 ctx->cfg = *cfg; in encoder_set_config()
499 set_encoder_config(&ctx->oxcf, &ctx->cfg, &ctx->extra_cfg); in encoder_set_config()
526 const vpx_codec_err_t res = validate_config(ctx, &ctx->cfg, extra_cfg); in update_extra_cfg()
529 set_encoder_config(&ctx->oxcf, &ctx->cfg, &ctx->extra_cfg); in update_extra_cfg()
663 vpx_codec_enc_cfg_t *cfg; in encoder_init() local
678 ctx->priv->alg_priv->cfg = *ctx->config.enc; in encoder_init()
679 ctx->config.enc = &ctx->priv->alg_priv->cfg; in encoder_init()
682 cfg = &ctx->priv->alg_priv->cfg; in encoder_init()
688 extracfg_map[i].usage && extracfg_map[i].usage != cfg->g_usage; in encoder_init()
691 priv->extra_cfg = extracfg_map[i].cfg; in encoder_init()
696 res = validate_config(priv, &priv->cfg, &priv->extra_cfg); in encoder_init()
701 &ctx->priv->alg_priv->cfg, in encoder_init()
730 (uint64_t)ctx->cfg.g_timebase.num / in pick_quickcompress_mode()
731 (uint64_t)ctx->cfg.g_timebase.den; in pick_quickcompress_mode()
738 if (ctx->cfg.g_pass == VPX_RC_FIRST_PASS) in pick_quickcompress_mode()
740 else if (ctx->cfg.g_pass == VPX_RC_LAST_PASS) in pick_quickcompress_mode()
831 const vpx_rational_t *const timebase = &ctx->cfg.g_timebase; in encoder_encode()
840 ctx->cx_data_sz = ctx->cfg.g_w * ctx->cfg.g_h * in encoder_encode()
865 if (ctx->cfg.kf_mode == VPX_KF_AUTO && in encoder_encode()
866 ctx->cfg.kf_min_dist == ctx->cfg.kf_max_dist) { in encoder_encode()
867 if (++ctx->fixed_kf_cntr > ctx->cfg.kf_min_dist) { in encoder_encode()
1171 const vpx_codec_enc_cfg_t *cfg = &ctx->cfg; in ctrl_set_svc() local
1177 (cfg->rc_end_usage == VPX_CBR || in ctrl_set_svc()
1178 cfg->g_pass == VPX_RC_FIRST_PASS || in ctrl_set_svc()
1179 cfg->g_pass == VPX_RC_LAST_PASS) && in ctrl_set_svc()
1180 cfg->ss_number_layers > 1 && in ctrl_set_svc()
1181 cfg->ts_number_layers > 1) { in ctrl_set_svc()
1197 svc->temporal_layer_id >= (int)ctx->cfg.ts_number_layers) { in ctrl_set_svc_layer_id()
1201 svc->spatial_layer_id >= (int)ctx->cfg.ss_number_layers) { in ctrl_set_svc_layer_id()