Commit 07f86d09 authored by Dmitry Kovalev's avatar Dmitry Kovalev

Renaming VP9_CONFIG to VP9EncoderConfig.

Change-Id: Id48edd12c6f649c82113128491ef6ea7410e93b2
parent 400973c3
......@@ -336,7 +336,8 @@ static double simple_weight(const YV12_BUFFER_CONFIG *buf) {
}
// 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)
......@@ -904,7 +905,7 @@ static int get_twopass_worst_quality(const VP9_COMP *cpi,
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
......@@ -939,7 +940,7 @@ extern void vp9_new_framerate(VP9_COMP *cpi, double framerate);
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 ?
......@@ -1400,7 +1401,7 @@ void define_fixed_arf_period(VP9_COMP *cpi) {
// 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;
......
......@@ -511,7 +511,7 @@ static void set_speed_features(VP9_COMP *cpi) {
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,
......@@ -633,7 +633,7 @@ static void set_tile_limits(VP9_COMP *cpi) {
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;
......@@ -693,7 +693,7 @@ static int get_pass(MODE mode) {
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;
......@@ -865,7 +865,7 @@ static void cal_nmvsadcosts_hp(int *mvsadcost[2]) {
}
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;
......@@ -1683,7 +1683,7 @@ static int recode_loop_test(const VP9_COMP *cpi,
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.
......
......@@ -186,7 +186,7 @@ typedef enum {
} 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
......@@ -285,7 +285,7 @@ typedef struct VP9_CONFIG {
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;
......@@ -321,7 +321,7 @@ typedef struct VP9_COMP {
QUANTS quants;
MACROBLOCK mb;
VP9_COMMON common;
VP9_CONFIG oxcf;
VP9EncoderConfig oxcf;
struct lookahead_ctx *lookahead;
struct lookahead_entry *source;
#if CONFIG_MULTIPLE_ARF
......@@ -521,10 +521,10 @@ typedef struct VP9_COMP {
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..
......
......@@ -134,7 +134,7 @@ int vp9_rc_clamp_pframe_target_size(const VP9_COMP *const cpi, int target) {
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;
......@@ -167,7 +167,7 @@ static void update_layer_buffer_level(SVC *svc, int encoded_frame_size) {
// 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.
......@@ -186,7 +186,7 @@ static void update_buffer_level(VP9_COMP *cpi, int encoded_frame_size) {
}
}
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;
......@@ -237,7 +237,7 @@ void vp9_rc_init(const VP9_CONFIG *oxcf, int pass, RATE_CONTROL *rc) {
}
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) {
......@@ -444,7 +444,7 @@ static int calc_active_worst_quality_one_pass_cbr(const VP9_COMP *cpi) {
// 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;
......@@ -612,7 +612,7 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *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 = calc_active_worst_quality_one_pass_vbr(cpi);
......@@ -801,7 +801,7 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *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;
......@@ -1079,7 +1079,7 @@ static void update_golden_frame_stats(VP9_COMP *cpi) {
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;
......@@ -1238,7 +1238,7 @@ void vp9_rc_get_one_pass_vbr_params(VP9_COMP *cpi) {
}
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;
......@@ -1269,7 +1269,7 @@ static int calc_pframe_target_size_one_pass_cbr(const VP9_COMP *cpi) {
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) {
......@@ -1388,7 +1388,7 @@ int vp9_compute_qdelta_by_rate(const RATE_CONTROL *rc, FRAME_TYPE frame_type,
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;
......
......@@ -87,9 +87,10 @@ typedef struct {
} 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);
......
......@@ -288,7 +288,7 @@ static void set_rt_speed_feature(VP9_COMMON *cm, SPEED_FEATURES *sf,
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
......
......@@ -15,7 +15,7 @@
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;
......@@ -65,7 +65,7 @@ void vp9_init_layer_context(VP9_COMP *const cpi) {
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;
......@@ -118,7 +118,7 @@ static LAYER_CONTEXT *get_layer_context(SVC *svc) {
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;
......@@ -141,7 +141,7 @@ void vp9_update_temporal_layer_framerate(VP9_COMP *const cpi) {
}
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;
......@@ -187,7 +187,7 @@ void vp9_restore_layer_context(VP9_COMP *const cpi) {
}
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;
......
......@@ -77,7 +77,7 @@ struct vpx_codec_alg_priv {
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;
......@@ -291,7 +291,7 @@ static vpx_codec_err_t validate_img(vpx_codec_alg_priv_t *ctx,
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment