}
// This function returns the maximum target rate per frame.
-static int frame_max_bits(const RATE_CONTROL *rc, const VP9_CONFIG *oxcf) {
+static int frame_max_bits(const RATE_CONTROL *rc,
+ const VP9EncoderConfig *oxcf) {
int64_t max_bits = ((int64_t)rc->avg_frame_bandwidth *
(int64_t)oxcf->two_pass_vbrmax_section) / 100;
if (max_bits < 0)
const FIRSTPASS_STATS *stats,
int section_target_bandwidth) {
const RATE_CONTROL *const rc = &cpi->rc;
- const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *const oxcf = &cpi->oxcf;
if (section_target_bandwidth <= 0) {
return rc->worst_quality; // Highest value allowed
void vp9_init_second_pass(VP9_COMP *cpi) {
SVC *const svc = &cpi->svc;
- const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const int is_spatial_svc = (svc->number_spatial_layers > 1) &&
(svc->number_temporal_layers == 1);
struct twopass_rc *const twopass = is_spatial_svc ?
// Analyse and define a gf/arf group.
static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
RATE_CONTROL *const rc = &cpi->rc;
- VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *const oxcf = &cpi->oxcf;
struct twopass_rc *const twopass = &cpi->twopass;
FIRSTPASS_STATS next_frame = { 0 };
const FIRSTPASS_STATS *start_pos;
static void alloc_raw_frame_buffers(VP9_COMP *cpi) {
VP9_COMMON *cm = &cpi->common;
- const VP9_CONFIG *oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *oxcf = &cpi->oxcf;
cpi->lookahead = vp9_lookahead_init(oxcf->width, oxcf->height,
cm->subsampling_x, cm->subsampling_y,
cm->log2_tile_rows = cpi->oxcf.tile_rows;
}
-static void init_config(struct VP9_COMP *cpi, VP9_CONFIG *oxcf) {
+static void init_config(struct VP9_COMP *cpi, VP9EncoderConfig *oxcf) {
VP9_COMMON *const cm = &cpi->common;
int i;
return -1;
}
-void vp9_change_config(struct VP9_COMP *cpi, const VP9_CONFIG *oxcf) {
+void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
VP9_COMMON *const cm = &cpi->common;
RATE_CONTROL *const rc = &cpi->rc;
}
-VP9_COMP *vp9_create_compressor(VP9_CONFIG *oxcf) {
+VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf) {
int i, j;
VP9_COMP *const cpi = vpx_memalign(32, sizeof(VP9_COMP));
VP9_COMMON *const cm = cpi != NULL ? &cpi->common : NULL;
int q, int maxq, int minq) {
const VP9_COMMON *const cm = &cpi->common;
const RATE_CONTROL *const rc = &cpi->rc;
- const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *const oxcf = &cpi->oxcf;
int force_recode = 0;
// Special case trap if maximum allowed frame size exceeded.
} AQ_MODE;
-typedef struct VP9_CONFIG {
+typedef struct VP9EncoderConfig {
BITSTREAM_PROFILE profile;
BIT_DEPTH bit_depth;
int width; // width of data passed to the compressor
struct vpx_codec_pkt_list *output_pkt_list;
vp8e_tuning tuning;
-} VP9_CONFIG;
+} VP9EncoderConfig;
static INLINE int is_best_mode(MODE mode) {
return mode == ONE_PASS_BEST || mode == TWO_PASS_SECOND_BEST;
QUANTS quants;
MACROBLOCK mb;
VP9_COMMON common;
- VP9_CONFIG oxcf;
+ VP9EncoderConfig oxcf;
struct lookahead_ctx *lookahead;
struct lookahead_entry *source;
#if CONFIG_MULTIPLE_ARF
void vp9_initialize_enc();
-struct VP9_COMP *vp9_create_compressor(VP9_CONFIG *oxcf);
+struct VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf);
void vp9_remove_compressor(VP9_COMP *cpi);
-void vp9_change_config(VP9_COMP *cpi, const VP9_CONFIG *oxcf);
+void vp9_change_config(VP9_COMP *cpi, const VP9EncoderConfig *oxcf);
// receive a frames worth of data. caller can assume that a copy of this
// frame is made and not just a copy of the pointer..
int vp9_rc_clamp_iframe_target_size(const VP9_COMP *const cpi, int target) {
const RATE_CONTROL *rc = &cpi->rc;
- const VP9_CONFIG *oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *oxcf = &cpi->oxcf;
if (oxcf->rc_max_intra_bitrate_pct) {
const int max_rate = rc->avg_frame_bandwidth *
oxcf->rc_max_intra_bitrate_pct / 100;
// Update the buffer level: leaky bucket model.
static void update_buffer_level(VP9_COMP *cpi, int encoded_frame_size) {
const VP9_COMMON *const cm = &cpi->common;
- const VP9_CONFIG *oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *oxcf = &cpi->oxcf;
RATE_CONTROL *const rc = &cpi->rc;
// Non-viewable frames are a special case and are treated as pure overhead.
}
}
-void vp9_rc_init(const VP9_CONFIG *oxcf, int pass, RATE_CONTROL *rc) {
+void vp9_rc_init(const VP9EncoderConfig *oxcf, int pass, RATE_CONTROL *rc) {
if (pass == 0 && oxcf->end_usage == USAGE_STREAM_FROM_SERVER) {
rc->avg_frame_qindex[0] = oxcf->worst_allowed_q;
rc->avg_frame_qindex[1] = oxcf->worst_allowed_q;
}
int vp9_rc_drop_frame(VP9_COMP *cpi) {
- const VP9_CONFIG *oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *oxcf = &cpi->oxcf;
RATE_CONTROL *const rc = &cpi->rc;
if (!oxcf->drop_frames_water_mark) {
// ambient Q (at buffer = optimal level) to worst_quality level
// (at buffer = critical level).
const VP9_COMMON *const cm = &cpi->common;
- const VP9_CONFIG *oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *oxcf = &cpi->oxcf;
const RATE_CONTROL *rc = &cpi->rc;
// Buffer level below which we push active_worst to worst_quality.
int64_t critical_level = oxcf->optimal_buffer_level >> 2;
int *top_index) {
const VP9_COMMON *const cm = &cpi->common;
const RATE_CONTROL *const rc = &cpi->rc;
- const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const int cq_level = oxcf->cq_level;
int active_best_quality;
int active_worst_quality = calc_active_worst_quality_one_pass_vbr(cpi);
int *top_index) {
const VP9_COMMON *const cm = &cpi->common;
const RATE_CONTROL *const rc = &cpi->rc;
- const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const int cq_level = oxcf->cq_level;
int active_best_quality;
int active_worst_quality = cpi->twopass.active_worst_quality;
void vp9_rc_postencode_update(VP9_COMP *cpi, uint64_t bytes_used) {
const VP9_COMMON *const cm = &cpi->common;
- const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *const oxcf = &cpi->oxcf;
RATE_CONTROL *const rc = &cpi->rc;
const int qindex = cm->base_qindex;
}
static int calc_pframe_target_size_one_pass_cbr(const VP9_COMP *cpi) {
- const VP9_CONFIG *oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *oxcf = &cpi->oxcf;
const RATE_CONTROL *rc = &cpi->rc;
const SVC *const svc = &cpi->svc;
const int64_t diff = oxcf->optimal_buffer_level - rc->buffer_level;
static int calc_iframe_target_size_one_pass_cbr(const VP9_COMP *cpi) {
const RATE_CONTROL *rc = &cpi->rc;
- const VP9_CONFIG *oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *oxcf = &cpi->oxcf;
const SVC *const svc = &cpi->svc;
int target;
if (cpi->common.current_video_frame == 0) {
void vp9_rc_update_framerate(VP9_COMP *cpi) {
const VP9_COMMON *const cm = &cpi->common;
- const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *const oxcf = &cpi->oxcf;
RATE_CONTROL *const rc = &cpi->rc;
int vbr_max_bits;
} RATE_CONTROL;
struct VP9_COMP;
-struct VP9_CONFIG;
+struct VP9EncoderConfig;
-void vp9_rc_init(const struct VP9_CONFIG *oxcf, int pass, RATE_CONTROL *rc);
+void vp9_rc_init(const struct VP9EncoderConfig *oxcf, int pass,
+ RATE_CONTROL *rc);
double vp9_convert_qindex_to_q(int qindex);
void vp9_set_speed_features(VP9_COMP *cpi) {
SPEED_FEATURES *const sf = &cpi->sf;
VP9_COMMON *const cm = &cpi->common;
- const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *const oxcf = &cpi->oxcf;
int i;
// best quality defaults
void vp9_init_layer_context(VP9_COMP *const cpi) {
SVC *const svc = &cpi->svc;
- const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *const oxcf = &cpi->oxcf;
int layer;
int layer_end;
void vp9_update_layer_context_change_config(VP9_COMP *const cpi,
const int target_bandwidth) {
SVC *const svc = &cpi->svc;
- const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const RATE_CONTROL *const rc = &cpi->rc;
int layer;
int layer_end;
void vp9_update_temporal_layer_framerate(VP9_COMP *const cpi) {
SVC *const svc = &cpi->svc;
- const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *const oxcf = &cpi->oxcf;
LAYER_CONTEXT *const lc = get_layer_context(svc);
RATE_CONTROL *const lrc = &lc->rc;
const int layer = svc->temporal_layer_id;
}
void vp9_update_spatial_layer_framerate(VP9_COMP *const cpi, double framerate) {
- const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *const oxcf = &cpi->oxcf;
LAYER_CONTEXT *const lc = get_layer_context(&cpi->svc);
RATE_CONTROL *const lrc = &lc->rc;
}
void vp9_save_layer_context(VP9_COMP *const cpi) {
- const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const VP9EncoderConfig *const oxcf = &cpi->oxcf;
LAYER_CONTEXT *const lc = get_layer_context(&cpi->svc);
lc->rc = cpi->rc;
vpx_codec_priv_t base;
vpx_codec_enc_cfg_t cfg;
struct vp9_extracfg extra_cfg;
- VP9_CONFIG oxcf;
+ VP9EncoderConfig oxcf;
VP9_COMP *cpi;
unsigned char *cx_data;
size_t cx_data_sz;
static vpx_codec_err_t set_encoder_config(
- VP9_CONFIG *oxcf,
+ VP9EncoderConfig *oxcf,
const vpx_codec_enc_cfg_t *cfg,
const struct vp9_extracfg *extra_cfg) {
oxcf->profile = cfg->g_profile;