Lines Matching refs:cfg

75   vpx_codec_enc_cfg_t cfg;  member
130 const vpx_codec_enc_cfg_t *cfg, in validate_config() argument
133 RANGE_CHECK(cfg, g_w, 1, 16383); /* 14 bits available */ in validate_config()
134 RANGE_CHECK(cfg, g_h, 1, 16383); /* 14 bits available */ in validate_config()
135 RANGE_CHECK(cfg, g_timebase.den, 1, 1000000000); in validate_config()
136 RANGE_CHECK(cfg, g_timebase.num, 1, 1000000000); in validate_config()
137 RANGE_CHECK_HI(cfg, g_profile, 3); in validate_config()
138 RANGE_CHECK_HI(cfg, rc_max_quantizer, 63); in validate_config()
139 RANGE_CHECK_HI(cfg, rc_min_quantizer, cfg->rc_max_quantizer); in validate_config()
140 RANGE_CHECK_HI(cfg, g_threads, 64); in validate_config()
142 RANGE_CHECK_HI(cfg, g_lag_in_frames, 0); in validate_config()
144 if (ctx->base.enc.total_encoders > 1) RANGE_CHECK_HI(cfg, g_lag_in_frames, 0); in validate_config()
146 RANGE_CHECK_HI(cfg, g_lag_in_frames, 25); in validate_config()
148 RANGE_CHECK(cfg, rc_end_usage, VPX_VBR, VPX_Q); in validate_config()
149 RANGE_CHECK_HI(cfg, rc_undershoot_pct, 1000); in validate_config()
150 RANGE_CHECK_HI(cfg, rc_overshoot_pct, 1000); in validate_config()
151 RANGE_CHECK_HI(cfg, rc_2pass_vbr_bias_pct, 100); in validate_config()
152 RANGE_CHECK(cfg, kf_mode, VPX_KF_DISABLED, VPX_KF_AUTO); in validate_config()
158 RANGE_CHECK_HI(cfg, rc_resize_allowed, 0); in validate_config()
160 RANGE_CHECK_BOOL(cfg, rc_resize_allowed); in validate_config()
162 RANGE_CHECK_HI(cfg, rc_dropframe_thresh, 100); in validate_config()
163 RANGE_CHECK_HI(cfg, rc_resize_up_thresh, 100); in validate_config()
164 RANGE_CHECK_HI(cfg, rc_resize_down_thresh, 100); in validate_config()
167 RANGE_CHECK(cfg, g_pass, VPX_RC_ONE_PASS, VPX_RC_ONE_PASS); in validate_config()
170 RANGE_CHECK(cfg, g_pass, VPX_RC_ONE_PASS, VPX_RC_ONE_PASS); in validate_config()
172 RANGE_CHECK(cfg, g_pass, VPX_RC_ONE_PASS, VPX_RC_LAST_PASS); in validate_config()
178 if (cfg->kf_mode != VPX_KF_DISABLED && cfg->kf_min_dist != cfg->kf_max_dist && in validate_config()
179 cfg->kf_min_dist > 0) in validate_config()
201 if (finalize && (cfg->rc_end_usage == VPX_CQ || cfg->rc_end_usage == VPX_Q)) in validate_config()
202 RANGE_CHECK(vp8_cfg, cq_level, cfg->rc_min_quantizer, in validate_config()
203 cfg->rc_max_quantizer); in validate_config()
206 if (cfg->g_pass == VPX_RC_LAST_PASS) { in validate_config()
208 int n_packets = (int)(cfg->rc_twopass_stats_in.sz / packet_sz); in validate_config()
211 if (!cfg->rc_twopass_stats_in.buf) in validate_config()
214 if (cfg->rc_twopass_stats_in.sz % packet_sz) in validate_config()
217 if (cfg->rc_twopass_stats_in.sz < 2 * packet_sz) in validate_config()
220 stats = (void *)((char *)cfg->rc_twopass_stats_in.buf + in validate_config()
228 RANGE_CHECK(cfg, ts_number_layers, 1, 5); in validate_config()
230 if (cfg->ts_number_layers > 1) { in validate_config()
232 RANGE_CHECK_HI(cfg, ts_periodicity, 16); in validate_config()
234 for (i = 1; i < cfg->ts_number_layers; ++i) { in validate_config()
235 if (cfg->ts_target_bitrate[i] <= cfg->ts_target_bitrate[i - 1] && in validate_config()
236 cfg->rc_target_bitrate > 0) in validate_config()
240 RANGE_CHECK(cfg, ts_rate_decimator[cfg->ts_number_layers - 1], 1, 1); in validate_config()
241 for (i = cfg->ts_number_layers - 2; i > 0; i--) { in validate_config()
242 if (cfg->ts_rate_decimator[i - 1] != 2 * cfg->ts_rate_decimator[i]) in validate_config()
246 RANGE_CHECK_HI(cfg, ts_layer_id[i], cfg->ts_number_layers - 1); in validate_config()
250 if (cfg->g_threads > (1 << vp8_cfg->token_partitions)) in validate_config()
268 if ((img->d_w != ctx->cfg.g_w) || (img->d_h != ctx->cfg.g_h)) in validate_img()
275 vpx_codec_enc_cfg_t cfg, in set_vp8e_config() argument
278 oxcf->multi_threaded = cfg.g_threads; in set_vp8e_config()
279 oxcf->Version = cfg.g_profile; in set_vp8e_config()
281 oxcf->Width = cfg.g_w; in set_vp8e_config()
282 oxcf->Height = cfg.g_h; in set_vp8e_config()
283 oxcf->timebase = cfg.g_timebase; in set_vp8e_config()
285 oxcf->error_resilient_mode = cfg.g_error_resilient; in set_vp8e_config()
287 switch (cfg.g_pass) { in set_vp8e_config()
293 if (cfg.g_pass == VPX_RC_FIRST_PASS || cfg.g_pass == VPX_RC_ONE_PASS) { in set_vp8e_config()
297 oxcf->allow_lag = (cfg.g_lag_in_frames) > 0; in set_vp8e_config()
298 oxcf->lag_in_frames = cfg.g_lag_in_frames; in set_vp8e_config()
301 oxcf->allow_df = (cfg.rc_dropframe_thresh > 0); in set_vp8e_config()
302 oxcf->drop_frames_water_mark = cfg.rc_dropframe_thresh; in set_vp8e_config()
304 oxcf->allow_spatial_resampling = cfg.rc_resize_allowed; in set_vp8e_config()
305 oxcf->resample_up_water_mark = cfg.rc_resize_up_thresh; in set_vp8e_config()
306 oxcf->resample_down_water_mark = cfg.rc_resize_down_thresh; in set_vp8e_config()
308 if (cfg.rc_end_usage == VPX_VBR) { in set_vp8e_config()
310 } else if (cfg.rc_end_usage == VPX_CBR) { in set_vp8e_config()
312 } else if (cfg.rc_end_usage == VPX_CQ) { in set_vp8e_config()
314 } else if (cfg.rc_end_usage == VPX_Q) { in set_vp8e_config()
318 oxcf->target_bandwidth = cfg.rc_target_bitrate; in set_vp8e_config()
322 oxcf->best_allowed_q = cfg.rc_min_quantizer; in set_vp8e_config()
323 oxcf->worst_allowed_q = cfg.rc_max_quantizer; in set_vp8e_config()
327 oxcf->under_shoot_pct = cfg.rc_undershoot_pct; in set_vp8e_config()
328 oxcf->over_shoot_pct = cfg.rc_overshoot_pct; in set_vp8e_config()
330 oxcf->maximum_buffer_size_in_ms = cfg.rc_buf_sz; in set_vp8e_config()
331 oxcf->starting_buffer_level_in_ms = cfg.rc_buf_initial_sz; in set_vp8e_config()
332 oxcf->optimal_buffer_level_in_ms = cfg.rc_buf_optimal_sz; in set_vp8e_config()
334 oxcf->maximum_buffer_size = cfg.rc_buf_sz; in set_vp8e_config()
335 oxcf->starting_buffer_level = cfg.rc_buf_initial_sz; in set_vp8e_config()
336 oxcf->optimal_buffer_level = cfg.rc_buf_optimal_sz; in set_vp8e_config()
338 oxcf->two_pass_vbrbias = cfg.rc_2pass_vbr_bias_pct; in set_vp8e_config()
339 oxcf->two_pass_vbrmin_section = cfg.rc_2pass_vbr_minsection_pct; in set_vp8e_config()
340 oxcf->two_pass_vbrmax_section = cfg.rc_2pass_vbr_maxsection_pct; in set_vp8e_config()
343 cfg.kf_mode == VPX_KF_AUTO && cfg.kf_min_dist != cfg.kf_max_dist; in set_vp8e_config()
344 oxcf->key_freq = cfg.kf_max_dist; in set_vp8e_config()
346 oxcf->number_of_layers = cfg.ts_number_layers; in set_vp8e_config()
347 oxcf->periodicity = cfg.ts_periodicity; in set_vp8e_config()
350 memcpy(oxcf->target_bitrate, cfg.ts_target_bitrate, in set_vp8e_config()
351 sizeof(cfg.ts_target_bitrate)); in set_vp8e_config()
352 memcpy(oxcf->rate_decimator, cfg.ts_rate_decimator, in set_vp8e_config()
353 sizeof(cfg.ts_rate_decimator)); in set_vp8e_config()
354 memcpy(oxcf->layer_id, cfg.ts_layer_id, sizeof(cfg.ts_layer_id)); in set_vp8e_config()
380 oxcf->two_pass_stats_in = cfg.rc_twopass_stats_in; in set_vp8e_config()
428 const vpx_codec_enc_cfg_t *cfg) { in vp8e_set_config() argument
431 if (cfg->g_w != ctx->cfg.g_w || cfg->g_h != ctx->cfg.g_h) { in vp8e_set_config()
432 if (cfg->g_lag_in_frames > 1 || cfg->g_pass != VPX_RC_ONE_PASS) in vp8e_set_config()
434 if ((ctx->cpi->initial_width && (int)cfg->g_w > ctx->cpi->initial_width) || in vp8e_set_config()
435 (ctx->cpi->initial_height && (int)cfg->g_h > ctx->cpi->initial_height)) in vp8e_set_config()
444 if ((cfg->g_lag_in_frames > ctx->cfg.g_lag_in_frames)) in vp8e_set_config()
447 res = validate_config(ctx, cfg, &ctx->vp8_cfg, 0); in vp8e_set_config()
450 ctx->cfg = *cfg; in vp8e_set_config()
451 set_vp8e_config(&ctx->oxcf, ctx->cfg, ctx->vp8_cfg, NULL); in vp8e_set_config()
475 const vpx_codec_err_t res = validate_config(ctx, &ctx->cfg, extra_cfg, 0); in update_extracfg()
478 set_vp8e_config(&ctx->oxcf, ctx->cfg, ctx->vp8_cfg, NULL); in update_extracfg()
578 static vpx_codec_err_t vp8e_mr_alloc_mem(const vpx_codec_enc_cfg_t *cfg, in vp8e_mr_alloc_mem() argument
584 int mb_rows = ((cfg->g_w + 15) >> 4); in vp8e_mr_alloc_mem()
585 int mb_cols = ((cfg->g_h + 15) >> 4); in vp8e_mr_alloc_mem()
601 (void)cfg; in vp8e_mr_alloc_mem()
630 priv->cfg = *ctx->config.enc; in vp8e_init()
631 ctx->config.enc = &priv->cfg; in vp8e_init()
637 priv->cx_data_sz = priv->cfg.g_w * priv->cfg.g_h * 3 / 2 * 2; in vp8e_init()
655 res = validate_config(priv, &priv->cfg, &priv->vp8_cfg, 0); in vp8e_init()
658 set_vp8e_config(&priv->oxcf, priv->cfg, priv->vp8_cfg, mr_cfg); in vp8e_init()
726 (uint64_t)ctx->cfg.g_timebase.num / in pick_quickcompress_mode()
727 (uint64_t)ctx->cfg.g_timebase.den; in pick_quickcompress_mode()
742 } else if (ctx->cfg.g_pass == VPX_RC_FIRST_PASS) { in pick_quickcompress_mode()
744 } else if (ctx->cfg.g_pass == VPX_RC_LAST_PASS) { in pick_quickcompress_mode()
805 if (!ctx->cfg.rc_target_bitrate) return res; in vp8e_encode()
809 if (!res) res = validate_config(ctx, &ctx->cfg, &ctx->vp8_cfg, 1); in vp8e_encode()
824 if (ctx->cfg.kf_mode == VPX_KF_AUTO && in vp8e_encode()
825 ctx->cfg.kf_min_dist == ctx->cfg.kf_max_dist) { in vp8e_encode()
826 if (++ctx->fixed_kf_cntr > ctx->cfg.kf_min_dist) { in vp8e_encode()
856 pts * 10000000 * ctx->cfg.g_timebase.num / ctx->cfg.g_timebase.den; in vp8e_encode()
857 dst_end_time_stamp = (pts + duration) * 10000000 * ctx->cfg.g_timebase.num / in vp8e_encode()
858 ctx->cfg.g_timebase.den; in vp8e_encode()
895 round = (vpx_codec_pts_t)10000000 * ctx->cfg.g_timebase.num / 2 - 1; in vp8e_encode()
899 (dst_time_stamp * ctx->cfg.g_timebase.den + round) / in vp8e_encode()
900 ctx->cfg.g_timebase.num / 10000000; in vp8e_encode()
902 (unsigned long)((delta * ctx->cfg.g_timebase.den + round) / in vp8e_encode()
903 ctx->cfg.g_timebase.num / 10000000); in vp8e_encode()
919 ((cpi->last_time_stamp_seen * ctx->cfg.g_timebase.den + round) / in vp8e_encode()
920 ctx->cfg.g_timebase.num / 10000000) + in vp8e_encode()
1084 if (layer_id < 0 || layer_id >= (int)ctx->cfg.ts_number_layers) { in vp8e_set_temporal_layer_id()