Merge "VP9EncoderConfig -> VP10EncoderConfig"

This commit is contained in:
Hui Su 2015-08-17 16:46:06 +00:00 committed by Gerrit Code Review
commit 81cb6bd496
9 changed files with 51 additions and 51 deletions

View File

@ -614,7 +614,7 @@ static void update_reference_segmentation_map(VP10_COMP *cpi) {
static void alloc_raw_frame_buffers(VP10_COMP *cpi) {
VP10_COMMON *cm = &cpi->common;
const VP9EncoderConfig *oxcf = &cpi->oxcf;
const VP10EncoderConfig *oxcf = &cpi->oxcf;
if (!cpi->lookahead)
cpi->lookahead = vp10_lookahead_init(oxcf->width, oxcf->height,
@ -762,7 +762,7 @@ static void init_buffer_indices(VP10_COMP *cpi) {
cpi->alt_fb_idx = 2;
}
static void init_config(struct VP10_COMP *cpi, VP9EncoderConfig *oxcf) {
static void init_config(struct VP10_COMP *cpi, VP10EncoderConfig *oxcf) {
VP10_COMMON *const cm = &cpi->common;
cpi->oxcf = *oxcf;
@ -806,7 +806,7 @@ static void init_config(struct VP10_COMP *cpi, VP9EncoderConfig *oxcf) {
}
static void set_rc_buffer_sizes(RATE_CONTROL *rc,
const VP9EncoderConfig *oxcf) {
const VP10EncoderConfig *oxcf) {
const int64_t bandwidth = oxcf->target_bandwidth;
const int64_t starting = oxcf->starting_buffer_level_ms;
const int64_t optimal = oxcf->optimal_buffer_level_ms;
@ -1451,7 +1451,7 @@ static void realloc_segmentation_maps(VP10_COMP *cpi) {
vpx_calloc(cm->mi_rows * cm->mi_cols, 1));
}
void vp10_change_config(struct VP10_COMP *cpi, const VP9EncoderConfig *oxcf) {
void vp10_change_config(struct VP10_COMP *cpi, const VP10EncoderConfig *oxcf) {
VP10_COMMON *const cm = &cpi->common;
RATE_CONTROL *const rc = &cpi->rc;
@ -1590,7 +1590,7 @@ static void cal_nmvsadcosts_hp(int *mvsadcost[2]) {
}
VP10_COMP *vp10_create_compressor(VP9EncoderConfig *oxcf,
VP10_COMP *vp10_create_compressor(VP10EncoderConfig *oxcf,
BufferPool *const pool) {
unsigned int i;
VP10_COMP *volatile const cpi = vpx_memalign(32, sizeof(VP10_COMP));
@ -2627,7 +2627,7 @@ static int recode_loop_test(VP10_COMP *cpi,
int high_limit, int low_limit,
int q, int maxq, int minq) {
const RATE_CONTROL *const rc = &cpi->rc;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
const int frame_is_kfgfarf = frame_is_kf_gf_arf(cpi);
int force_recode = 0;
@ -3031,7 +3031,7 @@ static void set_size_independent_vars(VP10_COMP *cpi) {
static void set_size_dependent_vars(VP10_COMP *cpi, int *q,
int *bottom_index, int *top_index) {
VP10_COMMON *const cm = &cpi->common;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
// Setup variables that depend on the dimensions of the frame.
vp10_set_speed_features_framesize_dependent(cpi);
@ -3089,7 +3089,7 @@ static void init_motion_estimation(VP10_COMP *cpi) {
static void set_frame_size(VP10_COMP *cpi) {
int ref_frame;
VP10_COMMON *const cm = &cpi->common;
VP9EncoderConfig *const oxcf = &cpi->oxcf;
VP10EncoderConfig *const oxcf = &cpi->oxcf;
MACROBLOCKD *const xd = &cpi->td.mb.e_mbd;
if (oxcf->pass == 2 &&
@ -3633,7 +3633,7 @@ static void encode_frame_to_data_rate(VP10_COMP *cpi,
uint8_t *dest,
unsigned int *frame_flags) {
VP10_COMMON *const cm = &cpi->common;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
struct segmentation *const seg = &cm->seg;
TX_SIZE t;
@ -4103,7 +4103,7 @@ static void adjust_image_stat(double y, double u, double v, double all,
int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
size_t *size, uint8_t *dest,
int64_t *time_stamp, int64_t *time_end, int flush) {
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
VP10_COMMON *const cm = &cpi->common;
BufferPool *const pool = cm->buffer_pool;
RATE_CONTROL *const rc = &cpi->rc;

View File

@ -121,7 +121,7 @@ typedef enum {
RESIZE_DYNAMIC = 2 // Coded size of each frame is determined by the codec.
} RESIZE_TYPE;
typedef struct VP9EncoderConfig {
typedef struct VP10EncoderConfig {
BITSTREAM_PROFILE profile;
vpx_bit_depth_t bit_depth; // Codec bit-depth.
int width; // width of data passed to the compressor
@ -240,9 +240,9 @@ typedef struct VP9EncoderConfig {
#endif
vpx_color_space_t color_space;
VP9E_TEMPORAL_LAYERING_MODE temporal_layering_mode;
} VP9EncoderConfig;
} VP10EncoderConfig;
static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) {
static INLINE int is_lossless_requested(const VP10EncoderConfig *cfg) {
return cfg->best_allowed_q == 0 && cfg->worst_allowed_q == 0;
}
@ -296,7 +296,7 @@ typedef struct VP10_COMP {
DECLARE_ALIGNED(16, int16_t, y_dequant[QINDEX_RANGE][8]);
DECLARE_ALIGNED(16, int16_t, uv_dequant[QINDEX_RANGE][8]);
VP10_COMMON common;
VP9EncoderConfig oxcf;
VP10EncoderConfig oxcf;
struct lookahead_ctx *lookahead;
struct lookahead_entry *alt_ref_source;
@ -505,11 +505,11 @@ typedef struct VP10_COMP {
void vp10_initialize_enc(void);
struct VP10_COMP *vp10_create_compressor(VP9EncoderConfig *oxcf,
struct VP10_COMP *vp10_create_compressor(VP10EncoderConfig *oxcf,
BufferPool *const pool);
void vp10_remove_compressor(VP10_COMP *cpi);
void vp10_change_config(VP10_COMP *cpi, const VP9EncoderConfig *oxcf);
void vp10_change_config(VP10_COMP *cpi, const VP10EncoderConfig *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..

View File

@ -253,7 +253,7 @@ static double calculate_active_area(const VP10_COMP *cpi,
#define ACT_AREA_CORRECTION 0.5
static double calculate_modified_err(const VP10_COMP *cpi,
const TWO_PASS *twopass,
const VP9EncoderConfig *oxcf,
const VP10EncoderConfig *oxcf,
const FIRSTPASS_STATS *this_frame) {
const FIRSTPASS_STATS *const stats = &twopass->total_stats;
const double av_weight = stats->weight / stats->count;
@ -276,7 +276,7 @@ static double calculate_modified_err(const VP10_COMP *cpi,
// This function returns the maximum target rate per frame.
static int frame_max_bits(const RATE_CONTROL *rc,
const VP9EncoderConfig *oxcf) {
const VP10EncoderConfig *oxcf) {
int64_t max_bits = ((int64_t)rc->avg_frame_bandwidth *
(int64_t)oxcf->two_pass_vbrmax_section) / 100;
if (max_bits < 0)
@ -1183,7 +1183,7 @@ static int get_twopass_worst_quality(const VP10_COMP *cpi,
int section_target_bandwidth,
double group_weight_factor) {
const RATE_CONTROL *const rc = &cpi->rc;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
inactive_zone = fclamp(inactive_zone, 0.0, 1.0);
@ -1265,7 +1265,7 @@ void vp10_calculate_coded_size(VP10_COMP *cpi,
void vp10_init_second_pass(VP10_COMP *cpi) {
SVC *const svc = &cpi->svc;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
const int is_two_pass_svc = (svc->number_spatial_layers > 1) ||
(svc->number_temporal_layers > 1);
TWO_PASS *const twopass = is_two_pass_svc ?
@ -1684,7 +1684,7 @@ static void get_arf_buffer_indices(unsigned char *arf_buffer_indices) {
static void allocate_gf_group_bits(VP10_COMP *cpi, int64_t gf_group_bits,
double group_error, int gf_arf_bits) {
RATE_CONTROL *const rc = &cpi->rc;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
TWO_PASS *const twopass = &cpi->twopass;
GF_GROUP *const gf_group = &twopass->gf_group;
FIRSTPASS_STATS frame_stats;
@ -1845,7 +1845,7 @@ static void allocate_gf_group_bits(VP10_COMP *cpi, int64_t gf_group_bits,
static void define_gf_group(VP10_COMP *cpi, FIRSTPASS_STATS *this_frame) {
VP10_COMMON *const cm = &cpi->common;
RATE_CONTROL *const rc = &cpi->rc;
VP9EncoderConfig *const oxcf = &cpi->oxcf;
VP10EncoderConfig *const oxcf = &cpi->oxcf;
TWO_PASS *const twopass = &cpi->twopass;
FIRSTPASS_STATS next_frame;
const FIRSTPASS_STATS *const start_pos = twopass->stats_in;
@ -2267,7 +2267,7 @@ static void find_next_key_frame(VP10_COMP *cpi, FIRSTPASS_STATS *this_frame) {
RATE_CONTROL *const rc = &cpi->rc;
TWO_PASS *const twopass = &cpi->twopass;
GF_GROUP *const gf_group = &twopass->gf_group;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
const FIRSTPASS_STATS first_frame = *this_frame;
const FIRSTPASS_STATS *const start_position = twopass->stats_in;
FIRSTPASS_STATS next_frame;

View File

@ -198,7 +198,7 @@ int vp10_estimate_bits_at_q(FRAME_TYPE frame_type, int q, int mbs,
int vp10_rc_clamp_pframe_target_size(const VP10_COMP *const cpi, int target) {
const RATE_CONTROL *rc = &cpi->rc;
const VP9EncoderConfig *oxcf = &cpi->oxcf;
const VP10EncoderConfig *oxcf = &cpi->oxcf;
const int min_frame_target = MAX(rc->min_frame_bandwidth,
rc->avg_frame_bandwidth >> 5);
if (target < min_frame_target)
@ -223,7 +223,7 @@ int vp10_rc_clamp_pframe_target_size(const VP10_COMP *const cpi, int target) {
int vp10_rc_clamp_iframe_target_size(const VP10_COMP *const cpi, int target) {
const RATE_CONTROL *rc = &cpi->rc;
const VP9EncoderConfig *oxcf = &cpi->oxcf;
const VP10EncoderConfig *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;
@ -301,7 +301,7 @@ int vp10_rc_get_default_max_gf_interval(double framerate, int min_gf_interval) {
return MAX(interval, min_gf_interval);
}
void vp10_rc_init(const VP9EncoderConfig *oxcf, int pass, RATE_CONTROL *rc) {
void vp10_rc_init(const VP10EncoderConfig *oxcf, int pass, RATE_CONTROL *rc) {
int i;
if (pass == 0 && oxcf->rc_mode == VPX_CBR) {
@ -359,7 +359,7 @@ void vp10_rc_init(const VP9EncoderConfig *oxcf, int pass, RATE_CONTROL *rc) {
}
int vp10_rc_drop_frame(VP10_COMP *cpi) {
const VP9EncoderConfig *oxcf = &cpi->oxcf;
const VP10EncoderConfig *oxcf = &cpi->oxcf;
RATE_CONTROL *const rc = &cpi->rc;
if (!oxcf->drop_frames_water_mark) {
@ -796,7 +796,7 @@ static int rc_pick_q_and_bounds_one_pass_cbr(const VP10_COMP *cpi,
}
static int get_active_cq_level(const RATE_CONTROL *rc,
const VP9EncoderConfig *const oxcf) {
const VP10EncoderConfig *const oxcf) {
static const double cq_adjust_threshold = 0.1;
int active_cq_level = oxcf->cq_level;
if (oxcf->rc_mode == VPX_CQ &&
@ -814,7 +814,7 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP10_COMP *cpi,
int *top_index) {
const VP10_COMMON *const cm = &cpi->common;
const RATE_CONTROL *const rc = &cpi->rc;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
const int cq_level = get_active_cq_level(rc, oxcf);
int active_best_quality;
int active_worst_quality = calc_active_worst_quality_one_pass_vbr(cpi);
@ -983,7 +983,7 @@ static int rc_pick_q_and_bounds_two_pass(const VP10_COMP *cpi,
int *top_index) {
const VP10_COMMON *const cm = &cpi->common;
const RATE_CONTROL *const rc = &cpi->rc;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
const GF_GROUP *gf_group = &cpi->twopass.gf_group;
const int cq_level = get_active_cq_level(rc, oxcf);
int active_best_quality;
@ -1267,7 +1267,7 @@ static void update_golden_frame_stats(VP10_COMP *cpi) {
void vp10_rc_postencode_update(VP10_COMP *cpi, uint64_t bytes_used) {
const VP10_COMMON *const cm = &cpi->common;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
RATE_CONTROL *const rc = &cpi->rc;
const int qindex = cm->base_qindex;
@ -1439,7 +1439,7 @@ void vp10_rc_get_one_pass_vbr_params(VP10_COMP *cpi) {
}
static int calc_pframe_target_size_one_pass_cbr(const VP10_COMP *cpi) {
const VP9EncoderConfig *oxcf = &cpi->oxcf;
const VP10EncoderConfig *oxcf = &cpi->oxcf;
const RATE_CONTROL *rc = &cpi->rc;
const SVC *const svc = &cpi->svc;
const int64_t diff = rc->optimal_buffer_level - rc->buffer_level;
@ -1487,7 +1487,7 @@ static int calc_pframe_target_size_one_pass_cbr(const VP10_COMP *cpi) {
static int calc_iframe_target_size_one_pass_cbr(const VP10_COMP *cpi) {
const RATE_CONTROL *rc = &cpi->rc;
const VP9EncoderConfig *oxcf = &cpi->oxcf;
const VP10EncoderConfig *oxcf = &cpi->oxcf;
const SVC *const svc = &cpi->svc;
int target;
if (cpi->common.current_video_frame == 0) {
@ -1688,7 +1688,7 @@ int vp10_compute_qdelta_by_rate(const RATE_CONTROL *rc, FRAME_TYPE frame_type,
void vp10_rc_set_gf_interval_range(const VP10_COMP *const cpi,
RATE_CONTROL *const rc) {
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
// Set Maximum gf/arf interval
rc->max_gf_interval = oxcf->max_gf_interval;
@ -1717,7 +1717,7 @@ void vp10_rc_set_gf_interval_range(const VP10_COMP *const cpi,
void vp10_rc_update_framerate(VP10_COMP *cpi) {
const VP10_COMMON *const cm = &cpi->common;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
RATE_CONTROL *const rc = &cpi->rc;
int vbr_max_bits;

View File

@ -145,9 +145,9 @@ typedef struct {
} RATE_CONTROL;
struct VP10_COMP;
struct VP9EncoderConfig;
struct VP10EncoderConfig;
void vp10_rc_init(const struct VP9EncoderConfig *oxcf, int pass,
void vp10_rc_init(const struct VP10EncoderConfig *oxcf, int pass,
RATE_CONTROL *rc);
int vp10_estimate_bits_at_q(FRAME_TYPE frame_kind, int q, int mbs,

View File

@ -404,7 +404,7 @@ static void set_rt_speed_feature(VP10_COMP *cpi, SPEED_FEATURES *sf,
void vp10_set_speed_features_framesize_dependent(VP10_COMP *cpi) {
SPEED_FEATURES *const sf = &cpi->sf;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
RD_OPT *const rd = &cpi->rd;
int i;
@ -435,7 +435,7 @@ void vp10_set_speed_features_framesize_independent(VP10_COMP *cpi) {
SPEED_FEATURES *const sf = &cpi->sf;
VP10_COMMON *const cm = &cpi->common;
MACROBLOCK *const x = &cpi->td.mb;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
int i;
// best quality defaults

View File

@ -20,7 +20,7 @@
void vp10_init_layer_context(VP10_COMP *const cpi) {
SVC *const svc = &cpi->svc;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
int sl, tl;
int alt_ref_idx = svc->number_spatial_layers;
@ -106,7 +106,7 @@ void vp10_init_layer_context(VP10_COMP *const cpi) {
void vp10_update_layer_context_change_config(VP10_COMP *const cpi,
const int target_bandwidth) {
SVC *const svc = &cpi->svc;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
const RATE_CONTROL *const rc = &cpi->rc;
int sl, tl, layer = 0, spatial_layer_target;
float bitrate_alloc = 1.0;
@ -204,7 +204,7 @@ static LAYER_CONTEXT *get_layer_context(VP10_COMP *const cpi) {
void vp10_update_temporal_layer_framerate(VP10_COMP *const cpi) {
SVC *const svc = &cpi->svc;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
LAYER_CONTEXT *const lc = get_layer_context(cpi);
RATE_CONTROL *const lrc = &lc->rc;
// Index into spatial+temporal arrays.
@ -231,7 +231,7 @@ void vp10_update_temporal_layer_framerate(VP10_COMP *const cpi) {
void vp10_update_spatial_layer_framerate(VP10_COMP *const cpi,
double framerate) {
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
LAYER_CONTEXT *const lc = get_layer_context(cpi);
RATE_CONTROL *const lrc = &lc->rc;
@ -262,7 +262,7 @@ void vp10_restore_layer_context(VP10_COMP *const cpi) {
}
void vp10_save_layer_context(VP10_COMP *const cpi) {
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
LAYER_CONTEXT *const lc = get_layer_context(cpi);
lc->rc = cpi->rc;

View File

@ -591,7 +591,7 @@ static void temporal_filter_iterate_c(VP10_COMP *cpi,
static void adjust_arnr_filter(VP10_COMP *cpi,
int distance, int group_boost,
int *arnr_frames, int *arnr_strength) {
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
const VP10EncoderConfig *const oxcf = &cpi->oxcf;
const int frames_after_arf =
vp10_lookahead_depth(cpi->lookahead) - distance - 1;
int frames_fwd = (cpi->oxcf.arnr_max_frames - 1) >> 1;

View File

@ -76,12 +76,12 @@ static struct vp10_extracfg default_extra_cfg = {
struct vpx_codec_alg_priv {
vpx_codec_priv_t base;
vpx_codec_enc_cfg_t cfg;
struct vp10_extracfg extra_cfg;
VP9EncoderConfig oxcf;
struct vp10_extracfg extra_cfg;
VP10EncoderConfig oxcf;
VP10_COMP *cpi;
unsigned char *cx_data;
unsigned char *cx_data;
size_t cx_data_sz;
unsigned char *pending_cx_data;
unsigned char *pending_cx_data;
size_t pending_cx_data_sz;
int pending_frame_count;
size_t pending_frame_sizes[8];
@ -90,7 +90,7 @@ struct vpx_codec_alg_priv {
vpx_enc_frame_flags_t next_frame_flags;
vp8_postproc_cfg_t preview_ppcfg;
vpx_codec_pkt_list_decl(256) pkt_list;
unsigned int fixed_kf_cntr;
unsigned int fixed_kf_cntr;
vpx_codec_priv_output_cx_pkt_cb_pair_t output_cx_pkt_cb;
// BufferPool that holds all reference frames.
BufferPool *buffer_pool;
@ -377,7 +377,7 @@ static int get_image_bps(const vpx_image_t *img) {
}
static vpx_codec_err_t set_encoder_config(
VP9EncoderConfig *oxcf,
VP10EncoderConfig *oxcf,
const vpx_codec_enc_cfg_t *cfg,
const struct vp10_extracfg *extra_cfg) {
const int is_vbr = cfg->rc_end_usage == VPX_VBR;