Commit d115dbc2 authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

Adjust style to match Google Coding Style a little more closely.

Most of these were picked up in the previous commit (prefix change from
vp8_ to vp9_), but I'm pushing this separately so that it's easier to
review.

Change-Id: I91e959895778b8632d7d33375523df8a7568a490
parent f88558fb
......@@ -172,7 +172,7 @@ extern "C"
} VP8_CONFIG;
void vp9_initialize();
void vp9_initialize_enc();
VP8_PTR vp9_create_compressor(VP8_CONFIG *oxcf);
void vp9_remove_compressor(VP8_PTR *comp);
......@@ -182,18 +182,41 @@ extern "C"
// 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_receive_raw_frame(VP8_PTR comp, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time_stamp);
int vp9_get_compressed_data(VP8_PTR comp, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, int64_t *time_stamp, int64_t *time_end, int flush);
int vp9_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags);
int vp9_receive_raw_frame(VP8_PTR comp, unsigned int frame_flags,
YV12_BUFFER_CONFIG *sd, int64_t time_stamp,
int64_t end_time_stamp);
int vp9_get_compressed_data(VP8_PTR comp, unsigned int *frame_flags,
unsigned long *size, unsigned char *dest,
int64_t *time_stamp, int64_t *time_end,
int flush);
int vp9_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest,
vp8_ppflags_t *flags);
int vp9_use_as_reference(VP8_PTR comp, int ref_frame_flags);
int vp9_update_reference(VP8_PTR comp, int ref_frame_flags);
int vp9_get_reference(VP8_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd);
int vp9_set_reference(VP8_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd);
int vp9_get_reference_enc(VP8_PTR comp, VP8_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd);
int vp9_set_reference_enc(VP8_PTR comp, VP8_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd);
int vp9_update_entropy(VP8_PTR comp, int update);
int vp9_set_roimap(VP8_PTR comp, unsigned char *map, unsigned int rows, unsigned int cols, int delta_q[4], int delta_lf[4], unsigned int threshold[4]);
int vp9_set_active_map(VP8_PTR comp, unsigned char *map, unsigned int rows, unsigned int cols);
int vp9_set_internal_size(VP8_PTR comp, VPX_SCALING horiz_mode, VPX_SCALING vert_mode);
int vp9_set_roimap(VP8_PTR comp, unsigned char *map,
unsigned int rows, unsigned int cols,
int delta_q[4], int delta_lf[4],
unsigned int threshold[4]);
int vp9_set_active_map(VP8_PTR comp, unsigned char *map,
unsigned int rows, unsigned int cols);
int vp9_set_internal_size(VP8_PTR comp,
VPX_SCALING horiz_mode, VPX_SCALING vert_mode);
int vp9_get_quantizer(VP8_PTR c);
#ifdef __cplusplus
......
......@@ -1860,7 +1860,8 @@ static void segment_reference_frames(VP8_COMP *cpi) {
}
}
void vp9_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size) {
void vp9_pack_bitstream(VP8_COMP *cpi, unsigned char *dest,
unsigned long *size) {
int i, j;
VP8_HEADER oh;
VP8_COMMON *const pc = &cpi->common;
......@@ -1883,12 +1884,15 @@ void vp9_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size)
compute_update_table();
// vp8_kf_default_bmode_probs() is called in vp9_setup_key_frame() once for each
// K frame before encode frame. pc->kf_bmode_prob doesn't get changed anywhere
// else. No need to call it again here. --yw
// vp8_kf_default_bmode_probs( pc->kf_bmode_prob);
/* vp8_kf_default_bmode_probs() is called in vp9_setup_key_frame() once
* for each K frame before encode frame. pc->kf_bmode_prob doesn't get
* changed anywhere else. No need to call it again here. --yw
* vp8_kf_default_bmode_probs( pc->kf_bmode_prob);
*/
// every keyframe send startcode, width, height, scale factor, clamp and color type
/* every keyframe send startcode, width, height, scale factor, clamp
* and color type.
*/
if (oh.type == KEY_FRAME) {
int v;
......
......@@ -503,7 +503,7 @@ void vp9_short_fdct8x8_c(short *InputData, short *OutputData, int pitch) {
}
}
void vp9_short_fhaar2x2_c(short *input, short *output, int pitch) { // pitch = 8
void vp9_short_fhaar2x2_c(short *input, short *output, int pitch) {
/* [1 1; 1 -1] orthogonal transform */
/* use position: 0,1, 4, 8 */
int i;
......@@ -517,7 +517,6 @@ void vp9_short_fhaar2x2_c(short *input, short *output, int pitch) { // pitch = 8
op1[1] = (ip1[0] - ip1[1] + ip1[4] - ip1[8]) >> 1;
op1[4] = (ip1[0] + ip1[1] - ip1[4] - ip1[8]) >> 1;
op1[8] = (ip1[0] - ip1[1] - ip1[4] + ip1[8]) >> 1;
}
/* For test */
......
......@@ -54,31 +54,36 @@ int enc_debug = 0;
int mb_row_debug, mb_col_debug;
#endif
extern void vp9cx_initialize_me_consts(VP8_COMP *cpi, int QIndex);
extern void vp9_initialize_me_consts(VP8_COMP *cpi, int QIndex);
extern void vp9_auto_select_speed(VP8_COMP *cpi);
extern void vp8cx_init_mbrthread_data(VP8_COMP *cpi,
MACROBLOCK *x,
MB_ROW_COMP *mbr_ei,
int mb_row,
int count);
int64_t vp9_rd_pick_inter_mode_sb(VP8_COMP *cpi, MACROBLOCK *x,
int recon_yoffset, int recon_uvoffset,
int *returnrate, int *returndistortion);
extern void vp9cx_pick_mode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x,
int recon_yoffset,
int recon_uvoffset, int *r, int *d);
extern void vp9_pick_mode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x,
int recon_yoffset,
int recon_uvoffset, int *r, int *d);
void vp9_build_block_offsets(MACROBLOCK *x);
void vp9_setup_block_ptrs(MACROBLOCK *x);
void vp9cx_encode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t,
int recon_yoffset, int recon_uvoffset,
int output_enabled);
void vp9cx_encode_inter_superblock(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t,
int recon_yoffset, int recon_uvoffset, int mb_col, int mb_row);
void vp9cx_encode_intra_macro_block(VP8_COMP *cpi, MACROBLOCK *x,
TOKENEXTRA **t, int output_enabled);
void vp9cx_encode_intra_super_block(VP8_COMP *cpi,
MACROBLOCK *x,
TOKENEXTRA **t, int mb_col);
void vp9_encode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t,
int recon_yoffset, int recon_uvoffset,
int output_enabled);
void vp9_encode_inter_superblock(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t,
int recon_yoffset, int recon_uvoffset,
int mb_col, int mb_row);
void vp9_encode_intra_macro_block(VP8_COMP *cpi, MACROBLOCK *x,
TOKENEXTRA **t, int output_enabled);
void vp9_encode_intra_super_block(VP8_COMP *cpi, MACROBLOCK *x,
TOKENEXTRA **t, int mb_col);
static void adjust_act_zbin(VP8_COMP *cpi, MACROBLOCK *x);
#ifdef MODE_STATS
......@@ -605,7 +610,7 @@ static void pick_mb_modes(VP8_COMP *cpi,
if (mbmi->segment_id > 3)
mbmi->segment_id = 0;
vp9cx_mb_init_quantizer(cpi, x);
vp9_mb_init_quantizer(cpi, x);
} else
// Set to Segment 0 by default
mbmi->segment_id = 0;
......@@ -629,7 +634,7 @@ static void pick_mb_modes(VP8_COMP *cpi,
*totaldist += d;
// Dummy encode, do not do the tokenization
vp9cx_encode_intra_macro_block(cpi, x, tp, 0);
vp9_encode_intra_macro_block(cpi, x, tp, 0);
// Note the encoder may have changed the segment_id
// Save the coding context
......@@ -650,14 +655,14 @@ static void pick_mb_modes(VP8_COMP *cpi,
cpi->seg0_progress = (((mb_col & ~1) * 2 + (mb_row & ~1) * cm->mb_cols + i) << 16) / cm->MBs;
}
vp9cx_pick_mode_inter_macroblock(cpi, x, recon_yoffset,
recon_uvoffset, &r, &d);
vp9_pick_mode_inter_macroblock(cpi, x, recon_yoffset,
recon_uvoffset, &r, &d);
*totalrate += r;
*totaldist += d;
// Dummy encode, do not do the tokenization
vp9cx_encode_inter_macroblock(cpi, x, tp,
recon_yoffset, recon_uvoffset, 0);
vp9_encode_inter_macroblock(cpi, x, tp,
recon_yoffset, recon_uvoffset, 0);
seg_id = mbmi->segment_id;
if (cpi->mb.e_mbd.segmentation_enabled && seg_id == 0) {
......@@ -797,7 +802,7 @@ static void pick_sb_modes (VP8_COMP *cpi,
if (xd->mode_info_context->mbmi.segment_id > 3)
xd->mode_info_context->mbmi.segment_id = 0;
vp9cx_mb_init_quantizer(cpi, x);
vp9_mb_init_quantizer(cpi, x);
}
else
/* Set to Segment 0 by default */
......@@ -972,7 +977,7 @@ static void encode_sb(VP8_COMP *cpi,
// Is segmentation enabled
if (xd->segmentation_enabled) {
vp9cx_mb_init_quantizer(cpi, x);
vp9_mb_init_quantizer(cpi, x);
}
x->active_ptr = cpi->active_map + map_index;
......@@ -987,10 +992,10 @@ static void encode_sb(VP8_COMP *cpi,
if (cm->frame_type == KEY_FRAME) {
#if CONFIG_SUPERBLOCKS
if (xd->mode_info_context->mbmi.encoded_as_sb)
vp9cx_encode_intra_super_block(cpi, x, tp, mb_col);
vp9_encode_intra_super_block(cpi, x, tp, mb_col);
else
#endif
vp9cx_encode_intra_macro_block(cpi, x, tp, 1);
vp9_encode_intra_macro_block(cpi, x, tp, 1);
// Note the encoder may have changed the segment_id
#ifdef MODE_STATS
......@@ -1013,11 +1018,12 @@ static void encode_sb(VP8_COMP *cpi,
#if CONFIG_SUPERBLOCKS
if (xd->mode_info_context->mbmi.encoded_as_sb)
vp9cx_encode_inter_superblock(cpi, x, tp, recon_yoffset, recon_uvoffset, mb_col, mb_row);
vp9_encode_inter_superblock(cpi, x, tp, recon_yoffset, recon_uvoffset,
mb_col, mb_row);
else
#endif
vp9cx_encode_inter_macroblock(cpi, x, tp,
recon_yoffset, recon_uvoffset, 1);
vp9_encode_inter_macroblock(cpi, x, tp,
recon_yoffset, recon_uvoffset, 1);
// Note the encoder may have changed the segment_id
#ifdef MODE_STATS
......@@ -1360,10 +1366,10 @@ static void encode_frame_internal(VP8_COMP *cpi) {
vp8_zero(cpi->coef_counts_16x16);
vp8_zero(cpi->hybrid_coef_counts_16x16);
vp9cx_frame_init_quantizer(cpi);
vp9_frame_init_quantizer(cpi);
vp9_initialize_rd_consts(cpi, cm->base_qindex + cm->y1dc_delta_q);
vp9cx_initialize_me_consts(cpi, cm->base_qindex);
vp9_initialize_me_consts(cpi, cm->base_qindex);
if (cpi->oxcf.tuning == VP8_TUNE_SSIM) {
// Initialize encode frame context.
......@@ -1846,10 +1852,10 @@ static void update_sb_skip_coeff_state(VP8_COMP *cpi,
}
}
void vp9cx_encode_intra_super_block(VP8_COMP *cpi,
MACROBLOCK *x,
TOKENEXTRA **t,
int mb_col) {
void vp9_encode_intra_super_block(VP8_COMP *cpi,
MACROBLOCK *x,
TOKENEXTRA **t,
int mb_col) {
const int output_enabled = 1;
int n;
MACROBLOCKD *xd = &x->e_mbd;
......@@ -1926,10 +1932,10 @@ void vp9cx_encode_intra_super_block(VP8_COMP *cpi,
}
#endif /* CONFIG_SUPERBLOCKS */
void vp9cx_encode_intra_macro_block(VP8_COMP *cpi,
MACROBLOCK *x,
TOKENEXTRA **t,
int output_enabled) {
void vp9_encode_intra_macro_block(VP8_COMP *cpi,
MACROBLOCK *x,
TOKENEXTRA **t,
int output_enabled) {
MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi;
if ((cpi->oxcf.tuning == VP8_TUNE_SSIM) && output_enabled) {
adjust_act_zbin(cpi, x);
......@@ -1984,9 +1990,9 @@ extern int cnt_pm;
extern void vp9_fix_contexts(MACROBLOCKD *xd);
void vp9cx_encode_inter_macroblock (VP8_COMP *cpi, MACROBLOCK *x,
TOKENEXTRA **t, int recon_yoffset,
int recon_uvoffset, int output_enabled) {
void vp9_encode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x,
TOKENEXTRA **t, int recon_yoffset,
int recon_uvoffset, int output_enabled) {
VP8_COMMON *cm = &cpi->common;
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO * mbmi = &xd->mode_info_context->mbmi;
......@@ -2170,8 +2176,9 @@ void vp9cx_encode_inter_macroblock (VP8_COMP *cpi, MACROBLOCK *x,
}
#if CONFIG_SUPERBLOCKS
void vp9cx_encode_inter_superblock(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t,
int recon_yoffset, int recon_uvoffset, int mb_col, int mb_row) {
void vp9_encode_inter_superblock(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t,
int recon_yoffset, int recon_uvoffset,
int mb_col, int mb_row) {
const int output_enabled = 1;
VP8_COMMON *cm = &cpi->common;
MACROBLOCKD *xd = &x->e_mbd;
......
......@@ -77,7 +77,7 @@ void vp9_encode_intra4x4block(const VP8_ENCODER_RTCD *rtcd,
vp9_ht_quantize_b_4x4(be, b, tx_type);
vp8_ihtllm_c(b->dqcoeff, b->diff, 32, tx_type, 4);
} else {
x->vp9_short_fdct4x4(be->src_diff, be->coeff, 32) ;
x->vp9_short_fdct4x4(be->src_diff, be->coeff, 32);
x->quantize_b_4x4(be, b) ;
vp8_inverse_transform_b_4x4(IF_RTCD(&rtcd->common->idct), b, 32) ;
}
......
......@@ -40,9 +40,14 @@
#endif
extern void vp9_build_block_offsets(MACROBLOCK *x);
extern void vp9_setup_block_ptrs(MACROBLOCK *x);
extern void vp9cx_frame_init_quantizer(VP8_COMP *cpi);
extern void vp9_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv);
extern void vp9_frame_init_quantizer(VP8_COMP *cpi);
extern void vp9_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb,
int_mv *mv);
extern void vp9_alloc_compressor_data(VP8_COMP *cpi);
#define IIFACTOR 12.5
......@@ -485,7 +490,7 @@ void vp9_first_pass(VP8_COMP *cpi) {
// set up frame new frame for intra coded blocks
vp8_setup_intra_recon(new_yv12);
vp9cx_frame_init_quantizer(cpi);
vp9_frame_init_quantizer(cpi);
// Initialise the MV cost table to the defaults
// if( cm->current_video_frame == 0)
......@@ -1138,11 +1143,15 @@ void vp9_init_second_pass(VP8_COMP *cpi) {
// encoded in the second pass is a guess. However the sum duration is not.
// Its calculated based on the actual durations of all frames from the first
// pass.
vp9_new_frame_rate(cpi, 10000000.0 * cpi->twopass.total_stats->count / cpi->twopass.total_stats->duration);
vp9_new_frame_rate(cpi,
10000000.0 * cpi->twopass.total_stats->count /
cpi->twopass.total_stats->duration);
cpi->output_frame_rate = cpi->oxcf.frame_rate;
cpi->twopass.bits_left = (int64_t)(cpi->twopass.total_stats->duration * cpi->oxcf.target_bandwidth / 10000000.0);
cpi->twopass.bits_left -= (int64_t)(cpi->twopass.total_stats->duration * two_pass_min_rate / 10000000.0);
cpi->twopass.bits_left = (int64_t)(cpi->twopass.total_stats->duration *
cpi->oxcf.target_bandwidth / 10000000.0);
cpi->twopass.bits_left -= (int64_t)(cpi->twopass.total_stats->duration *
two_pass_min_rate / 10000000.0);
// Calculate a minimum intra value to be used in determining the IIratio
// scores used in the second pass. We have this minimum to make sure
......
......@@ -17,8 +17,12 @@
void vp9_arch_x86_encoder_init(VP8_COMP *cpi);
void vp8_arch_arm_encoder_init(VP8_COMP *cpi);
void (*vp9_yv12_copy_partial_frame_ptr)(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc, int Fraction);
extern void vp9_yv12_copy_partial_frame(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc, int Fraction);
void (*vp9_yv12_copy_partial_frame_ptr)(YV12_BUFFER_CONFIG *src_ybc,
YV12_BUFFER_CONFIG *dst_ybc,
int fraction);
extern void vp9_yv12_copy_partial_frame(YV12_BUFFER_CONFIG *src_ybc,
YV12_BUFFER_CONFIG *dst_ybc,
int fraction);
void vp9_cmachine_specific_config(VP8_COMP *cpi) {
#if CONFIG_RUNTIME_CPU_DETECT
......
......@@ -17,21 +17,17 @@
void vp9_init_mode_costs(VP8_COMP *c) {
VP8_COMMON *x = &c->common;
{
const vp8_tree_p T = vp8_bmode_tree;
int i = 0;
do {
int j = 0;
do {
vp9_cost_tokens((int *)c->mb.bmode_costs[i][j], x->kf_bmode_prob[i][j], T);
} while (++j < VP8_BINTRAMODES);
} while (++i < VP8_BINTRAMODES);
vp9_cost_tokens((int *)c->mb.inter_bmode_costs, x->fc.bmode_prob, T);
const vp8_tree_p T = vp8_bmode_tree;
int i, j;
for (i = 0; i < VP8_BINTRAMODES; i++) {
for (j = 0; j < VP8_BINTRAMODES; j++) {
vp9_cost_tokens((int *)c->mb.bmode_costs[i][j],
x->kf_bmode_prob[i][j], T);
}
}
vp9_cost_tokens((int *)c->mb.inter_bmode_costs, x->fc.bmode_prob, T);
vp9_cost_tokens((int *)c->mb.inter_bmode_costs,
x->fc.sub_mv_ref_prob[0], vp8_sub_mv_ref_tree);
......@@ -46,11 +42,8 @@ void vp9_init_mode_costs(VP8_COMP *c) {
vp9_cost_tokens(c->mb.i8x8_mode_costs,
x->fc.i8x8_mode_prob, vp8_i8x8_mode_tree);
{
int i;
for (i = 0; i <= VP8_SWITCHABLE_FILTERS; ++i)
vp9_cost_tokens((int *)c->mb.switchable_interp_costs[i],
x->fc.switchable_interp_prob[i],
vp8_switchable_interp_tree);
}
for (i = 0; i <= VP8_SWITCHABLE_FILTERS; ++i)
vp9_cost_tokens((int *)c->mb.switchable_interp_costs[i],
x->fc.switchable_interp_prob[i],
vp8_switchable_interp_tree);
}
......@@ -60,20 +60,34 @@
#define RTCD(x) NULL
#endif
extern void vp9cx_pick_filter_level_fast(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi);
extern void vp9cx_set_alt_lf_level(VP8_COMP *cpi, int filt_val);
extern void vp9cx_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi);
extern void vp9_pick_filter_level_fast(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi);
extern void vp9_set_alt_lf_level(VP8_COMP *cpi, int filt_val);
extern void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi);
extern void vp9_cmachine_specific_config(VP8_COMP *cpi);
extern void vp8_deblock_frame(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *post, int filt_lvl, int low_var_thresh, int flag);
extern void vp8_deblock_frame(YV12_BUFFER_CONFIG *source,
YV12_BUFFER_CONFIG *post,
int filt_lvl, int low_var_thresh, int flag);
extern void print_parms(VP8_CONFIG *ocf, char *filenam);
extern unsigned int vp8_get_processor_freq();
extern void print_tree_update_probs();
extern void vp8cx_create_encoder_threads(VP8_COMP *cpi);
extern void vp8cx_remove_encoder_threads(VP8_COMP *cpi);
#if HAVE_ARMV7
extern void vp8_yv12_copy_frame_func_neon(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc);
extern void vp8_yv12_copy_src_frame_func_neon(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc);
extern void vp8_yv12_copy_frame_func_neon(YV12_BUFFER_CONFIG *src_ybc,
YV12_BUFFER_CONFIG *dst_ybc);
extern void vp8_yv12_copy_src_frame_func_neon(YV12_BUFFER_CONFIG *src_ybc,
YV12_BUFFER_CONFIG *dst_ybc);
#endif
int vp9_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest);
......@@ -166,7 +180,7 @@ extern unsigned int inter_uv_modes[VP8_UV_MODES];
extern unsigned int inter_b_modes[B_MODE_COUNT];
#endif
extern void vp9cx_init_quantizer(VP8_COMP *cpi);
extern void vp9_init_quantizer(VP8_COMP *cpi);
int vp8cx_base_skip_false_prob[QINDEX_RANGE][3];
......@@ -306,7 +320,7 @@ static void update_base_skip_probs(VP8_COMP *cpi) {
}
void vp9_initialize() {
void vp9_initialize_enc() {
static int init_done = 0;
if (!init_done) {
......@@ -1172,9 +1186,11 @@ void vp9_set_speed_features(VP8_COMP *cpi) {
}
if (cpi->sf.search_method == NSTEP) {
vp9_init3smotion_compensation(&cpi->mb, cm->yv12_fb[cm->lst_fb_idx].y_stride);
vp9_init3smotion_compensation(&cpi->mb,
cm->yv12_fb[cm->lst_fb_idx].y_stride);
} else if (cpi->sf.search_method == DIAMOND) {
vp9_init_dsmotion_compensation(&cpi->mb, cm->yv12_fb[cm->lst_fb_idx].y_stride);
vp9_init_dsmotion_compensation(&cpi->mb,
cm->yv12_fb[cm->lst_fb_idx].y_stride);
}
cpi->mb.vp9_short_fdct16x16 = vp9_short_fdct16x16;
......@@ -1202,7 +1218,7 @@ void vp9_set_speed_features(VP8_COMP *cpi) {
cpi->mb.quantize_b_16x16 = vp9_regular_quantize_b_16x16;
cpi->mb.quantize_b_2x2 = vp9_regular_quantize_b_2x2;
vp9cx_init_quantizer(cpi);
vp9_init_quantizer(cpi);
#if CONFIG_RUNTIME_CPU_DETECT
cpi->mb.e_mbd.rtcd = &cpi->common.rtcd;
......@@ -1997,9 +2013,12 @@ VP8_PTR vp9_create_compressor(VP8_CONFIG *oxcf) {
// make sure frame 1 is okay
cpi->error_bins[0] = cpi->common.MBs;
// vp9cx_init_quantizer() is first called here. Add check in vp9cx_frame_init_quantizer() so that vp9cx_init_quantizer is only called later
// when needed. This will avoid unnecessary calls of vp9cx_init_quantizer() for every frame.
vp9cx_init_quantizer(cpi);
/* vp9_init_quantizer() is first called here. Add check in
* vp9_frame_init_quantizer() so that vp9_init_quantizer is only
* called later when needed. This will avoid unnecessary calls of
* vp9_init_quantizer() for every frame.
*/
vp9_init_quantizer(cpi);
vp8_loop_filter_init(cm);
......@@ -2386,7 +2405,8 @@ int vp9_update_reference(VP8_PTR ptr, int ref_frame_flags) {
return 0;
}
int vp9_get_reference(VP8_PTR ptr, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd) {
int vp9_get_reference_enc(VP8_PTR ptr, VP8_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) {
VP8_COMP *cpi = (VP8_COMP *)(ptr);
VP8_COMMON *cm = &cpi->common;
int ref_fb_idx;
......@@ -2404,7 +2424,9 @@ int vp9_get_reference(VP8_PTR ptr, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONF
return 0;
}
int vp9_set_reference(VP8_PTR ptr, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd) {
int vp9_set_reference_enc(VP8_PTR ptr, VP8_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) {
VP8_COMP *cpi = (VP8_COMP *)(ptr);
VP8_COMMON *cm = &cpi->common;
......@@ -2786,17 +2808,16 @@ static void loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm) {
vpx_usec_timer_start(&timer);
if (cpi->sf.auto_filter == 0)
vp9cx_pick_filter_level_fast(cpi->Source, cpi);
vp9_pick_filter_level_fast(cpi->Source, cpi);
else
vp9cx_pick_filter_level(cpi->Source, cpi);
vp9_pick_filter_level(cpi->Source, cpi);
vpx_usec_timer_mark(&timer);
cpi->time_pick_lpf += vpx_usec_timer_elapsed(&timer);
}
if (cm->filter_level > 0) {
vp9cx_set_alt_lf_level(cpi, cm->filter_level);
vp9_set_alt_lf_level(cpi, cm->filter_level);
vp8_loop_filter_frame(cm, &cpi->mb.e_mbd);
}
......@@ -3110,7 +3131,8 @@ static void encode_frame_to_data_rate
else
zbin_oq_high = ZBIN_OQ_MAX;
vp9_compute_frame_size_bounds(cpi, &frame_under_shoot_limit, &frame_over_shoot_limit);
vp9_compute_frame_size_bounds(cpi, &frame_under_shoot_limit,
&frame_over_shoot_limit);
// Limit Q range for the adaptive loop.
bottom_index = cpi->active_best_quality;
......@@ -3926,7 +3948,8 @@ static void encode_frame_to_data_rate
}
}
static void Pass2Encode(VP8_COMP *cpi, unsigned long *size, unsigned char *dest, unsigned int *frame_flags) {
static void Pass2Encode(VP8_COMP *cpi, unsigned long *size,
unsigned char *dest, unsigned int *frame_flags) {
if (!cpi->common.refresh_alt_ref_frame)
vp9_second_pass(cpi);
......@@ -3953,7 +3976,9 @@ extern void vp8_pop_neon(int64_t *store);
#endif
int vp9_receive_raw_frame(VP8_PTR ptr, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time) {
int vp9_receive_raw_frame(VP8_PTR ptr, unsigned int frame_flags,
YV12_BUFFER_CONFIG *sd, int64_t time_stamp,
int64_t end_time) {
#if HAVE_ARMV7
int64_t store_reg[8];
#endif
......@@ -3972,8 +3997,8 @@ int vp9_receive_raw_frame(VP8_PTR ptr, unsigned int frame_flags, YV12_BUFFER_CON
#endif
vpx_usec_timer_start(&timer);
if (vp9_lookahead_push(cpi->lookahead, sd, time_stamp, end_time,
frame_flags, cpi->active_map_enabled ? cpi->active_map : NULL))
if (vp9_lookahead_push(cpi->lookahead, sd, time_stamp, end_time, frame_flags,
cpi->active_map_enabled ? cpi->active_map : NULL))
res = -1;
cm->clr_type = sd->clrtype;
vpx_usec_timer_mark(&timer);
......@@ -4005,7 +4030,9 @@ static int frame_is_reference(const VP8_COMP *cpi) {