From: Yaowu Xu Date: Thu, 13 Aug 2015 16:42:27 +0000 (-0700) Subject: VP9_COMP -> VP10_COMP X-Git-Tag: v1.5.0~267^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26a9afc32c5b8fcad8fe3674b34f7c4d12692030;p=libvpx VP9_COMP -> VP10_COMP Change-Id: I83b5c69621f9f28b742e5b13517d4e5b99c6cd26 --- diff --git a/vp10/encoder/aq_complexity.c b/vp10/encoder/aq_complexity.c index 624aae4e5..195732a38 100644 --- a/vp10/encoder/aq_complexity.c +++ b/vp10/encoder/aq_complexity.c @@ -43,7 +43,7 @@ static int get_aq_c_strength(int q_index, vpx_bit_depth_t bit_depth) { return (base_quant > 10) + (base_quant > 25); } -void vp10_setup_in_frame_q_adj(VP9_COMP *cpi) { +void vp10_setup_in_frame_q_adj(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; struct segmentation *const seg = &cm->seg; @@ -110,7 +110,7 @@ void vp10_setup_in_frame_q_adj(VP9_COMP *cpi) { // Select a segment for the current block. // The choice of segment for a block depends on the ratio of the projected // bits for the block vs a target average and its spatial complexity. -void vp10_caq_select_segment(VP9_COMP *cpi, MACROBLOCK *mb, BLOCK_SIZE bs, +void vp10_caq_select_segment(VP10_COMP *cpi, MACROBLOCK *mb, BLOCK_SIZE bs, int mi_row, int mi_col, int projected_rate) { VP10_COMMON *const cm = &cpi->common; diff --git a/vp10/encoder/aq_complexity.h b/vp10/encoder/aq_complexity.h index 51629a48a..f9de2ada3 100644 --- a/vp10/encoder/aq_complexity.h +++ b/vp10/encoder/aq_complexity.h @@ -18,17 +18,17 @@ extern "C" { #include "vp10/common/enums.h" -struct VP9_COMP; +struct VP10_COMP; struct macroblock; // Select a segment for the current Block. -void vp10_caq_select_segment(struct VP9_COMP *cpi, struct macroblock *, +void vp10_caq_select_segment(struct VP10_COMP *cpi, struct macroblock *, BLOCK_SIZE bs, int mi_row, int mi_col, int projected_rate); // This function sets up a set of segments with delta Q values around // the baseline frame quantizer. -void vp10_setup_in_frame_q_adj(struct VP9_COMP *cpi); +void vp10_setup_in_frame_q_adj(struct VP10_COMP *cpi); #ifdef __cplusplus } // extern "C" diff --git a/vp10/encoder/aq_cyclicrefresh.c b/vp10/encoder/aq_cyclicrefresh.c index 8a1a52681..3d6e38bc0 100644 --- a/vp10/encoder/aq_cyclicrefresh.c +++ b/vp10/encoder/aq_cyclicrefresh.c @@ -137,7 +137,7 @@ static int candidate_refresh_aq(const CYCLIC_REFRESH *cr, } // Compute delta-q for the segment. -static int compute_deltaq(const VP9_COMP *cpi, int q, double rate_factor) { +static int compute_deltaq(const VP10_COMP *cpi, int q, double rate_factor) { const CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; const RATE_CONTROL *const rc = &cpi->rc; int deltaq = vp10_compute_qdelta_by_rate(rc, cpi->common.frame_type, @@ -153,7 +153,7 @@ static int compute_deltaq(const VP9_COMP *cpi, int q, double rate_factor) { // from non-base segment. For now ignore effect of multiple segments // (with different delta-q). Note this function is called in the postencode // (called from rc_update_rate_correction_factors()). -int vp10_cyclic_refresh_estimate_bits_at_q(const VP9_COMP *cpi, +int vp10_cyclic_refresh_estimate_bits_at_q(const VP10_COMP *cpi, double correction_factor) { const VP10_COMMON *const cm = &cpi->common; const CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; @@ -184,7 +184,7 @@ int vp10_cyclic_refresh_estimate_bits_at_q(const VP9_COMP *cpi, // rc_regulate_q() to set the base qp index. // Note: the segment map is set to either 0/CR_SEGMENT_ID_BASE (no refresh) or // to 1/CR_SEGMENT_ID_BOOST1 (refresh) for each superblock, prior to encoding. -int vp10_cyclic_refresh_rc_bits_per_mb(const VP9_COMP *cpi, int i, +int vp10_cyclic_refresh_rc_bits_per_mb(const VP10_COMP *cpi, int i, double correction_factor) { const VP10_COMMON *const cm = &cpi->common; CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; @@ -209,7 +209,7 @@ int vp10_cyclic_refresh_rc_bits_per_mb(const VP9_COMP *cpi, int i, // Prior to coding a given prediction block, of size bsize at (mi_row, mi_col), // check if we should reset the segment_id, and update the cyclic_refresh map // and segmentation map. -void vp10_cyclic_refresh_update_segment(VP9_COMP *const cpi, +void vp10_cyclic_refresh_update_segment(VP10_COMP *const cpi, MB_MODE_INFO *const mbmi, int mi_row, int mi_col, BLOCK_SIZE bsize, @@ -273,7 +273,7 @@ void vp10_cyclic_refresh_update_segment(VP9_COMP *const cpi, } // Update the actual number of blocks that were applied the segment delta q. -void vp10_cyclic_refresh_postencode(VP9_COMP *const cpi) { +void vp10_cyclic_refresh_postencode(VP10_COMP *const cpi) { VP10_COMMON *const cm = &cpi->common; CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; unsigned char *const seg_map = cpi->segmentation_map; @@ -292,7 +292,7 @@ void vp10_cyclic_refresh_postencode(VP9_COMP *const cpi) { } // Set golden frame update interval, for non-svc 1 pass CBR mode. -void vp10_cyclic_refresh_set_golden_update(VP9_COMP *const cpi) { +void vp10_cyclic_refresh_set_golden_update(VP10_COMP *const cpi) { RATE_CONTROL *const rc = &cpi->rc; CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; // Set minimum gf_interval for GF update to a multiple (== 2) of refresh @@ -308,7 +308,7 @@ void vp10_cyclic_refresh_set_golden_update(VP9_COMP *const cpi) { // background has high motion, refresh the golden frame. Otherwise, if the // golden reference is to be updated check if we should NOT update the golden // ref. -void vp10_cyclic_refresh_check_golden_update(VP9_COMP *const cpi) { +void vp10_cyclic_refresh_check_golden_update(VP10_COMP *const cpi) { VP10_COMMON *const cm = &cpi->common; CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; int mi_row, mi_col; @@ -380,7 +380,7 @@ void vp10_cyclic_refresh_check_golden_update(VP9_COMP *const cpi) { // 1/CR_SEGMENT_ID_BOOST1 (refresh) for each superblock. // Blocks labeled as BOOST1 may later get set to BOOST2 (during the // encoding of the superblock). -static void cyclic_refresh_update_map(VP9_COMP *const cpi) { +static void cyclic_refresh_update_map(VP10_COMP *const cpi) { VP10_COMMON *const cm = &cpi->common; CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; unsigned char *const seg_map = cpi->segmentation_map; @@ -449,7 +449,7 @@ static void cyclic_refresh_update_map(VP9_COMP *const cpi) { } // Set cyclic refresh parameters. -void vp10_cyclic_refresh_update_parameters(VP9_COMP *const cpi) { +void vp10_cyclic_refresh_update_parameters(VP10_COMP *const cpi) { const RATE_CONTROL *const rc = &cpi->rc; const VP10_COMMON *const cm = &cpi->common; CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; @@ -475,7 +475,7 @@ void vp10_cyclic_refresh_update_parameters(VP9_COMP *const cpi) { } // Setup cyclic background refresh: set delta q and segmentation map. -void vp10_cyclic_refresh_setup(VP9_COMP *const cpi) { +void vp10_cyclic_refresh_setup(VP10_COMP *const cpi) { VP10_COMMON *const cm = &cpi->common; const RATE_CONTROL *const rc = &cpi->rc; CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; @@ -559,7 +559,7 @@ int vp10_cyclic_refresh_get_rdmult(const CYCLIC_REFRESH *cr) { return cr->rdmult; } -void vp10_cyclic_refresh_reset_resize(VP9_COMP *const cpi) { +void vp10_cyclic_refresh_reset_resize(VP10_COMP *const cpi) { const VP10_COMMON *const cm = &cpi->common; CYCLIC_REFRESH *const cr = cpi->cyclic_refresh; memset(cr->map, 0, cm->mi_rows * cm->mi_cols); diff --git a/vp10/encoder/aq_cyclicrefresh.h b/vp10/encoder/aq_cyclicrefresh.h index 6316a98e6..b672c52c5 100644 --- a/vp10/encoder/aq_cyclicrefresh.h +++ b/vp10/encoder/aq_cyclicrefresh.h @@ -27,7 +27,7 @@ extern "C" { // Maximum rate target ratio for setting segment delta-qp. #define CR_MAX_RATE_TARGET_RATIO 4.0 -struct VP9_COMP; +struct VP10_COMP; struct CYCLIC_REFRESH; typedef struct CYCLIC_REFRESH CYCLIC_REFRESH; @@ -38,44 +38,44 @@ void vp10_cyclic_refresh_free(CYCLIC_REFRESH *cr); // Estimate the bits, incorporating the delta-q from segment 1, after encoding // the frame. -int vp10_cyclic_refresh_estimate_bits_at_q(const struct VP9_COMP *cpi, +int vp10_cyclic_refresh_estimate_bits_at_q(const struct VP10_COMP *cpi, double correction_factor); // Estimate the bits per mb, for a given q = i and a corresponding delta-q // (for segment 1), prior to encoding the frame. -int vp10_cyclic_refresh_rc_bits_per_mb(const struct VP9_COMP *cpi, int i, +int vp10_cyclic_refresh_rc_bits_per_mb(const struct VP10_COMP *cpi, int i, double correction_factor); // Prior to coding a given prediction block, of size bsize at (mi_row, mi_col), // check if we should reset the segment_id, and update the cyclic_refresh map // and segmentation map. -void vp10_cyclic_refresh_update_segment(struct VP9_COMP *const cpi, +void vp10_cyclic_refresh_update_segment(struct VP10_COMP *const cpi, MB_MODE_INFO *const mbmi, int mi_row, int mi_col, BLOCK_SIZE bsize, int64_t rate, int64_t dist, int skip); // Update the segmentation map, and related quantities: cyclic refresh map, // refresh sb_index, and target number of blocks to be refreshed. -void vp10_cyclic_refresh_update__map(struct VP9_COMP *const cpi); +void vp10_cyclic_refresh_update__map(struct VP10_COMP *const cpi); // Update the actual number of blocks that were applied the segment delta q. -void vp10_cyclic_refresh_postencode(struct VP9_COMP *const cpi); +void vp10_cyclic_refresh_postencode(struct VP10_COMP *const cpi); // Set golden frame update interval, for non-svc 1 pass CBR mode. -void vp10_cyclic_refresh_set_golden_update(struct VP9_COMP *const cpi); +void vp10_cyclic_refresh_set_golden_update(struct VP10_COMP *const cpi); // Check if we should not update golden reference, based on past refresh stats. -void vp10_cyclic_refresh_check_golden_update(struct VP9_COMP *const cpi); +void vp10_cyclic_refresh_check_golden_update(struct VP10_COMP *const cpi); // Set/update global/frame level refresh parameters. -void vp10_cyclic_refresh_update_parameters(struct VP9_COMP *const cpi); +void vp10_cyclic_refresh_update_parameters(struct VP10_COMP *const cpi); // Setup cyclic background refresh: set delta q and segmentation map. -void vp10_cyclic_refresh_setup(struct VP9_COMP *const cpi); +void vp10_cyclic_refresh_setup(struct VP10_COMP *const cpi); int vp10_cyclic_refresh_get_rdmult(const CYCLIC_REFRESH *cr); -void vp10_cyclic_refresh_reset_resize(struct VP9_COMP *const cpi); +void vp10_cyclic_refresh_reset_resize(struct VP10_COMP *const cpi); static INLINE int cyclic_refresh_segment_id_boosted(int segment_id) { return segment_id == CR_SEGMENT_ID_BOOST1 || diff --git a/vp10/encoder/aq_variance.c b/vp10/encoder/aq_variance.c index 6e5b42707..e8e88c3b6 100644 --- a/vp10/encoder/aq_variance.c +++ b/vp10/encoder/aq_variance.c @@ -42,7 +42,7 @@ unsigned int vp10_vaq_segment_id(int energy) { return SEGMENT_ID(energy); } -void vp10_vaq_frame_setup(VP9_COMP *cpi) { +void vp10_vaq_frame_setup(VP10_COMP *cpi) { VP10_COMMON *cm = &cpi->common; struct segmentation *seg = &cm->seg; int i; @@ -137,7 +137,7 @@ static void aq_highbd_8_variance(const uint8_t *a8, int a_stride, } #endif // CONFIG_VP9_HIGHBITDEPTH -static unsigned int block_variance(VP9_COMP *cpi, MACROBLOCK *x, +static unsigned int block_variance(VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs) { MACROBLOCKD *xd = &x->e_mbd; unsigned int var, sse; @@ -188,14 +188,14 @@ static unsigned int block_variance(VP9_COMP *cpi, MACROBLOCK *x, } } -double vp10_log_block_var(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs) { +double vp10_log_block_var(VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs) { unsigned int var = block_variance(cpi, x, bs); vpx_clear_system_state(); return log(var + 1.0); } #define DEFAULT_E_MIDPOINT 10.0 -int vp10_block_energy(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs) { +int vp10_block_energy(VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs) { double energy; double energy_midpoint; vpx_clear_system_state(); diff --git a/vp10/encoder/aq_variance.h b/vp10/encoder/aq_variance.h index bfb42ecca..318f5f27f 100644 --- a/vp10/encoder/aq_variance.h +++ b/vp10/encoder/aq_variance.h @@ -19,10 +19,10 @@ extern "C" { #endif unsigned int vp10_vaq_segment_id(int energy); -void vp10_vaq_frame_setup(VP9_COMP *cpi); +void vp10_vaq_frame_setup(VP10_COMP *cpi); -int vp10_block_energy(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs); -double vp10_log_block_var(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs); +int vp10_block_energy(VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs); +double vp10_log_block_var(VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs); #ifdef __cplusplus } // extern "C" diff --git a/vp10/encoder/bitstream.c b/vp10/encoder/bitstream.c index 51ae05c44..e530db761 100644 --- a/vp10/encoder/bitstream.c +++ b/vp10/encoder/bitstream.c @@ -234,7 +234,7 @@ static void write_ref_frames(const VP10_COMMON *cm, const MACROBLOCKD *xd, } } -static void pack_inter_mode_mvs(VP9_COMP *cpi, const MODE_INFO *mi, +static void pack_inter_mode_mvs(VP10_COMP *cpi, const MODE_INFO *mi, vpx_writer *w) { VP10_COMMON *const cm = &cpi->common; const nmv_context *nmvc = &cm->fc->nmvc; @@ -374,7 +374,7 @@ static void write_mb_modes_kf(const VP10_COMMON *cm, const MACROBLOCKD *xd, write_intra_mode(w, mbmi->uv_mode, vp10_kf_uv_mode_prob[mbmi->mode]); } -static void write_modes_b(VP9_COMP *cpi, const TileInfo *const tile, +static void write_modes_b(VP10_COMP *cpi, const TileInfo *const tile, vpx_writer *w, TOKENEXTRA **tok, const TOKENEXTRA *const tok_end, int mi_row, int mi_col) { @@ -424,7 +424,7 @@ static void write_partition(const VP10_COMMON *const cm, } } -static void write_modes_sb(VP9_COMP *cpi, +static void write_modes_sb(VP10_COMP *cpi, const TileInfo *const tile, vpx_writer *w, TOKENEXTRA **tok, const TOKENEXTRA *const tok_end, int mi_row, int mi_col, BLOCK_SIZE bsize) { @@ -482,7 +482,7 @@ static void write_modes_sb(VP9_COMP *cpi, update_partition_context(xd, mi_row, mi_col, subsize, bsize); } -static void write_modes(VP9_COMP *cpi, +static void write_modes(VP10_COMP *cpi, const TileInfo *const tile, vpx_writer *w, TOKENEXTRA **tok, const TOKENEXTRA *const tok_end) { const VP10_COMMON *const cm = &cpi->common; @@ -501,7 +501,7 @@ static void write_modes(VP9_COMP *cpi, } } -static void build_tree_distribution(VP9_COMP *cpi, TX_SIZE tx_size, +static void build_tree_distribution(VP10_COMP *cpi, TX_SIZE tx_size, vp10_coeff_stats *coef_branch_ct, vp10_coeff_probs_model *coef_probs) { vp10_coeff_count *coef_counts = cpi->td.rd_counts.coef_counts[tx_size]; @@ -528,7 +528,7 @@ static void build_tree_distribution(VP9_COMP *cpi, TX_SIZE tx_size, } } -static void update_coef_probs_common(vpx_writer* const bc, VP9_COMP *cpi, +static void update_coef_probs_common(vpx_writer* const bc, VP10_COMP *cpi, TX_SIZE tx_size, vp10_coeff_stats *frame_branch_ct, vp10_coeff_probs_model *new_coef_probs) { @@ -673,7 +673,7 @@ static void update_coef_probs_common(vpx_writer* const bc, VP9_COMP *cpi, } } -static void update_coef_probs(VP9_COMP *cpi, vpx_writer* w) { +static void update_coef_probs(VP10_COMP *cpi, vpx_writer* w) { const TX_MODE tx_mode = cpi->common.tx_mode; const TX_SIZE max_tx_size = tx_mode_to_biggest_tx_size[tx_mode]; TX_SIZE tx_size; @@ -900,7 +900,7 @@ static void write_tile_info(const VP10_COMMON *const cm, vpx_wb_write_bit(wb, cm->log2_tile_rows != 1); } -static int get_refresh_mask(VP9_COMP *cpi) { +static int get_refresh_mask(VP10_COMP *cpi) { if (vp10_preserve_existing_gf(cpi)) { // We have decided to preserve the previously existing golden frame as our // new ARF frame. However, in the short term we leave it in the GF slot and, @@ -926,7 +926,7 @@ static int get_refresh_mask(VP9_COMP *cpi) { } } -static size_t encode_tiles(VP9_COMP *cpi, uint8_t *data_ptr) { +static size_t encode_tiles(VP10_COMP *cpi, uint8_t *data_ptr) { VP10_COMMON *const cm = &cpi->common; vpx_writer residual_bc; int tile_row, tile_col; @@ -987,7 +987,7 @@ static void write_frame_size(const VP10_COMMON *cm, write_display_size(cm, wb); } -static void write_frame_size_with_refs(VP9_COMP *cpi, +static void write_frame_size_with_refs(VP10_COMP *cpi, struct vpx_write_bit_buffer *wb) { VP10_COMMON *const cm = &cpi->common; int found = 0; @@ -1074,7 +1074,7 @@ static void write_bitdepth_colorspace_sampling( } } -static void write_uncompressed_header(VP9_COMP *cpi, +static void write_uncompressed_header(VP10_COMP *cpi, struct vpx_write_bit_buffer *wb) { VP10_COMMON *const cm = &cpi->common; MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; @@ -1150,7 +1150,7 @@ static void write_uncompressed_header(VP9_COMP *cpi, write_tile_info(cm, wb); } -static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) { +static size_t write_compressed_header(VP10_COMP *cpi, uint8_t *data) { VP10_COMMON *const cm = &cpi->common; MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; FRAME_CONTEXT *const fc = cm->fc; @@ -1227,7 +1227,7 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) { return header_bc.pos; } -void vp10_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, size_t *size) { +void vp10_pack_bitstream(VP10_COMP *cpi, uint8_t *dest, size_t *size) { uint8_t *data = dest; size_t first_part_size, uncompressed_hdr_size; struct vpx_write_bit_buffer wb = {data, 0}; diff --git a/vp10/encoder/bitstream.h b/vp10/encoder/bitstream.h index 1fb55f369..d4b413d0d 100644 --- a/vp10/encoder/bitstream.h +++ b/vp10/encoder/bitstream.h @@ -18,9 +18,9 @@ extern "C" { #include "vp10/encoder/encoder.h" -void vp10_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, size_t *size); +void vp10_pack_bitstream(VP10_COMP *cpi, uint8_t *dest, size_t *size); -static INLINE int vp10_preserve_existing_gf(VP9_COMP *cpi) { +static INLINE int vp10_preserve_existing_gf(VP10_COMP *cpi) { return !cpi->multi_arf_allowed && cpi->refresh_golden_frame && cpi->rc.is_src_frame_alt_ref && (!cpi->use_svc || // Add spatial svc base layer case here diff --git a/vp10/encoder/context_tree.h b/vp10/encoder/context_tree.h index b58348bb0..7e88e6323 100644 --- a/vp10/encoder/context_tree.h +++ b/vp10/encoder/context_tree.h @@ -14,7 +14,7 @@ #include "vp10/common/blockd.h" #include "vp10/encoder/block.h" -struct VP9_COMP; +struct VP10_COMP; struct VP9Common; struct ThreadData; diff --git a/vp10/encoder/encodeframe.c b/vp10/encoder/encodeframe.c index f1bd6749a..027772304 100644 --- a/vp10/encoder/encodeframe.c +++ b/vp10/encoder/encodeframe.c @@ -46,7 +46,7 @@ #include "vp10/encoder/segmentation.h" #include "vp10/encoder/tokenize.h" -static void encode_superblock(VP9_COMP *cpi, ThreadData * td, +static void encode_superblock(VP10_COMP *cpi, ThreadData * td, TOKENEXTRA **t, int output_enabled, int mi_row, int mi_col, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx); @@ -101,7 +101,7 @@ static const uint16_t VP9_HIGH_VAR_OFFS_12[64] = { }; #endif // CONFIG_VP9_HIGHBITDEPTH -unsigned int vp10_get_sby_perpixel_variance(VP9_COMP *cpi, +unsigned int vp10_get_sby_perpixel_variance(VP10_COMP *cpi, const struct buf_2d *ref, BLOCK_SIZE bs) { unsigned int sse; @@ -112,7 +112,7 @@ unsigned int vp10_get_sby_perpixel_variance(VP9_COMP *cpi, #if CONFIG_VP9_HIGHBITDEPTH unsigned int vp10_high_get_sby_perpixel_variance( - VP9_COMP *cpi, const struct buf_2d *ref, BLOCK_SIZE bs, int bd) { + VP10_COMP *cpi, const struct buf_2d *ref, BLOCK_SIZE bs, int bd) { unsigned int var, sse; switch (bd) { case 10: @@ -136,7 +136,7 @@ unsigned int vp10_high_get_sby_perpixel_variance( } #endif // CONFIG_VP9_HIGHBITDEPTH -static unsigned int get_sby_perpixel_diff_variance(VP9_COMP *cpi, +static unsigned int get_sby_perpixel_diff_variance(VP10_COMP *cpi, const struct buf_2d *ref, int mi_row, int mi_col, BLOCK_SIZE bs) { @@ -151,7 +151,8 @@ static unsigned int get_sby_perpixel_diff_variance(VP9_COMP *cpi, return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]); } -static BLOCK_SIZE get_rd_var_based_fixed_partition(VP9_COMP *cpi, MACROBLOCK *x, +static BLOCK_SIZE get_rd_var_based_fixed_partition(VP10_COMP *cpi, + MACROBLOCK *x, int mi_row, int mi_col) { unsigned int var = get_sby_perpixel_diff_variance(cpi, &x->plane[0].src, @@ -180,7 +181,7 @@ static INLINE void set_mode_info_offsets(VP10_COMMON *const cm, x->mbmi_ext = x->mbmi_ext_base + (mi_row * cm->mi_cols + mi_col); } -static void set_offsets(VP9_COMP *cpi, const TileInfo *const tile, +static void set_offsets(VP10_COMP *cpi, const TileInfo *const tile, MACROBLOCK *const x, int mi_row, int mi_col, BLOCK_SIZE bsize) { VP10_COMMON *const cm = &cpi->common; @@ -250,7 +251,7 @@ static void duplicate_mode_info_in_sb(VP10_COMMON *cm, MACROBLOCKD *xd, } } -static void set_block_size(VP9_COMP * const cpi, +static void set_block_size(VP10_COMP * const cpi, MACROBLOCK *const x, MACROBLOCKD *const xd, int mi_row, int mi_col, @@ -386,7 +387,7 @@ static void fill_variance_tree(void *data, BLOCK_SIZE bsize) { &node.part_variances->none); } -static int set_vt_partitioning(VP9_COMP *cpi, +static int set_vt_partitioning(VP10_COMP *cpi, MACROBLOCK *const x, MACROBLOCKD *const xd, void *data, @@ -476,7 +477,7 @@ static int set_vt_partitioning(VP9_COMP *cpi, // 0 - threshold_64x64, 1 - threshold_32x32, 2 - threshold_16x16, // 3 - vbp_threshold_8x8. vbp_threshold_8x8 (to split to 4x4 partition) is // currently only used on key frame. -static void set_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q) { +static void set_vbp_thresholds(VP10_COMP *cpi, int64_t thresholds[], int q) { VP10_COMMON *const cm = &cpi->common; const int is_key_frame = (cm->frame_type == KEY_FRAME); const int threshold_multiplier = is_key_frame ? 20 : 1; @@ -502,7 +503,7 @@ static void set_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q) { } } -void vp10_set_variance_partition_thresholds(VP9_COMP *cpi, int q) { +void vp10_set_variance_partition_thresholds(VP10_COMP *cpi, int q) { VP10_COMMON *const cm = &cpi->common; SPEED_FEATURES *const sf = &cpi->sf; const int is_key_frame = (cm->frame_type == KEY_FRAME); @@ -649,7 +650,7 @@ static void fill_variance_8x8avg(const uint8_t *s, int sp, const uint8_t *d, // This function chooses partitioning based on the variance between source and // reconstructed last, where variance is computed for down-sampled inputs. -static int choose_partitioning(VP9_COMP *cpi, +static int choose_partitioning(VP10_COMP *cpi, const TileInfo *const tile, MACROBLOCK *x, int mi_row, int mi_col) { @@ -961,7 +962,7 @@ static int choose_partitioning(VP9_COMP *cpi, return 0; } -static void update_state(VP9_COMP *cpi, ThreadData *td, +static void update_state(VP10_COMP *cpi, ThreadData *td, PICK_MODE_CONTEXT *ctx, int mi_row, int mi_col, BLOCK_SIZE bsize, int output_enabled) { @@ -1146,7 +1147,7 @@ static void set_mode_info_seg_skip(MACROBLOCK *x, TX_MODE tx_mode, vp10_rd_cost_init(rd_cost); } -static int set_segment_rdmult(VP9_COMP *const cpi, +static int set_segment_rdmult(VP10_COMP *const cpi, MACROBLOCK *const x, int8_t segment_id) { int segment_qindex; @@ -1158,7 +1159,7 @@ static int set_segment_rdmult(VP9_COMP *const cpi, return vp10_compute_rd_mult(cpi, segment_qindex + cm->y_dc_delta_q); } -static void rd_pick_sb_modes(VP9_COMP *cpi, +static void rd_pick_sb_modes(VP10_COMP *cpi, TileDataEnc *tile_data, MACROBLOCK *const x, int mi_row, int mi_col, RD_COST *rd_cost, @@ -1396,7 +1397,7 @@ static void save_context(MACROBLOCK *const x, int mi_row, int mi_col, sizeof(xd->left_seg_context[0]) * mi_height); } -static void encode_b(VP9_COMP *cpi, const TileInfo *const tile, +static void encode_b(VP10_COMP *cpi, const TileInfo *const tile, ThreadData *td, TOKENEXTRA **tp, int mi_row, int mi_col, int output_enabled, BLOCK_SIZE bsize, @@ -1414,7 +1415,7 @@ static void encode_b(VP9_COMP *cpi, const TileInfo *const tile, } } -static void encode_sb(VP9_COMP *cpi, ThreadData *td, +static void encode_sb(VP10_COMP *cpi, ThreadData *td, const TileInfo *const tile, TOKENEXTRA **tp, int mi_row, int mi_col, int output_enabled, BLOCK_SIZE bsize, @@ -1529,7 +1530,7 @@ static void set_partial_b64x64_partition(MODE_INFO *mi, int mis, // However, at the bottom and right borders of the image the requested size // may not be allowed in which case this code attempts to choose the largest // allowable partition. -static void set_fixed_partitioning(VP9_COMP *cpi, const TileInfo *const tile, +static void set_fixed_partitioning(VP10_COMP *cpi, const TileInfo *const tile, MODE_INFO **mi_8x8, int mi_row, int mi_col, BLOCK_SIZE bsize) { VP10_COMMON *const cm = &cpi->common; @@ -1574,7 +1575,7 @@ static const struct { {4, 4}, {4, 6}, {6, 4}, {6, 6}, }; -static void set_source_var_based_partition(VP9_COMP *cpi, +static void set_source_var_based_partition(VP10_COMP *cpi, const TileInfo *const tile, MACROBLOCK *const x, MODE_INFO **mi_8x8, @@ -1660,7 +1661,7 @@ static void set_source_var_based_partition(VP9_COMP *cpi, } } -static void update_state_rt(VP9_COMP *cpi, ThreadData *td, +static void update_state_rt(VP10_COMP *cpi, ThreadData *td, PICK_MODE_CONTEXT *ctx, int mi_row, int mi_col, int bsize) { VP10_COMMON *const cm = &cpi->common; @@ -1727,7 +1728,7 @@ static void update_state_rt(VP9_COMP *cpi, ThreadData *td, x->skip_txfm[0] = mbmi->segment_id ? 0 : ctx->skip_txfm[0]; } -static void encode_b_rt(VP9_COMP *cpi, ThreadData *td, +static void encode_b_rt(VP10_COMP *cpi, ThreadData *td, const TileInfo *const tile, TOKENEXTRA **tp, int mi_row, int mi_col, int output_enabled, BLOCK_SIZE bsize, @@ -1751,7 +1752,7 @@ static void encode_b_rt(VP9_COMP *cpi, ThreadData *td, (*tp)++; } -static void encode_sb_rt(VP9_COMP *cpi, ThreadData *td, +static void encode_sb_rt(VP10_COMP *cpi, ThreadData *td, const TileInfo *const tile, TOKENEXTRA **tp, int mi_row, int mi_col, int output_enabled, BLOCK_SIZE bsize, @@ -1823,7 +1824,7 @@ static void encode_sb_rt(VP9_COMP *cpi, ThreadData *td, update_partition_context(xd, mi_row, mi_col, subsize, bsize); } -static void rd_use_partition(VP9_COMP *cpi, +static void rd_use_partition(VP10_COMP *cpi, ThreadData *td, TileDataEnc *tile_data, MODE_INFO **mi_8x8, TOKENEXTRA **tp, @@ -2150,7 +2151,7 @@ static const BLOCK_SIZE next_square_size[BLOCK_SIZES] = { // Look at neighboring blocks and set a min and max partition size based on // what they chose. -static void rd_auto_partition_range(VP9_COMP *cpi, const TileInfo *const tile, +static void rd_auto_partition_range(VP10_COMP *cpi, const TileInfo *const tile, MACROBLOCKD *const xd, int mi_row, int mi_col, BLOCK_SIZE *min_block_size, @@ -2336,7 +2337,7 @@ static INLINE int get_motion_inconsistency(MOTION_DIRECTION this_mv, // TODO(jingning,jimbankoski,rbultje): properly skip partition types that are // unlikely to be selected depending on previous rate-distortion optimization // results, for encoding speed-up. -static void rd_pick_partition(VP9_COMP *cpi, ThreadData *td, +static void rd_pick_partition(VP10_COMP *cpi, ThreadData *td, TileDataEnc *tile_data, TOKENEXTRA **tp, int mi_row, int mi_col, BLOCK_SIZE bsize, RD_COST *rd_cost, @@ -2749,7 +2750,7 @@ static void rd_pick_partition(VP9_COMP *cpi, ThreadData *td, } } -static void encode_rd_sb_row(VP9_COMP *cpi, +static void encode_rd_sb_row(VP10_COMP *cpi, ThreadData *td, TileDataEnc *tile_data, int mi_row, @@ -2834,7 +2835,7 @@ static void encode_rd_sb_row(VP9_COMP *cpi, } } -static void init_encode_frame_mb_context(VP9_COMP *cpi) { +static void init_encode_frame_mb_context(VP10_COMP *cpi) { MACROBLOCK *const x = &cpi->td.mb; VP10_COMMON *const cm = &cpi->common; MACROBLOCKD *const xd = &x->e_mbd; @@ -2854,7 +2855,7 @@ static void init_encode_frame_mb_context(VP9_COMP *cpi) { sizeof(*xd->above_seg_context) * aligned_mi_cols); } -static int check_dual_ref_flags(VP9_COMP *cpi) { +static int check_dual_ref_flags(VP10_COMP *cpi) { const int ref_flags = cpi->ref_frame_flags; if (segfeature_active(&cpi->common.seg, 1, SEG_LVL_REF_FRAME)) { @@ -2878,7 +2879,7 @@ static void reset_skip_tx_size(VP10_COMMON *cm, TX_SIZE max_tx_size) { } } -static MV_REFERENCE_FRAME get_frame_type(const VP9_COMP *cpi) { +static MV_REFERENCE_FRAME get_frame_type(const VP10_COMP *cpi) { if (frame_is_intra_only(&cpi->common)) return INTRA_FRAME; else if (cpi->rc.is_src_frame_alt_ref && cpi->refresh_golden_frame) @@ -2889,7 +2890,7 @@ static MV_REFERENCE_FRAME get_frame_type(const VP9_COMP *cpi) { return LAST_FRAME; } -static TX_MODE select_tx_mode(const VP9_COMP *cpi, MACROBLOCKD *const xd) { +static TX_MODE select_tx_mode(const VP10_COMP *cpi, MACROBLOCKD *const xd) { if (xd->lossless) return ONLY_4X4; if (cpi->common.frame_type == KEY_FRAME && @@ -2904,7 +2905,7 @@ static TX_MODE select_tx_mode(const VP9_COMP *cpi, MACROBLOCKD *const xd) { return cpi->common.tx_mode; } -static void hybrid_intra_mode_search(VP9_COMP *cpi, MACROBLOCK *const x, +static void hybrid_intra_mode_search(VP10_COMP *cpi, MACROBLOCK *const x, RD_COST *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) { if (bsize < BLOCK_16X16) @@ -2913,7 +2914,7 @@ static void hybrid_intra_mode_search(VP9_COMP *cpi, MACROBLOCK *const x, vp10_pick_intra_mode(cpi, x, rd_cost, bsize, ctx); } -static void nonrd_pick_sb_modes(VP9_COMP *cpi, +static void nonrd_pick_sb_modes(VP10_COMP *cpi, TileDataEnc *tile_data, MACROBLOCK *const x, int mi_row, int mi_col, RD_COST *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) { @@ -3026,7 +3027,7 @@ static void pred_pixel_ready_reset(PC_TREE *pc_tree, BLOCK_SIZE bsize) { } } -static void nonrd_pick_partition(VP9_COMP *cpi, ThreadData *td, +static void nonrd_pick_partition(VP10_COMP *cpi, ThreadData *td, TileDataEnc *tile_data, TOKENEXTRA **tp, int mi_row, int mi_col, BLOCK_SIZE bsize, RD_COST *rd_cost, @@ -3280,7 +3281,7 @@ static void nonrd_pick_partition(VP9_COMP *cpi, ThreadData *td, } } -static void nonrd_select_partition(VP9_COMP *cpi, +static void nonrd_select_partition(VP10_COMP *cpi, ThreadData *td, TileDataEnc *tile_data, MODE_INFO **mi, @@ -3419,7 +3420,7 @@ static void nonrd_select_partition(VP9_COMP *cpi, } -static void nonrd_use_partition(VP9_COMP *cpi, +static void nonrd_use_partition(VP10_COMP *cpi, ThreadData *td, TileDataEnc *tile_data, MODE_INFO **mi, @@ -3535,7 +3536,7 @@ static void nonrd_use_partition(VP9_COMP *cpi, update_partition_context(xd, mi_row, mi_col, subsize, bsize); } -static void encode_nonrd_sb_row(VP9_COMP *cpi, +static void encode_nonrd_sb_row(VP10_COMP *cpi, ThreadData *td, TileDataEnc *tile_data, int mi_row, @@ -3635,7 +3636,7 @@ static void encode_nonrd_sb_row(VP9_COMP *cpi, } // end RTC play code -static int set_var_thresh_from_histogram(VP9_COMP *cpi) { +static int set_var_thresh_from_histogram(VP10_COMP *cpi) { const SPEED_FEATURES *const sf = &cpi->sf; const VP10_COMMON *const cm = &cpi->common; @@ -3719,7 +3720,7 @@ static int set_var_thresh_from_histogram(VP9_COMP *cpi) { return sf->search_type_check_frequency; } -static void source_var_based_partition_search_method(VP9_COMP *cpi) { +static void source_var_based_partition_search_method(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; SPEED_FEATURES *const sf = &cpi->sf; @@ -3761,7 +3762,7 @@ static int get_skip_encode_frame(const VP10_COMMON *cm, ThreadData *const td) { cm->show_frame; } -void vp10_init_tile_data(VP9_COMP *cpi) { +void vp10_init_tile_data(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; const int tile_cols = 1 << cm->log2_tile_cols; const int tile_rows = 1 << cm->log2_tile_rows; @@ -3803,7 +3804,7 @@ void vp10_init_tile_data(VP9_COMP *cpi) { } } -void vp10_encode_tile(VP9_COMP *cpi, ThreadData *td, +void vp10_encode_tile(VP10_COMP *cpi, ThreadData *td, int tile_row, int tile_col) { VP10_COMMON *const cm = &cpi->common; const int tile_cols = 1 << cm->log2_tile_cols; @@ -3826,7 +3827,7 @@ void vp10_encode_tile(VP9_COMP *cpi, ThreadData *td, allocated_tokens(*tile_info)); } -static void encode_tiles(VP9_COMP *cpi) { +static void encode_tiles(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; const int tile_cols = 1 << cm->log2_tile_cols; const int tile_rows = 1 << cm->log2_tile_rows; @@ -3854,7 +3855,7 @@ static int input_fpmb_stats(FIRSTPASS_MB_STATS *firstpass_mb_stats, } #endif -static void encode_frame_internal(VP9_COMP *cpi) { +static void encode_frame_internal(VP10_COMP *cpi) { SPEED_FEATURES *const sf = &cpi->sf; ThreadData *const td = &cpi->td; MACROBLOCK *const x = &td->mb; @@ -3979,7 +3980,7 @@ static INTERP_FILTER get_interp_filter( } } -void vp10_encode_frame(VP9_COMP *cpi) { +void vp10_encode_frame(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; // In the longer term the encoder should be generalized to match the @@ -4122,7 +4123,7 @@ static void sum_intra_stats(FRAME_COUNTS *counts, const MODE_INFO *mi) { ++counts->uv_mode[y_mode][uv_mode]; } -static void encode_superblock(VP9_COMP *cpi, ThreadData *td, +static void encode_superblock(VP10_COMP *cpi, ThreadData *td, TOKENEXTRA **t, int output_enabled, int mi_row, int mi_col, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) { diff --git a/vp10/encoder/encodeframe.h b/vp10/encoder/encodeframe.h index 3c12e210a..fbb81f8b1 100644 --- a/vp10/encoder/encodeframe.h +++ b/vp10/encoder/encodeframe.h @@ -20,7 +20,7 @@ extern "C" { struct macroblock; struct yv12_buffer_config; -struct VP9_COMP; +struct VP10_COMP; struct ThreadData; // Constants used in SOURCE_VAR_BASED_PARTITION @@ -34,13 +34,13 @@ void vp10_setup_src_planes(struct macroblock *x, const struct yv12_buffer_config *src, int mi_row, int mi_col); -void vp10_encode_frame(struct VP9_COMP *cpi); +void vp10_encode_frame(struct VP10_COMP *cpi); -void vp10_init_tile_data(struct VP9_COMP *cpi); -void vp10_encode_tile(struct VP9_COMP *cpi, struct ThreadData *td, +void vp10_init_tile_data(struct VP10_COMP *cpi); +void vp10_encode_tile(struct VP10_COMP *cpi, struct ThreadData *td, int tile_row, int tile_col); -void vp10_set_variance_partition_thresholds(struct VP9_COMP *cpi, int q); +void vp10_set_variance_partition_thresholds(struct VP10_COMP *cpi, int q); #ifdef __cplusplus } // extern "C" diff --git a/vp10/encoder/encodemv.c b/vp10/encoder/encodemv.c index bfdb6649e..b67b93e38 100644 --- a/vp10/encoder/encodemv.c +++ b/vp10/encoder/encodemv.c @@ -198,7 +198,7 @@ void vp10_write_nmv_probs(VP10_COMMON *cm, int usehp, vpx_writer *w, } } -void vp10_encode_mv(VP9_COMP* cpi, vpx_writer* w, +void vp10_encode_mv(VP10_COMP* cpi, vpx_writer* w, const MV* mv, const MV* ref, const nmv_context* mvctx, int usehp) { const MV diff = {mv->row - ref->row, diff --git a/vp10/encoder/encodemv.h b/vp10/encoder/encodemv.h index 6e1dd3c76..006f6d7c7 100644 --- a/vp10/encoder/encodemv.h +++ b/vp10/encoder/encodemv.h @@ -23,7 +23,7 @@ void vp10_entropy_mv_init(void); void vp10_write_nmv_probs(VP10_COMMON *cm, int usehp, vpx_writer *w, nmv_context_counts *const counts); -void vp10_encode_mv(VP9_COMP *cpi, vpx_writer* w, const MV* mv, const MV* ref, +void vp10_encode_mv(VP10_COMP *cpi, vpx_writer* w, const MV* mv, const MV* ref, const nmv_context* mvctx, int usehp); void vp10_build_nmv_cost_table(int *mvjoint, int *mvcost[2], diff --git a/vp10/encoder/encoder.c b/vp10/encoder/encoder.c index 547bffcda..4585d6e82 100644 --- a/vp10/encoder/encoder.c +++ b/vp10/encoder/encoder.c @@ -115,7 +115,7 @@ static INLINE void Scale2Ratio(VPX_SCALING mode, int *hr, int *hs) { // Mark all inactive blocks as active. Other segmentation features may be set // so memset cannot be used, instead only inactive blocks should be reset. -static void suppress_active_map(VP9_COMP *cpi) { +static void suppress_active_map(VP10_COMP *cpi) { unsigned char *const seg_map = cpi->segmentation_map; int i; if (cpi->active_map.enabled || cpi->active_map.update) @@ -124,7 +124,7 @@ static void suppress_active_map(VP9_COMP *cpi) { seg_map[i] = AM_SEGMENT_ID_ACTIVE; } -static void apply_active_map(VP9_COMP *cpi) { +static void apply_active_map(VP10_COMP *cpi) { struct segmentation *const seg = &cpi->common.seg; unsigned char *const seg_map = cpi->segmentation_map; const unsigned char *const active_map = cpi->active_map.map; @@ -160,7 +160,7 @@ static void apply_active_map(VP9_COMP *cpi) { } } -int vp10_set_active_map(VP9_COMP* cpi, +int vp10_set_active_map(VP10_COMP* cpi, unsigned char* new_map_16x16, int rows, int cols) { @@ -189,7 +189,7 @@ int vp10_set_active_map(VP9_COMP* cpi, } } -int vp10_get_active_map(VP9_COMP* cpi, +int vp10_get_active_map(VP10_COMP* cpi, unsigned char* new_map_16x16, int rows, int cols) { @@ -216,7 +216,7 @@ int vp10_get_active_map(VP9_COMP* cpi, } } -void vp10_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv) { +void vp10_set_high_precision_mv(VP10_COMP *cpi, int allow_high_precision_mv) { MACROBLOCK *const mb = &cpi->td.mb; cpi->common.allow_high_precision_mv = allow_high_precision_mv; if (cpi->common.allow_high_precision_mv) { @@ -228,7 +228,7 @@ void vp10_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv) { } } -static void setup_frame(VP9_COMP *cpi) { +static void setup_frame(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; // Set up entropy context depending on frame type. The decoder mandates // the use of the default context, index 0, for keyframes and inter @@ -334,7 +334,7 @@ void vp10_initialize_enc(void) { } } -static void dealloc_compressor_data(VP9_COMP *cpi) { +static void dealloc_compressor_data(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; int i; @@ -415,7 +415,7 @@ static void dealloc_compressor_data(VP9_COMP *cpi) { memset(&cpi->svc.empty_frame, 0, sizeof(cpi->svc.empty_frame)); } -static void save_coding_context(VP9_COMP *cpi) { +static void save_coding_context(VP10_COMP *cpi) { CODING_CONTEXT *const cc = &cpi->coding_context; VP10_COMMON *cm = &cpi->common; @@ -445,7 +445,7 @@ static void save_coding_context(VP9_COMP *cpi) { cc->fc = *cm->fc; } -static void restore_coding_context(VP9_COMP *cpi) { +static void restore_coding_context(VP10_COMP *cpi) { CODING_CONTEXT *const cc = &cpi->coding_context; VP10_COMMON *cm = &cpi->common; @@ -472,7 +472,7 @@ static void restore_coding_context(VP9_COMP *cpi) { *cm->fc = cc->fc; } -static void configure_static_seg_features(VP9_COMP *cpi) { +static void configure_static_seg_features(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; const RATE_CONTROL *const rc = &cpi->rc; struct segmentation *const seg = &cm->seg; @@ -596,7 +596,7 @@ static void configure_static_seg_features(VP9_COMP *cpi) { } } -static void update_reference_segmentation_map(VP9_COMP *cpi) { +static void update_reference_segmentation_map(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; MODE_INFO **mi_8x8_ptr = cm->mi_grid_visible; uint8_t *cache_ptr = cm->last_frame_seg_map; @@ -612,7 +612,7 @@ static void update_reference_segmentation_map(VP9_COMP *cpi) { } } -static void alloc_raw_frame_buffers(VP9_COMP *cpi) { +static void alloc_raw_frame_buffers(VP10_COMP *cpi) { VP10_COMMON *cm = &cpi->common; const VP9EncoderConfig *oxcf = &cpi->oxcf; @@ -640,7 +640,7 @@ static void alloc_raw_frame_buffers(VP9_COMP *cpi) { "Failed to allocate altref buffer"); } -static void alloc_util_frame_buffers(VP9_COMP *cpi) { +static void alloc_util_frame_buffers(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; if (vp9_realloc_frame_buffer(&cpi->last_frame_uf, cm->width, cm->height, @@ -677,7 +677,7 @@ static void alloc_util_frame_buffers(VP9_COMP *cpi) { } -static int alloc_context_buffers_ext(VP9_COMP *cpi) { +static int alloc_context_buffers_ext(VP10_COMP *cpi) { VP10_COMMON *cm = &cpi->common; int mi_size = cm->mi_cols * cm->mi_rows; @@ -688,7 +688,7 @@ static int alloc_context_buffers_ext(VP9_COMP *cpi) { return 0; } -void vp10_alloc_compressor_data(VP9_COMP *cpi) { +void vp10_alloc_compressor_data(VP10_COMP *cpi) { VP10_COMMON *cm = &cpi->common; vp10_alloc_context_buffers(cm, cm->width, cm->height); @@ -706,12 +706,12 @@ void vp10_alloc_compressor_data(VP9_COMP *cpi) { vp10_setup_pc_tree(&cpi->common, &cpi->td); } -void vp10_new_framerate(VP9_COMP *cpi, double framerate) { +void vp10_new_framerate(VP10_COMP *cpi, double framerate) { cpi->framerate = framerate < 0.1 ? 30 : framerate; vp10_rc_update_framerate(cpi); } -static void set_tile_limits(VP9_COMP *cpi) { +static void set_tile_limits(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; int min_log2_tile_cols, max_log2_tile_cols; @@ -729,7 +729,7 @@ static void set_tile_limits(VP9_COMP *cpi) { } } -static void update_frame_size(VP9_COMP *cpi) { +static void update_frame_size(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; @@ -756,13 +756,13 @@ static void update_frame_size(VP9_COMP *cpi) { } } -static void init_buffer_indices(VP9_COMP *cpi) { +static void init_buffer_indices(VP10_COMP *cpi) { cpi->lst_fb_idx = 0; cpi->gld_fb_idx = 1; cpi->alt_fb_idx = 2; } -static void init_config(struct VP9_COMP *cpi, VP9EncoderConfig *oxcf) { +static void init_config(struct VP10_COMP *cpi, VP9EncoderConfig *oxcf) { VP10_COMMON *const cm = &cpi->common; cpi->oxcf = *oxcf; @@ -1017,7 +1017,7 @@ MAKE_BFP_SAD3_WRAPPER(vpx_highbd_sad4x4x3) MAKE_BFP_SAD8_WRAPPER(vpx_highbd_sad4x4x8) MAKE_BFP_SAD4D_WRAPPER(vpx_highbd_sad4x4x4d) -static void highbd_set_var_fns(VP9_COMP *const cpi) { +static void highbd_set_var_fns(VP10_COMP *const cpi) { VP10_COMMON *const cm = &cpi->common; if (cm->use_highbitdepth) { switch (cm->bit_depth) { @@ -1425,7 +1425,7 @@ static void highbd_set_var_fns(VP9_COMP *const cpi) { } #endif // CONFIG_VP9_HIGHBITDEPTH -static void realloc_segmentation_maps(VP9_COMP *cpi) { +static void realloc_segmentation_maps(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; // Create the encoder segmentation map and set all entries to 0 @@ -1451,7 +1451,7 @@ static void realloc_segmentation_maps(VP9_COMP *cpi) { vpx_calloc(cm->mi_rows * cm->mi_cols, 1)); } -void vp10_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) { +void vp10_change_config(struct VP10_COMP *cpi, const VP9EncoderConfig *oxcf) { VP10_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; @@ -1590,10 +1590,10 @@ static void cal_nmvsadcosts_hp(int *mvsadcost[2]) { } -VP9_COMP *vp10_create_compressor(VP9EncoderConfig *oxcf, +VP10_COMP *vp10_create_compressor(VP9EncoderConfig *oxcf, BufferPool *const pool) { unsigned int i; - VP9_COMP *volatile const cpi = vpx_memalign(32, sizeof(VP9_COMP)); + VP10_COMP *volatile const cpi = vpx_memalign(32, sizeof(VP10_COMP)); VP10_COMMON *volatile const cm = cpi != NULL ? &cpi->common : NULL; if (!cm) @@ -1917,7 +1917,7 @@ VP9_COMP *vp10_create_compressor(VP9EncoderConfig *oxcf, #define SNPRINT2(H, T, V) \ snprintf((H) + strlen(H), sizeof(H) - strlen(H), (T), (V)) -void vp10_remove_compressor(VP9_COMP *cpi) { +void vp10_remove_compressor(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; unsigned int i; int t; @@ -2337,7 +2337,7 @@ static void calc_highbd_psnr(const YV12_BUFFER_CONFIG *a, } #endif // CONFIG_VP9_HIGHBITDEPTH -static void generate_psnr_packet(VP9_COMP *cpi) { +static void generate_psnr_packet(VP10_COMP *cpi) { struct vpx_codec_cx_pkt pkt; int i; PSNR_STATS psnr; @@ -2361,7 +2361,7 @@ static void generate_psnr_packet(VP9_COMP *cpi) { vpx_codec_pkt_list_add(cpi->output_pkt_list, &pkt); } -int vp10_use_as_reference(VP9_COMP *cpi, int ref_frame_flags) { +int vp10_use_as_reference(VP10_COMP *cpi, int ref_frame_flags) { if (ref_frame_flags > 7) return -1; @@ -2369,14 +2369,14 @@ int vp10_use_as_reference(VP9_COMP *cpi, int ref_frame_flags) { return 0; } -void vp10_update_reference(VP9_COMP *cpi, int ref_frame_flags) { +void vp10_update_reference(VP10_COMP *cpi, int ref_frame_flags) { cpi->ext_refresh_golden_frame = (ref_frame_flags & VP9_GOLD_FLAG) != 0; cpi->ext_refresh_alt_ref_frame = (ref_frame_flags & VP9_ALT_FLAG) != 0; cpi->ext_refresh_last_frame = (ref_frame_flags & VP9_LAST_FLAG) != 0; cpi->ext_refresh_frame_flags_pending = 1; } -static YV12_BUFFER_CONFIG *get_vp10_ref_frame_buffer(VP9_COMP *cpi, +static YV12_BUFFER_CONFIG *get_vp10_ref_frame_buffer(VP10_COMP *cpi, VP9_REFFRAME ref_frame_flag) { MV_REFERENCE_FRAME ref_frame = NONE; if (ref_frame_flag == VP9_LAST_FLAG) @@ -2389,7 +2389,7 @@ static YV12_BUFFER_CONFIG *get_vp10_ref_frame_buffer(VP9_COMP *cpi, return ref_frame == NONE ? NULL : get_ref_frame_buffer(cpi, ref_frame); } -int vp10_copy_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag, +int vp10_copy_reference_enc(VP10_COMP *cpi, VP9_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd) { YV12_BUFFER_CONFIG *cfg = get_vp10_ref_frame_buffer(cpi, ref_frame_flag); if (cfg) { @@ -2400,7 +2400,7 @@ int vp10_copy_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag, } } -int vp10_set_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag, +int vp10_set_reference_enc(VP10_COMP *cpi, VP9_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd) { YV12_BUFFER_CONFIG *cfg = get_vp10_ref_frame_buffer(cpi, ref_frame_flag); if (cfg) { @@ -2411,7 +2411,7 @@ int vp10_set_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag, } } -int vp10_update_entropy(VP9_COMP * cpi, int update) { +int vp10_update_entropy(VP10_COMP * cpi, int update) { cpi->ext_refresh_frame_context = update; cpi->ext_refresh_frame_context_pending = 1; return 0; @@ -2606,7 +2606,7 @@ static void scale_and_extend_frame(const YV12_BUFFER_CONFIG *src, vp9_extend_frame_borders(dst); } -static int scale_down(VP9_COMP *cpi, int q) { +static int scale_down(VP10_COMP *cpi, int q) { RATE_CONTROL *const rc = &cpi->rc; GF_GROUP *const gf_group = &cpi->twopass.gf_group; int scale = 0; @@ -2623,7 +2623,7 @@ static int scale_down(VP9_COMP *cpi, int q) { // Function to test for conditions that indicate we should loop // back and recode a frame. -static int recode_loop_test(VP9_COMP *cpi, +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; @@ -2659,7 +2659,7 @@ static int recode_loop_test(VP9_COMP *cpi, return force_recode; } -void vp10_update_reference_frames(VP9_COMP *cpi) { +void vp10_update_reference_frames(VP10_COMP *cpi) { VP10_COMMON * const cm = &cpi->common; BufferPool *const pool = cm->buffer_pool; @@ -2741,7 +2741,7 @@ void vp10_update_reference_frames(VP9_COMP *cpi) { #endif } -static void loopfilter_frame(VP9_COMP *cpi, VP10_COMMON *cm) { +static void loopfilter_frame(VP10_COMP *cpi, VP10_COMMON *cm) { MACROBLOCKD *xd = &cpi->td.mb.e_mbd; struct loopfilter *lf = &cm->lf; if (xd->lossless) { @@ -2787,7 +2787,7 @@ static INLINE void alloc_frame_mvs(const VP10_COMMON *cm, } } -void vp10_scale_references(VP9_COMP *cpi) { +void vp10_scale_references(VP10_COMP *cpi) { VP10_COMMON *cm = &cpi->common; MV_REFERENCE_FRAME ref_frame; const VP9_REFFRAME ref_mask[3] = {VP9_LAST_FLAG, VP9_GOLD_FLAG, VP9_ALT_FLAG}; @@ -2869,7 +2869,7 @@ void vp10_scale_references(VP9_COMP *cpi) { } } -static void release_scaled_references(VP9_COMP *cpi) { +static void release_scaled_references(VP10_COMP *cpi) { VP10_COMMON *cm = &cpi->common; int i; if (cpi->oxcf.pass == 0 && !cpi->use_svc) { @@ -2928,7 +2928,7 @@ static void full_to_model_counts(vp10_coeff_count_model *model_count, } #if 0 && CONFIG_INTERNAL_STATS -static void output_frame_level_debug_stats(VP9_COMP *cpi) { +static void output_frame_level_debug_stats(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; FILE *const f = fopen("tmp.stt", cm->current_video_frame ? "a" : "w"); int64_t recon_err; @@ -2996,7 +2996,7 @@ static void output_frame_level_debug_stats(VP9_COMP *cpi) { } #endif -static void set_mv_search_params(VP9_COMP *cpi) { +static void set_mv_search_params(VP10_COMP *cpi) { const VP10_COMMON *const cm = &cpi->common; const unsigned int max_mv_def = MIN(cm->width, cm->height); @@ -3021,14 +3021,14 @@ static void set_mv_search_params(VP9_COMP *cpi) { } } -static void set_size_independent_vars(VP9_COMP *cpi) { +static void set_size_independent_vars(VP10_COMP *cpi) { vp10_set_speed_features_framesize_independent(cpi); vp10_set_rd_speed_thresholds(cpi); vp10_set_rd_speed_thresholds_sub8x8(cpi); cpi->common.interp_filter = cpi->sf.default_interp_filter; } -static void set_size_dependent_vars(VP9_COMP *cpi, int *q, +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; @@ -3076,7 +3076,7 @@ static void set_size_dependent_vars(VP9_COMP *cpi, int *q, #endif // CONFIG_VP9_POSTPROC } -static void init_motion_estimation(VP9_COMP *cpi) { +static void init_motion_estimation(VP10_COMP *cpi) { int y_stride = cpi->scaled_source.y_stride; if (cpi->sf.mv.search_method == NSTEP) { @@ -3086,7 +3086,7 @@ static void init_motion_estimation(VP9_COMP *cpi) { } } -static void set_frame_size(VP9_COMP *cpi) { +static void set_frame_size(VP10_COMP *cpi) { int ref_frame; VP10_COMMON *const cm = &cpi->common; VP9EncoderConfig *const oxcf = &cpi->oxcf; @@ -3181,7 +3181,7 @@ static void set_frame_size(VP9_COMP *cpi) { set_ref_ptrs(cm, xd, LAST_FRAME, LAST_FRAME); } -static void encode_without_recode_loop(VP9_COMP *cpi) { +static void encode_without_recode_loop(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; int q = 0, bottom_index = 0, top_index = 0; // Dummy variables. @@ -3252,7 +3252,7 @@ static void encode_without_recode_loop(VP9_COMP *cpi) { vpx_clear_system_state(); } -static void encode_with_recode_loop(VP9_COMP *cpi, +static void encode_with_recode_loop(VP10_COMP *cpi, size_t *size, uint8_t *dest) { VP10_COMMON *const cm = &cpi->common; @@ -3514,7 +3514,7 @@ static void encode_with_recode_loop(VP9_COMP *cpi, } while (loop); } -static int get_ref_frame_flags(const VP9_COMP *cpi) { +static int get_ref_frame_flags(const VP10_COMP *cpi) { const int *const map = cpi->common.ref_frame_map; const int gold_is_last = map[cpi->gld_fb_idx] == map[cpi->lst_fb_idx]; const int alt_is_last = map[cpi->alt_fb_idx] == map[cpi->lst_fb_idx]; @@ -3538,7 +3538,7 @@ static int get_ref_frame_flags(const VP9_COMP *cpi) { return flags; } -static void set_ext_overrides(VP9_COMP *cpi) { +static void set_ext_overrides(VP10_COMP *cpi) { // Overrides the defaults with the externally supplied values with // vp10_update_reference() and vp10_update_entropy() calls // Note: The overrides are valid only for the next frame passed @@ -3586,7 +3586,7 @@ YV12_BUFFER_CONFIG *vp10_scale_if_required(VP10_COMMON *cm, } } -static void set_arf_sign_bias(VP9_COMP *cpi) { +static void set_arf_sign_bias(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; int arf_sign_bias; @@ -3602,7 +3602,7 @@ static void set_arf_sign_bias(VP9_COMP *cpi) { cm->ref_frame_sign_bias[ALTREF_FRAME] = arf_sign_bias; } -static int setup_interp_filter_search_mask(VP9_COMP *cpi) { +static int setup_interp_filter_search_mask(VP10_COMP *cpi) { INTERP_FILTER ifilter; int ref_total[MAX_REF_FRAMES] = {0}; MV_REFERENCE_FRAME ref; @@ -3628,7 +3628,7 @@ static int setup_interp_filter_search_mask(VP9_COMP *cpi) { return mask; } -static void encode_frame_to_data_rate(VP9_COMP *cpi, +static void encode_frame_to_data_rate(VP10_COMP *cpi, size_t *size, uint8_t *dest, unsigned int *frame_flags) { @@ -3865,13 +3865,13 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, cm->frame_type; } -static void SvcEncode(VP9_COMP *cpi, size_t *size, uint8_t *dest, +static void SvcEncode(VP10_COMP *cpi, size_t *size, uint8_t *dest, unsigned int *frame_flags) { vp10_rc_get_svc_params(cpi); encode_frame_to_data_rate(cpi, size, dest, frame_flags); } -static void Pass0Encode(VP9_COMP *cpi, size_t *size, uint8_t *dest, +static void Pass0Encode(VP10_COMP *cpi, size_t *size, uint8_t *dest, unsigned int *frame_flags) { if (cpi->oxcf.rc_mode == VPX_CBR) { vp10_rc_get_one_pass_cbr_params(cpi); @@ -3881,7 +3881,7 @@ static void Pass0Encode(VP9_COMP *cpi, size_t *size, uint8_t *dest, encode_frame_to_data_rate(cpi, size, dest, frame_flags); } -static void Pass2Encode(VP9_COMP *cpi, size_t *size, +static void Pass2Encode(VP10_COMP *cpi, size_t *size, uint8_t *dest, unsigned int *frame_flags) { cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED; encode_frame_to_data_rate(cpi, size, dest, frame_flags); @@ -3900,7 +3900,7 @@ static void init_ref_frame_bufs(VP10_COMMON *cm) { } } -static void check_initial_width(VP9_COMP *cpi, +static void check_initial_width(VP10_COMP *cpi, #if CONFIG_VP9_HIGHBITDEPTH int use_highbitdepth, #endif @@ -3932,7 +3932,7 @@ static void check_initial_width(VP9_COMP *cpi, } #if CONFIG_VP9_TEMPORAL_DENOISING -static void setup_denoiser_buffer(VP9_COMP *cpi) { +static void setup_denoiser_buffer(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; if (cpi->oxcf.noise_sensitivity > 0 && !cpi->denoiser.frame_buffer_initialized) { @@ -3946,7 +3946,7 @@ static void setup_denoiser_buffer(VP9_COMP *cpi) { } #endif -int vp10_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags, +int vp10_receive_raw_frame(VP10_COMP *cpi, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time) { VP10_COMMON *cm = &cpi->common; @@ -3992,7 +3992,7 @@ int vp10_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags, } -static int frame_is_reference(const VP9_COMP *cpi) { +static int frame_is_reference(const VP10_COMP *cpi) { const VP10_COMMON *cm = &cpi->common; return cm->frame_type == KEY_FRAME || @@ -4005,7 +4005,7 @@ static int frame_is_reference(const VP9_COMP *cpi) { cm->seg.update_data; } -static void adjust_frame_rate(VP9_COMP *cpi, +static void adjust_frame_rate(VP10_COMP *cpi, const struct lookahead_entry *source) { int64_t this_duration; int step = 0; @@ -4046,7 +4046,7 @@ static void adjust_frame_rate(VP9_COMP *cpi, // Returns 0 if this is not an alt ref else the offset of the source frame // used as the arf midpoint. -static int get_arf_src_index(VP9_COMP *cpi) { +static int get_arf_src_index(VP10_COMP *cpi) { RATE_CONTROL *const rc = &cpi->rc; int arf_src_index = 0; if (is_altref_enabled(cpi)) { @@ -4062,7 +4062,7 @@ static int get_arf_src_index(VP9_COMP *cpi) { return arf_src_index; } -static void check_src_altref(VP9_COMP *cpi, +static void check_src_altref(VP10_COMP *cpi, const struct lookahead_entry *source) { RATE_CONTROL *const rc = &cpi->rc; @@ -4100,7 +4100,7 @@ static void adjust_image_stat(double y, double u, double v, double all, } #endif // CONFIG_INTERNAL_STATS -int vp10_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags, +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; @@ -4551,7 +4551,7 @@ int vp10_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags, return 0; } -int vp10_get_preview_raw_frame(VP9_COMP *cpi, YV12_BUFFER_CONFIG *dest, +int vp10_get_preview_raw_frame(VP10_COMP *cpi, YV12_BUFFER_CONFIG *dest, vp10_ppflags_t *flags) { VP10_COMMON *cm = &cpi->common; #if !CONFIG_VP9_POSTPROC @@ -4581,7 +4581,7 @@ int vp10_get_preview_raw_frame(VP9_COMP *cpi, YV12_BUFFER_CONFIG *dest, } } -int vp10_set_internal_size(VP9_COMP *cpi, +int vp10_set_internal_size(VP10_COMP *cpi, VPX_SCALING horiz_mode, VPX_SCALING vert_mode) { VP10_COMMON *cm = &cpi->common; int hr = 0, hs = 0, vr = 0, vs = 0; @@ -4603,7 +4603,7 @@ int vp10_set_internal_size(VP9_COMP *cpi, return 0; } -int vp10_set_size_literal(VP9_COMP *cpi, unsigned int width, +int vp10_set_size_literal(VP10_COMP *cpi, unsigned int width, unsigned int height) { VP10_COMMON *cm = &cpi->common; #if CONFIG_VP9_HIGHBITDEPTH @@ -4639,7 +4639,7 @@ int vp10_set_size_literal(VP9_COMP *cpi, unsigned int width, return 0; } -void vp10_set_svc(VP9_COMP *cpi, int use_svc) { +void vp10_set_svc(VP10_COMP *cpi, int use_svc) { cpi->use_svc = use_svc; return; } @@ -4666,11 +4666,11 @@ int64_t vp10_highbd_get_y_sse(const YV12_BUFFER_CONFIG *a, } #endif // CONFIG_VP9_HIGHBITDEPTH -int vp10_get_quantizer(VP9_COMP *cpi) { +int vp10_get_quantizer(VP10_COMP *cpi) { return cpi->common.base_qindex; } -void vp10_apply_encoding_flags(VP9_COMP *cpi, vpx_enc_frame_flags_t flags) { +void vp10_apply_encoding_flags(VP10_COMP *cpi, vpx_enc_frame_flags_t flags) { if (flags & (VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF)) { int ref = 7; diff --git a/vp10/encoder/encoder.h b/vp10/encoder/encoder.h index be98ed657..92faa0b50 100644 --- a/vp10/encoder/encoder.h +++ b/vp10/encoder/encoder.h @@ -289,7 +289,7 @@ typedef struct IMAGE_STAT { double worst; } ImageStat; -typedef struct VP9_COMP { +typedef struct VP10_COMP { QUANTS quants; ThreadData td; MB_MODE_INFO_EXT *mbmi_ext_base; @@ -501,62 +501,62 @@ typedef struct VP9_COMP { VPxWorker *workers; struct EncWorkerData *tile_thr_data; VP9LfSync lf_row_sync; -} VP9_COMP; +} VP10_COMP; void vp10_initialize_enc(void); -struct VP9_COMP *vp10_create_compressor(VP9EncoderConfig *oxcf, +struct VP10_COMP *vp10_create_compressor(VP9EncoderConfig *oxcf, BufferPool *const pool); -void vp10_remove_compressor(VP9_COMP *cpi); +void vp10_remove_compressor(VP10_COMP *cpi); -void vp10_change_config(VP9_COMP *cpi, const VP9EncoderConfig *oxcf); +void vp10_change_config(VP10_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 vp10_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags, +int vp10_receive_raw_frame(VP10_COMP *cpi, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time_stamp); -int vp10_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags, +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); -int vp10_get_preview_raw_frame(VP9_COMP *cpi, YV12_BUFFER_CONFIG *dest, +int vp10_get_preview_raw_frame(VP10_COMP *cpi, YV12_BUFFER_CONFIG *dest, vp10_ppflags_t *flags); -int vp10_use_as_reference(VP9_COMP *cpi, int ref_frame_flags); +int vp10_use_as_reference(VP10_COMP *cpi, int ref_frame_flags); -void vp10_update_reference(VP9_COMP *cpi, int ref_frame_flags); +void vp10_update_reference(VP10_COMP *cpi, int ref_frame_flags); -int vp10_copy_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag, +int vp10_copy_reference_enc(VP10_COMP *cpi, VP9_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); -int vp10_set_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag, +int vp10_set_reference_enc(VP10_COMP *cpi, VP9_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); -int vp10_update_entropy(VP9_COMP *cpi, int update); +int vp10_update_entropy(VP10_COMP *cpi, int update); -int vp10_set_active_map(VP9_COMP *cpi, unsigned char *map, int rows, int cols); +int vp10_set_active_map(VP10_COMP *cpi, unsigned char *map, int rows, int cols); -int vp10_get_active_map(VP9_COMP *cpi, unsigned char *map, int rows, int cols); +int vp10_get_active_map(VP10_COMP *cpi, unsigned char *map, int rows, int cols); -int vp10_set_internal_size(VP9_COMP *cpi, +int vp10_set_internal_size(VP10_COMP *cpi, VPX_SCALING horiz_mode, VPX_SCALING vert_mode); -int vp10_set_size_literal(VP9_COMP *cpi, unsigned int width, +int vp10_set_size_literal(VP10_COMP *cpi, unsigned int width, unsigned int height); -void vp10_set_svc(VP9_COMP *cpi, int use_svc); +void vp10_set_svc(VP10_COMP *cpi, int use_svc); -int vp10_get_quantizer(struct VP9_COMP *cpi); +int vp10_get_quantizer(struct VP10_COMP *cpi); -static INLINE int frame_is_kf_gf_arf(const VP9_COMP *cpi) { +static INLINE int frame_is_kf_gf_arf(const VP10_COMP *cpi) { return frame_is_intra_only(&cpi->common) || cpi->refresh_alt_ref_frame || (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref); } -static INLINE int get_ref_frame_map_idx(const VP9_COMP *cpi, +static INLINE int get_ref_frame_map_idx(const VP10_COMP *cpi, MV_REFERENCE_FRAME ref_frame) { if (ref_frame == LAST_FRAME) { return cpi->lst_fb_idx; @@ -567,7 +567,7 @@ static INLINE int get_ref_frame_map_idx(const VP9_COMP *cpi, } } -static INLINE int get_ref_frame_buf_idx(const VP9_COMP *const cpi, +static INLINE int get_ref_frame_buf_idx(const VP10_COMP *const cpi, int ref_frame) { const VP10_COMMON *const cm = &cpi->common; const int map_idx = get_ref_frame_map_idx(cpi, ref_frame); @@ -575,7 +575,7 @@ static INLINE int get_ref_frame_buf_idx(const VP9_COMP *const cpi, } static INLINE YV12_BUFFER_CONFIG *get_ref_frame_buffer( - VP9_COMP *cpi, MV_REFERENCE_FRAME ref_frame) { + VP10_COMP *cpi, MV_REFERENCE_FRAME ref_frame) { VP10_COMMON *const cm = &cpi->common; const int buf_idx = get_ref_frame_buf_idx(cpi, ref_frame); return @@ -606,13 +606,13 @@ int64_t vp10_highbd_get_y_sse(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b); #endif // CONFIG_VP9_HIGHBITDEPTH -void vp10_alloc_compressor_data(VP9_COMP *cpi); +void vp10_alloc_compressor_data(VP10_COMP *cpi); -void vp10_scale_references(VP9_COMP *cpi); +void vp10_scale_references(VP10_COMP *cpi); -void vp10_update_reference_frames(VP9_COMP *cpi); +void vp10_update_reference_frames(VP10_COMP *cpi); -void vp10_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv); +void vp10_set_high_precision_mv(VP10_COMP *cpi, int allow_high_precision_mv); YV12_BUFFER_CONFIG *vp10_scale_if_required_fast(VP10_COMMON *cm, YV12_BUFFER_CONFIG *unscaled, @@ -622,17 +622,17 @@ YV12_BUFFER_CONFIG *vp10_scale_if_required(VP10_COMMON *cm, YV12_BUFFER_CONFIG *unscaled, YV12_BUFFER_CONFIG *scaled); -void vp10_apply_encoding_flags(VP9_COMP *cpi, vpx_enc_frame_flags_t flags); +void vp10_apply_encoding_flags(VP10_COMP *cpi, vpx_enc_frame_flags_t flags); -static INLINE int is_two_pass_svc(const struct VP9_COMP *const cpi) { +static INLINE int is_two_pass_svc(const struct VP10_COMP *const cpi) { return cpi->use_svc && cpi->oxcf.pass != 0; } -static INLINE int is_one_pass_cbr_svc(const struct VP9_COMP *const cpi) { +static INLINE int is_one_pass_cbr_svc(const struct VP10_COMP *const cpi) { return (cpi->use_svc && cpi->oxcf.pass == 0); } -static INLINE int is_altref_enabled(const VP9_COMP *const cpi) { +static INLINE int is_altref_enabled(const VP10_COMP *const cpi) { return cpi->oxcf.mode != REALTIME && cpi->oxcf.lag_in_frames > 0 && (cpi->oxcf.enable_auto_arf && (!is_two_pass_svc(cpi) || @@ -652,11 +652,11 @@ static INLINE int get_chessboard_index(const int frame_index) { return frame_index & 0x1; } -static INLINE int *cond_cost_list(const struct VP9_COMP *cpi, int *cost_list) { +static INLINE int *cond_cost_list(const struct VP10_COMP *cpi, int *cost_list) { return cpi->sf.mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL; } -void vp10_new_framerate(VP9_COMP *cpi, double framerate); +void vp10_new_framerate(VP10_COMP *cpi, double framerate); #define LAYER_IDS_TO_IDX(sl, tl, num_tl) ((sl) * (num_tl) + (tl)) diff --git a/vp10/encoder/ethread.c b/vp10/encoder/ethread.c index ba56d18e5..e1d2538ac 100644 --- a/vp10/encoder/ethread.c +++ b/vp10/encoder/ethread.c @@ -32,7 +32,7 @@ static void accumulate_rd_opt(ThreadData *td, ThreadData *td_t) { } static int enc_worker_hook(EncWorkerData *const thread_data, void *unused) { - VP9_COMP *const cpi = thread_data->cpi; + VP10_COMP *const cpi = thread_data->cpi; const VP10_COMMON *const cm = &cpi->common; const int tile_cols = 1 << cm->log2_tile_cols; const int tile_rows = 1 << cm->log2_tile_rows; @@ -51,7 +51,7 @@ static int enc_worker_hook(EncWorkerData *const thread_data, void *unused) { return 0; } -static int get_max_tile_cols(VP9_COMP *cpi) { +static int get_max_tile_cols(VP10_COMP *cpi) { const int aligned_width = ALIGN_POWER_OF_TWO(cpi->oxcf.width, MI_SIZE_LOG2); int mi_cols = aligned_width >> MI_SIZE_LOG2; int min_log2_tile_cols, max_log2_tile_cols; @@ -63,7 +63,7 @@ static int get_max_tile_cols(VP9_COMP *cpi) { return (1 << log2_tile_cols); } -void vp10_encode_tiles_mt(VP9_COMP *cpi) { +void vp10_encode_tiles_mt(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; const int tile_cols = 1 << cm->log2_tile_cols; const VPxWorkerInterface *const winterface = vpx_get_worker_interface(); diff --git a/vp10/encoder/ethread.h b/vp10/encoder/ethread.h index 1a4ea717e..997df0d04 100644 --- a/vp10/encoder/ethread.h +++ b/vp10/encoder/ethread.h @@ -11,15 +11,15 @@ #ifndef VP10_ENCODER_ETHREAD_H_ #define VP10_ENCODER_ETHREAD_H_ -struct VP9_COMP; +struct VP10_COMP; struct ThreadData; typedef struct EncWorkerData { - struct VP9_COMP *cpi; + struct VP10_COMP *cpi; struct ThreadData *td; int start; } EncWorkerData; -void vp10_encode_tiles_mt(struct VP9_COMP *cpi); +void vp10_encode_tiles_mt(struct VP10_COMP *cpi); #endif // VP10_ENCODER_ETHREAD_H_ diff --git a/vp10/encoder/firstpass.c b/vp10/encoder/firstpass.c index 149ee0ad3..48d9a701e 100644 --- a/vp10/encoder/firstpass.c +++ b/vp10/encoder/firstpass.c @@ -143,8 +143,9 @@ static void output_stats(FIRSTPASS_STATS *stats, } #if CONFIG_FP_MB_STATS -static void output_fpmb_stats(uint8_t *this_frame_mb_stats, VP10_COMMON *cm, - struct vpx_codec_pkt_list *pktlist) { +static void output_fpmb_stats(uint8_t *this_frame_mb_stats, + VP10_COMMON *cm, + struct vpx_codec_pkt_list *pktlist) { struct vpx_codec_cx_pkt pkt; pkt.kind = VPX_CODEC_FPMB_STATS_PKT; pkt.data.firstpass_mb_stats.buf = this_frame_mb_stats; @@ -236,7 +237,7 @@ static void subtract_stats(FIRSTPASS_STATS *section, // bars and partially discounts other 0 energy areas. #define MIN_ACTIVE_AREA 0.5 #define MAX_ACTIVE_AREA 1.0 -static double calculate_active_area(const VP9_COMP *cpi, +static double calculate_active_area(const VP10_COMP *cpi, const FIRSTPASS_STATS *this_frame) { double active_pct; @@ -250,7 +251,7 @@ static double calculate_active_area(const VP9_COMP *cpi, // Calculate a modified Error used in distributing bits between easier and // harder frames. #define ACT_AREA_CORRECTION 0.5 -static double calculate_modified_err(const VP9_COMP *cpi, +static double calculate_modified_err(const VP10_COMP *cpi, const TWO_PASS *twopass, const VP9EncoderConfig *oxcf, const FIRSTPASS_STATS *this_frame) { @@ -286,11 +287,11 @@ static int frame_max_bits(const RATE_CONTROL *rc, return (int)max_bits; } -void vp10_init_first_pass(VP9_COMP *cpi) { +void vp10_init_first_pass(VP10_COMP *cpi) { zero_stats(&cpi->twopass.total_stats); } -void vp10_end_first_pass(VP9_COMP *cpi) { +void vp10_end_first_pass(VP10_COMP *cpi) { if (is_two_pass_svc(cpi)) { int i; for (i = 0; i < cpi->svc.number_spatial_layers; ++i) { @@ -380,7 +381,7 @@ static unsigned int highbd_get_prediction_error(BLOCK_SIZE bsize, // Refine the motion search range according to the frame dimension // for first pass test. -static int get_search_range(const VP9_COMP *cpi) { +static int get_search_range(const VP10_COMP *cpi) { int sr = 0; const int dim = MIN(cpi->initial_width, cpi->initial_height); @@ -389,7 +390,7 @@ static int get_search_range(const VP9_COMP *cpi) { return sr; } -static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x, +static void first_pass_motion_search(VP10_COMP *cpi, MACROBLOCK *x, const MV *ref_mv, MV *best_mv, int *best_motion_err) { MACROBLOCKD *const xd = &x->e_mbd; @@ -477,7 +478,7 @@ static int find_fp_qindex(vpx_bit_depth_t bit_depth) { return i; } -static void set_first_pass_params(VP9_COMP *cpi) { +static void set_first_pass_params(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; if (!cpi->refresh_alt_ref_frame && (cm->current_video_frame == 0 || @@ -492,7 +493,7 @@ static void set_first_pass_params(VP9_COMP *cpi) { #define UL_INTRA_THRESH 50 #define INVALID_ROW -1 -void vp10_first_pass(VP9_COMP *cpi, const struct lookahead_entry *source) { +void vp10_first_pass(VP10_COMP *cpi, const struct lookahead_entry *source) { int mb_row, mb_col; MACROBLOCK *const x = &cpi->td.mb; VP10_COMMON *const cm = &cpi->common; @@ -1176,7 +1177,7 @@ static double calc_correction_factor(double err_per_mb, // increased size and hence coding cost of motion vectors. #define EDIV_SIZE_FACTOR 800 -static int get_twopass_worst_quality(const VP9_COMP *cpi, +static int get_twopass_worst_quality(const VP10_COMP *cpi, const double section_err, double inactive_zone, int section_target_bandwidth, @@ -1229,7 +1230,7 @@ static int get_twopass_worst_quality(const VP9_COMP *cpi, } } -static void setup_rf_level_maxq(VP9_COMP *cpi) { +static void setup_rf_level_maxq(VP10_COMP *cpi) { int i; RATE_CONTROL *const rc = &cpi->rc; for (i = INTER_NORMAL; i < RATE_FACTOR_LEVELS; ++i) { @@ -1238,7 +1239,7 @@ static void setup_rf_level_maxq(VP9_COMP *cpi) { } } -void vp10_init_subsampling(VP9_COMP *cpi) { +void vp10_init_subsampling(VP10_COMP *cpi) { const VP10_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; const int w = cm->width; @@ -1254,7 +1255,7 @@ void vp10_init_subsampling(VP9_COMP *cpi) { setup_rf_level_maxq(cpi); } -void vp10_calculate_coded_size(VP9_COMP *cpi, +void vp10_calculate_coded_size(VP10_COMP *cpi, int *scaled_frame_width, int *scaled_frame_height) { RATE_CONTROL *const rc = &cpi->rc; @@ -1262,7 +1263,7 @@ void vp10_calculate_coded_size(VP9_COMP *cpi, *scaled_frame_height = rc->frame_height[rc->frame_size_selector]; } -void vp10_init_second_pass(VP9_COMP *cpi) { +void vp10_init_second_pass(VP10_COMP *cpi) { SVC *const svc = &cpi->svc; const VP9EncoderConfig *const oxcf = &cpi->oxcf; const int is_two_pass_svc = (svc->number_spatial_layers > 1) || @@ -1344,7 +1345,7 @@ void vp10_init_second_pass(VP9_COMP *cpi) { #define LOW_SR_DIFF_TRHESH 0.1 #define SR_DIFF_MAX 128.0 -static double get_sr_decay_rate(const VP9_COMP *cpi, +static double get_sr_decay_rate(const VP10_COMP *cpi, const FIRSTPASS_STATS *frame) { const int num_mbs = (cpi->oxcf.resize_mode != RESIZE_NONE) ? cpi->initial_mbs : cpi->common.MBs; @@ -1375,7 +1376,7 @@ static double get_sr_decay_rate(const VP9_COMP *cpi, // This function gives an estimate of how badly we believe the prediction // quality is decaying from frame to frame. -static double get_zero_motion_factor(const VP9_COMP *cpi, +static double get_zero_motion_factor(const VP10_COMP *cpi, const FIRSTPASS_STATS *frame) { const double zero_motion_pct = frame->pcnt_inter - frame->pcnt_motion; @@ -1385,7 +1386,7 @@ static double get_zero_motion_factor(const VP9_COMP *cpi, #define ZM_POWER_FACTOR 0.75 -static double get_prediction_decay_rate(const VP9_COMP *cpi, +static double get_prediction_decay_rate(const VP10_COMP *cpi, const FIRSTPASS_STATS *next_frame) { const double sr_decay_rate = get_sr_decay_rate(cpi, next_frame); const double zero_motion_factor = @@ -1399,7 +1400,7 @@ static double get_prediction_decay_rate(const VP9_COMP *cpi, // Function to test for a condition where a complex transition is followed // by a static section. For example in slide shows where there is a fade // between slides. This is to help with more optimal kf and gf positioning. -static int detect_transition_to_still(VP9_COMP *cpi, +static int detect_transition_to_still(VP10_COMP *cpi, int frame_interval, int still_interval, double loop_decay_rate, double last_decay_rate) { @@ -1476,7 +1477,7 @@ static void accumulate_frame_motion_stats(const FIRSTPASS_STATS *stats, } #define BASELINE_ERR_PER_MB 1000.0 -static double calc_frame_boost(VP9_COMP *cpi, +static double calc_frame_boost(VP10_COMP *cpi, const FIRSTPASS_STATS *this_frame, double this_frame_mv_in_out, double max_boost) { @@ -1508,7 +1509,7 @@ static double calc_frame_boost(VP9_COMP *cpi, return MIN(frame_boost, max_boost * boost_q_correction); } -static int calc_arf_boost(VP9_COMP *cpi, int offset, +static int calc_arf_boost(VP10_COMP *cpi, int offset, int f_frames, int b_frames, int *f_boost, int *b_boost) { TWO_PASS *const twopass = &cpi->twopass; @@ -1619,7 +1620,7 @@ static int calculate_section_intra_ratio(const FIRSTPASS_STATS *begin, } // Calculate the total bits to allocate in this GF/ARF group. -static int64_t calculate_total_gf_group_bits(VP9_COMP *cpi, +static int64_t calculate_total_gf_group_bits(VP10_COMP *cpi, double gf_group_err) { const RATE_CONTROL *const rc = &cpi->rc; const TWO_PASS *const twopass = &cpi->twopass; @@ -1680,7 +1681,7 @@ static void get_arf_buffer_indices(unsigned char *arf_buffer_indices) { arf_buffer_indices[1] = ARF_SLOT2; } -static void allocate_gf_group_bits(VP9_COMP *cpi, int64_t gf_group_bits, +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; @@ -1841,7 +1842,7 @@ static void allocate_gf_group_bits(VP9_COMP *cpi, int64_t gf_group_bits, } // Analyse and define a gf/arf group. -static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { +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; @@ -2261,7 +2262,7 @@ static int test_candidate_kf(TWO_PASS *twopass, return is_viable_kf; } -static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { +static void find_next_key_frame(VP10_COMP *cpi, FIRSTPASS_STATS *this_frame) { int i, j; RATE_CONTROL *const rc = &cpi->rc; TWO_PASS *const twopass = &cpi->twopass; @@ -2511,7 +2512,7 @@ static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { } // Define the reference buffers that will be updated post encode. -static void configure_buffer_updates(VP9_COMP *cpi) { +static void configure_buffer_updates(VP10_COMP *cpi) { TWO_PASS *const twopass = &cpi->twopass; cpi->rc.is_src_frame_alt_ref = 0; @@ -2558,7 +2559,7 @@ static void configure_buffer_updates(VP9_COMP *cpi) { } } -static int is_skippable_frame(const VP9_COMP *cpi) { +static int is_skippable_frame(const VP10_COMP *cpi) { // If the current frame does not have non-zero motion vector detected in the // first pass, and so do its previous and forward frames, then this frame // can be skipped for partition check, and the partition size is assigned @@ -2577,7 +2578,7 @@ static int is_skippable_frame(const VP9_COMP *cpi) { twopass->stats_in->pcnt_inter - twopass->stats_in->pcnt_motion == 1); } -void vp10_rc_get_second_pass_params(VP9_COMP *cpi) { +void vp10_rc_get_second_pass_params(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; TWO_PASS *const twopass = &cpi->twopass; @@ -2760,7 +2761,7 @@ void vp10_rc_get_second_pass_params(VP9_COMP *cpi) { #define MINQ_ADJ_LIMIT 48 #define MINQ_ADJ_LIMIT_CQ 20 #define HIGH_UNDERSHOOT_RATIO 2 -void vp10_twopass_postencode_update(VP9_COMP *cpi) { +void vp10_twopass_postencode_update(VP10_COMP *cpi) { TWO_PASS *const twopass = &cpi->twopass; RATE_CONTROL *const rc = &cpi->rc; const int bits_used = rc->base_frame_target; diff --git a/vp10/encoder/firstpass.h b/vp10/encoder/firstpass.h index 174cf7ba1..620367475 100644 --- a/vp10/encoder/firstpass.h +++ b/vp10/encoder/firstpass.h @@ -139,23 +139,24 @@ typedef struct { GF_GROUP gf_group; } TWO_PASS; -struct VP9_COMP; +struct VP10_COMP; -void vp10_init_first_pass(struct VP9_COMP *cpi); -void vp10_rc_get_first_pass_params(struct VP9_COMP *cpi); -void vp10_first_pass(struct VP9_COMP *cpi, const struct lookahead_entry *source); -void vp10_end_first_pass(struct VP9_COMP *cpi); +void vp10_init_first_pass(struct VP10_COMP *cpi); +void vp10_rc_get_first_pass_params(struct VP10_COMP *cpi); +void vp10_first_pass(struct VP10_COMP *cpi, + const struct lookahead_entry *source); +void vp10_end_first_pass(struct VP10_COMP *cpi); -void vp10_init_second_pass(struct VP9_COMP *cpi); -void vp10_rc_get_second_pass_params(struct VP9_COMP *cpi); -void vp10_twopass_postencode_update(struct VP9_COMP *cpi); +void vp10_init_second_pass(struct VP10_COMP *cpi); +void vp10_rc_get_second_pass_params(struct VP10_COMP *cpi); +void vp10_twopass_postencode_update(struct VP10_COMP *cpi); // Post encode update of the rate control parameters for 2-pass -void vp10_twopass_postencode_update(struct VP9_COMP *cpi); +void vp10_twopass_postencode_update(struct VP10_COMP *cpi); -void vp10_init_subsampling(struct VP9_COMP *cpi); +void vp10_init_subsampling(struct VP10_COMP *cpi); -void vp10_calculate_coded_size(struct VP9_COMP *cpi, +void vp10_calculate_coded_size(struct VP10_COMP *cpi, int *scaled_frame_width, int *scaled_frame_height); diff --git a/vp10/encoder/mbgraph.c b/vp10/encoder/mbgraph.c index 8fa70aea8..61496708f 100644 --- a/vp10/encoder/mbgraph.c +++ b/vp10/encoder/mbgraph.c @@ -22,7 +22,7 @@ #include "vp10/common/reconintra.h" -static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi, +static unsigned int do_16x16_motion_iteration(VP10_COMP *cpi, const MV *ref_mv, MV *dst_mv, int mb_row, @@ -81,7 +81,7 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi, xd->plane[0].dst.buf, xd->plane[0].dst.stride); } -static int do_16x16_motion_search(VP9_COMP *cpi, const MV *ref_mv, +static int do_16x16_motion_search(VP10_COMP *cpi, const MV *ref_mv, int_mv *dst_mv, int mb_row, int mb_col) { MACROBLOCK *const x = &cpi->td.mb; MACROBLOCKD *const xd = &x->e_mbd; @@ -119,7 +119,7 @@ static int do_16x16_motion_search(VP9_COMP *cpi, const MV *ref_mv, return err; } -static int do_16x16_zerozero_search(VP9_COMP *cpi, int_mv *dst_mv) { +static int do_16x16_zerozero_search(VP10_COMP *cpi, int_mv *dst_mv) { MACROBLOCK *const x = &cpi->td.mb; MACROBLOCKD *const xd = &x->e_mbd; unsigned int err; @@ -133,7 +133,7 @@ static int do_16x16_zerozero_search(VP9_COMP *cpi, int_mv *dst_mv) { return err; } -static int find_best_16x16_intra(VP9_COMP *cpi, PREDICTION_MODE *pbest_mode) { +static int find_best_16x16_intra(VP10_COMP *cpi, PREDICTION_MODE *pbest_mode) { MACROBLOCK *const x = &cpi->td.mb; MACROBLOCKD *const xd = &x->e_mbd; PREDICTION_MODE best_mode = -1, mode; @@ -167,7 +167,7 @@ static int find_best_16x16_intra(VP9_COMP *cpi, PREDICTION_MODE *pbest_mode) { static void update_mbgraph_mb_stats ( - VP9_COMP *cpi, + VP10_COMP *cpi, MBGRAPH_MB_STATS *stats, YV12_BUFFER_CONFIG *buf, int mb_y_offset, @@ -227,7 +227,7 @@ static void update_mbgraph_mb_stats } } -static void update_mbgraph_frame_stats(VP9_COMP *cpi, +static void update_mbgraph_frame_stats(VP10_COMP *cpi, MBGRAPH_FRAME_STATS *stats, YV12_BUFFER_CONFIG *buf, YV12_BUFFER_CONFIG *golden_ref, @@ -296,7 +296,7 @@ static void update_mbgraph_frame_stats(VP9_COMP *cpi, } // void separate_arf_mbs_byzz -static void separate_arf_mbs(VP9_COMP *cpi) { +static void separate_arf_mbs(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; int mb_col, mb_row, offset, i; int mi_row, mi_col; @@ -374,7 +374,7 @@ static void separate_arf_mbs(VP9_COMP *cpi) { vpx_free(arf_not_zz); } -void vp10_update_mbgraph_stats(VP9_COMP *cpi) { +void vp10_update_mbgraph_stats(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; int i, n_frames = vp10_lookahead_depth(cpi->lookahead); YV12_BUFFER_CONFIG *golden_ref = get_ref_frame_buffer(cpi, GOLDEN_FRAME); diff --git a/vp10/encoder/mbgraph.h b/vp10/encoder/mbgraph.h index f116dd74d..3408464c5 100644 --- a/vp10/encoder/mbgraph.h +++ b/vp10/encoder/mbgraph.h @@ -29,9 +29,9 @@ typedef struct { MBGRAPH_MB_STATS *mb_stats; } MBGRAPH_FRAME_STATS; -struct VP9_COMP; +struct VP10_COMP; -void vp10_update_mbgraph_stats(struct VP9_COMP *cpi); +void vp10_update_mbgraph_stats(struct VP10_COMP *cpi); #ifdef __cplusplus } // extern "C" diff --git a/vp10/encoder/mcomp.c b/vp10/encoder/mcomp.c index 0daa0ee0e..7eb0292bf 100644 --- a/vp10/encoder/mcomp.c +++ b/vp10/encoder/mcomp.c @@ -1786,7 +1786,7 @@ static const MV search_pos[4] = { {-1, 0}, {0, -1}, {0, 1}, {1, 0}, }; -unsigned int vp10_int_pro_motion_estimation(const VP9_COMP *cpi, MACROBLOCK *x, +unsigned int vp10_int_pro_motion_estimation(const VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col) { MACROBLOCKD *xd = &x->e_mbd; @@ -1925,7 +1925,7 @@ unsigned int vp10_int_pro_motion_estimation(const VP9_COMP *cpi, MACROBLOCK *x, /* do_refine: If last step (1-away) of n-step search doesn't pick the center point as the best match, we will do a final 1-away diamond refining search */ -int vp10_full_pixel_diamond(const VP9_COMP *cpi, MACROBLOCK *x, +int vp10_full_pixel_diamond(const VP10_COMP *cpi, MACROBLOCK *x, MV *mvp_full, int step_param, int sadpb, int further_steps, int do_refine, int *cost_list, @@ -2302,7 +2302,7 @@ int vp10_refining_search_8p_c(const MACROBLOCK *x, return best_sad; } -int vp10_full_pixel_search(VP9_COMP *cpi, MACROBLOCK *x, +int vp10_full_pixel_search(VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, MV *mvp_full, int step_param, int error_per_bit, int *cost_list, diff --git a/vp10/encoder/mcomp.h b/vp10/encoder/mcomp.h index 681698db3..9d1ab2aab 100644 --- a/vp10/encoder/mcomp.h +++ b/vp10/encoder/mcomp.h @@ -61,7 +61,7 @@ int vp10_get_mvpred_av_var(const MACROBLOCK *x, const vp9_variance_fn_ptr_t *vfp, int use_mvcost); -struct VP9_COMP; +struct VP10_COMP; struct SPEED_FEATURES; int vp10_init_search_range(int size); @@ -73,7 +73,7 @@ int vp10_refining_search_sad(const struct macroblock *x, const struct mv *center_mv); // Runs sequence of diamond searches in smaller steps for RD. -int vp10_full_pixel_diamond(const struct VP9_COMP *cpi, MACROBLOCK *x, +int vp10_full_pixel_diamond(const struct VP10_COMP *cpi, MACROBLOCK *x, MV *mvp_full, int step_param, int sadpb, int further_steps, int do_refine, int *cost_list, @@ -81,7 +81,7 @@ int vp10_full_pixel_diamond(const struct VP9_COMP *cpi, MACROBLOCK *x, const MV *ref_mv, MV *dst_mv); // Perform integral projection based motion estimation. -unsigned int vp10_int_pro_motion_estimation(const struct VP9_COMP *cpi, +unsigned int vp10_int_pro_motion_estimation(const struct VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col); @@ -149,9 +149,9 @@ int vp10_refining_search_8p_c(const MACROBLOCK *x, const vp9_variance_fn_ptr_t *fn_ptr, const MV *center_mv, const uint8_t *second_pred); -struct VP9_COMP; +struct VP10_COMP; -int vp10_full_pixel_search(struct VP9_COMP *cpi, MACROBLOCK *x, +int vp10_full_pixel_search(struct VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, MV *mvp_full, int step_param, int error_per_bit, int *cost_list, diff --git a/vp10/encoder/picklpf.c b/vp10/encoder/picklpf.c index 7fe324848..81c428dfe 100644 --- a/vp10/encoder/picklpf.c +++ b/vp10/encoder/picklpf.c @@ -24,7 +24,7 @@ #include "vp10/encoder/picklpf.h" #include "vp10/encoder/quantize.h" -static int get_max_filter_level(const VP9_COMP *cpi) { +static int get_max_filter_level(const VP10_COMP *cpi) { if (cpi->oxcf.pass == 2) { return cpi->twopass.section_intra_rating > 8 ? MAX_LOOP_FILTER * 3 / 4 : MAX_LOOP_FILTER; @@ -35,7 +35,7 @@ static int get_max_filter_level(const VP9_COMP *cpi) { static int64_t try_filter_frame(const YV12_BUFFER_CONFIG *sd, - VP9_COMP *const cpi, + VP10_COMP *const cpi, int filt_level, int partial_frame) { VP10_COMMON *const cm = &cpi->common; int64_t filt_err; @@ -64,7 +64,7 @@ static int64_t try_filter_frame(const YV12_BUFFER_CONFIG *sd, return filt_err; } -static int search_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, +static int search_filter_level(const YV12_BUFFER_CONFIG *sd, VP10_COMP *cpi, int partial_frame) { const VP10_COMMON *const cm = &cpi->common; const struct loopfilter *const lf = &cm->lf; @@ -146,7 +146,7 @@ static int search_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, return filt_best; } -void vp10_pick_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, +void vp10_pick_filter_level(const YV12_BUFFER_CONFIG *sd, VP10_COMP *cpi, LPF_PICK_METHOD method) { VP10_COMMON *const cm = &cpi->common; struct loopfilter *const lf = &cm->lf; diff --git a/vp10/encoder/picklpf.h b/vp10/encoder/picklpf.h index df2b4d786..21a8758ef 100644 --- a/vp10/encoder/picklpf.h +++ b/vp10/encoder/picklpf.h @@ -19,10 +19,10 @@ extern "C" { #include "vp10/encoder/encoder.h" struct yv12_buffer_config; -struct VP9_COMP; +struct VP10_COMP; void vp10_pick_filter_level(const struct yv12_buffer_config *sd, - struct VP9_COMP *cpi, LPF_PICK_METHOD method); + struct VP10_COMP *cpi, LPF_PICK_METHOD method); #ifdef __cplusplus } // extern "C" #endif diff --git a/vp10/encoder/pickmode.c b/vp10/encoder/pickmode.c index 5c0d6af2c..a730b99fa 100644 --- a/vp10/encoder/pickmode.c +++ b/vp10/encoder/pickmode.c @@ -121,7 +121,7 @@ static int mv_refs_rt(const VP10_COMMON *cm, const MACROBLOCK *x, return const_motion; } -static int combined_motion_search(VP9_COMP *cpi, MACROBLOCK *x, +static int combined_motion_search(VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col, int_mv *tmp_mv, int *rate_mv, int64_t best_rd_sofar) { @@ -252,7 +252,7 @@ static void calculate_variance(int bw, int bh, TX_SIZE tx_size, } } -static void model_rd_for_sb_y_large(VP9_COMP *cpi, BLOCK_SIZE bsize, +static void model_rd_for_sb_y_large(VP10_COMP *cpi, BLOCK_SIZE bsize, MACROBLOCK *x, MACROBLOCKD *xd, int *out_rate_sum, int64_t *out_dist_sum, unsigned int *var_y, unsigned int *sse_y, @@ -449,7 +449,7 @@ static void model_rd_for_sb_y_large(VP9_COMP *cpi, BLOCK_SIZE bsize, *out_dist_sum += dist << 4; } -static void model_rd_for_sb_y(VP9_COMP *cpi, BLOCK_SIZE bsize, +static void model_rd_for_sb_y(VP10_COMP *cpi, BLOCK_SIZE bsize, MACROBLOCK *x, MACROBLOCKD *xd, int *out_rate_sum, int64_t *out_dist_sum, unsigned int *var_y, unsigned int *sse_y) { @@ -561,7 +561,7 @@ static void model_rd_for_sb_y(VP9_COMP *cpi, BLOCK_SIZE bsize, } #if CONFIG_VP9_HIGHBITDEPTH -static void block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int64_t *dist, +static void block_yrd(VP10_COMP *cpi, MACROBLOCK *x, int *rate, int64_t *dist, int *skippable, int64_t *sse, int plane, BLOCK_SIZE bsize, TX_SIZE tx_size) { MACROBLOCKD *xd = &x->e_mbd; @@ -574,7 +574,7 @@ static void block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int64_t *dist, return; } #else -static void block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int64_t *dist, +static void block_yrd(VP10_COMP *cpi, MACROBLOCK *x, int *rate, int64_t *dist, int *skippable, int64_t *sse, int plane, BLOCK_SIZE bsize, TX_SIZE tx_size) { MACROBLOCKD *xd = &x->e_mbd; @@ -687,7 +687,7 @@ static void block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int64_t *dist, } #endif -static void model_rd_for_sb_uv(VP9_COMP *cpi, BLOCK_SIZE bsize, +static void model_rd_for_sb_uv(VP10_COMP *cpi, BLOCK_SIZE bsize, MACROBLOCK *x, MACROBLOCKD *xd, int *out_rate_sum, int64_t *out_dist_sum, unsigned int *var_y, unsigned int *sse_y) { @@ -769,7 +769,7 @@ static void free_pred_buffer(PRED_BUFFER *p) { p->in_use = 0; } -static void encode_breakout_test(VP9_COMP *cpi, MACROBLOCK *x, +static void encode_breakout_test(VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col, MV_REFERENCE_FRAME ref_frame, PREDICTION_MODE this_mode, @@ -869,7 +869,7 @@ static void encode_breakout_test(VP9_COMP *cpi, MACROBLOCK *x, } struct estimate_block_intra_args { - VP9_COMP *cpi; + VP10_COMP *cpi; MACROBLOCK *x; PREDICTION_MODE mode; int rate; @@ -879,7 +879,7 @@ struct estimate_block_intra_args { static void estimate_block_intra(int plane, int block, BLOCK_SIZE plane_bsize, TX_SIZE tx_size, void *arg) { struct estimate_block_intra_args* const args = arg; - VP9_COMP *const cpi = args->cpi; + VP10_COMP *const cpi = args->cpi; MACROBLOCK *const x = args->x; MACROBLOCKD *const xd = &x->e_mbd; struct macroblock_plane *const p = &x->plane[0]; @@ -950,7 +950,7 @@ static int mode_offset(const PREDICTION_MODE mode) { } } -static INLINE void update_thresh_freq_fact(VP9_COMP *cpi, +static INLINE void update_thresh_freq_fact(VP10_COMP *cpi, TileDataEnc *tile_data, BLOCK_SIZE bsize, MV_REFERENCE_FRAME ref_frame, @@ -965,7 +965,7 @@ static INLINE void update_thresh_freq_fact(VP9_COMP *cpi, cpi->sf.adaptive_rd_thresh * RD_THRESH_MAX_FACT); } -void vp10_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x, RD_COST *rd_cost, +void vp10_pick_intra_mode(VP10_COMP *cpi, MACROBLOCK *x, RD_COST *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) { MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; @@ -1053,7 +1053,7 @@ static const REF_MODE ref_mode_set[RT_INTER_MODES] = { // TODO(jingning) placeholder for inter-frame non-RD mode decision. // this needs various further optimizations. to be continued.. -void vp10_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, +void vp10_pick_inter_mode(VP10_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data, int mi_row, int mi_col, RD_COST *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) { @@ -1621,7 +1621,7 @@ void vp10_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, *rd_cost = best_rdc; } -void vp10_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x, +void vp10_pick_inter_mode_sub8x8(VP10_COMP *cpi, MACROBLOCK *x, int mi_row, int mi_col, RD_COST *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) { VP10_COMMON *const cm = &cpi->common; diff --git a/vp10/encoder/pickmode.h b/vp10/encoder/pickmode.h index 703c32615..b596f535d 100644 --- a/vp10/encoder/pickmode.h +++ b/vp10/encoder/pickmode.h @@ -17,16 +17,16 @@ extern "C" { #endif -void vp10_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x, RD_COST *rd_cost, +void vp10_pick_intra_mode(VP10_COMP *cpi, MACROBLOCK *x, RD_COST *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx); -void vp10_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, +void vp10_pick_inter_mode(VP10_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data, int mi_row, int mi_col, RD_COST *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx); -void vp10_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x, +void vp10_pick_inter_mode_sub8x8(VP10_COMP *cpi, MACROBLOCK *x, int mi_row, int mi_col, RD_COST *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx); diff --git a/vp10/encoder/quantize.c b/vp10/encoder/quantize.c index a17fec825..86b324f1a 100644 --- a/vp10/encoder/quantize.c +++ b/vp10/encoder/quantize.c @@ -248,7 +248,7 @@ static int get_qzbin_factor(int q, vpx_bit_depth_t bit_depth) { #endif } -void vp10_init_quantizer(VP9_COMP *cpi) { +void vp10_init_quantizer(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; QUANTS *const quants = &cpi->quants; int i, q, quant; @@ -304,7 +304,7 @@ void vp10_init_quantizer(VP9_COMP *cpi) { } } -void vp10_init_plane_quantizers(VP9_COMP *cpi, MACROBLOCK *x) { +void vp10_init_plane_quantizers(VP10_COMP *cpi, MACROBLOCK *x) { const VP10_COMMON *const cm = &cpi->common; MACROBLOCKD *const xd = &x->e_mbd; QUANTS *const quants = &cpi->quants; @@ -348,7 +348,7 @@ void vp10_init_plane_quantizers(VP9_COMP *cpi, MACROBLOCK *x) { vp10_initialize_me_consts(cpi, x, x->q_index); } -void vp10_frame_init_quantizer(VP9_COMP *cpi) { +void vp10_frame_init_quantizer(VP10_COMP *cpi) { vp10_init_plane_quantizers(cpi, &cpi->td.mb); } diff --git a/vp10/encoder/quantize.h b/vp10/encoder/quantize.h index 7754f8326..fb9bd92da 100644 --- a/vp10/encoder/quantize.h +++ b/vp10/encoder/quantize.h @@ -40,14 +40,14 @@ typedef struct { void vp10_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block, const int16_t *scan, const int16_t *iscan); -struct VP9_COMP; +struct VP10_COMP; struct VP9Common; -void vp10_frame_init_quantizer(struct VP9_COMP *cpi); +void vp10_frame_init_quantizer(struct VP10_COMP *cpi); -void vp10_init_plane_quantizers(struct VP9_COMP *cpi, MACROBLOCK *x); +void vp10_init_plane_quantizers(struct VP10_COMP *cpi, MACROBLOCK *x); -void vp10_init_quantizer(struct VP9_COMP *cpi); +void vp10_init_quantizer(struct VP10_COMP *cpi); void vp10_set_quantizer(struct VP9Common *cm, int q); diff --git a/vp10/encoder/ratectrl.c b/vp10/encoder/ratectrl.c index 37a7574d0..33c658a50 100644 --- a/vp10/encoder/ratectrl.c +++ b/vp10/encoder/ratectrl.c @@ -196,7 +196,7 @@ int vp10_estimate_bits_at_q(FRAME_TYPE frame_type, int q, int mbs, (int)((uint64_t)bpm * mbs) >> BPER_MB_NORMBITS); } -int vp10_rc_clamp_pframe_target_size(const VP9_COMP *const cpi, int target) { +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 int min_frame_target = MAX(rc->min_frame_bandwidth, @@ -221,7 +221,7 @@ int vp10_rc_clamp_pframe_target_size(const VP9_COMP *const cpi, int target) { return target; } -int vp10_rc_clamp_iframe_target_size(const VP9_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; if (oxcf->rc_max_intra_bitrate_pct) { @@ -256,7 +256,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) { +static void update_buffer_level(VP10_COMP *cpi, int encoded_frame_size) { const VP10_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; @@ -358,7 +358,7 @@ void vp10_rc_init(const VP9EncoderConfig *oxcf, int pass, RATE_CONTROL *rc) { rc->baseline_gf_interval = (rc->min_gf_interval + rc->max_gf_interval) / 2; } -int vp10_rc_drop_frame(VP9_COMP *cpi) { +int vp10_rc_drop_frame(VP10_COMP *cpi) { const VP9EncoderConfig *oxcf = &cpi->oxcf; RATE_CONTROL *const rc = &cpi->rc; @@ -396,7 +396,7 @@ int vp10_rc_drop_frame(VP9_COMP *cpi) { } } -static double get_rate_correction_factor(const VP9_COMP *cpi) { +static double get_rate_correction_factor(const VP10_COMP *cpi) { const RATE_CONTROL *const rc = &cpi->rc; double rcf; @@ -418,7 +418,7 @@ static double get_rate_correction_factor(const VP9_COMP *cpi) { return fclamp(rcf, MIN_BPB_FACTOR, MAX_BPB_FACTOR); } -static void set_rate_correction_factor(VP9_COMP *cpi, double factor) { +static void set_rate_correction_factor(VP10_COMP *cpi, double factor) { RATE_CONTROL *const rc = &cpi->rc; // Normalize RCF to account for the size-dependent scaling factor. @@ -442,7 +442,7 @@ static void set_rate_correction_factor(VP9_COMP *cpi, double factor) { } } -void vp10_rc_update_rate_correction_factors(VP9_COMP *cpi) { +void vp10_rc_update_rate_correction_factors(VP10_COMP *cpi) { const VP10_COMMON *const cm = &cpi->common; int correction_factor = 100; double rate_correction_factor = get_rate_correction_factor(cpi); @@ -513,7 +513,7 @@ void vp10_rc_update_rate_correction_factors(VP9_COMP *cpi) { } -int vp10_rc_regulate_q(const VP9_COMP *cpi, int target_bits_per_frame, +int vp10_rc_regulate_q(const VP10_COMP *cpi, int target_bits_per_frame, int active_best_quality, int active_worst_quality) { const VP10_COMMON *const cm = &cpi->common; int q = active_worst_quality; @@ -599,7 +599,7 @@ static int get_gf_active_quality(const RATE_CONTROL *const rc, int q, arfgf_low_motion_minq, arfgf_high_motion_minq); } -static int calc_active_worst_quality_one_pass_vbr(const VP9_COMP *cpi) { +static int calc_active_worst_quality_one_pass_vbr(const VP10_COMP *cpi) { const RATE_CONTROL *const rc = &cpi->rc; const unsigned int curr_frame = cpi->common.current_video_frame; int active_worst_quality; @@ -621,7 +621,7 @@ static int calc_active_worst_quality_one_pass_vbr(const VP9_COMP *cpi) { } // Adjust active_worst_quality level based on buffer level. -static int calc_active_worst_quality_one_pass_cbr(const VP9_COMP *cpi) { +static int calc_active_worst_quality_one_pass_cbr(const VP10_COMP *cpi) { // Adjust active_worst_quality: If buffer is above the optimal/target level, // bring active_worst_quality down depending on fullness of buffer. // If buffer is below the optimal level, let the active_worst_quality go from @@ -677,7 +677,7 @@ static int calc_active_worst_quality_one_pass_cbr(const VP9_COMP *cpi) { return active_worst_quality; } -static int rc_pick_q_and_bounds_one_pass_cbr(const VP9_COMP *cpi, +static int rc_pick_q_and_bounds_one_pass_cbr(const VP10_COMP *cpi, int *bottom_index, int *top_index) { const VP10_COMMON *const cm = &cpi->common; @@ -809,7 +809,7 @@ static int get_active_cq_level(const RATE_CONTROL *rc, return active_cq_level; } -static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi, +static int rc_pick_q_and_bounds_one_pass_vbr(const VP10_COMP *cpi, int *bottom_index, int *top_index) { const VP10_COMMON *const cm = &cpi->common; @@ -960,7 +960,7 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi, return q; } -int vp10_frame_type_qdelta(const VP9_COMP *cpi, int rf_level, int q) { +int vp10_frame_type_qdelta(const VP10_COMP *cpi, int rf_level, int q) { static const double rate_factor_deltas[RATE_FACTOR_LEVELS] = { 1.00, // INTER_NORMAL 1.00, // INTER_HIGH @@ -978,7 +978,7 @@ int vp10_frame_type_qdelta(const VP9_COMP *cpi, int rf_level, int q) { } #define STATIC_MOTION_THRESH 95 -static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi, +static int rc_pick_q_and_bounds_two_pass(const VP10_COMP *cpi, int *bottom_index, int *top_index) { const VP10_COMMON *const cm = &cpi->common; @@ -1169,7 +1169,7 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi, return q; } -int vp10_rc_pick_q_and_bounds(const VP9_COMP *cpi, +int vp10_rc_pick_q_and_bounds(const VP10_COMP *cpi, int *bottom_index, int *top_index) { int q; if (cpi->oxcf.pass == 0) { @@ -1192,7 +1192,7 @@ int vp10_rc_pick_q_and_bounds(const VP9_COMP *cpi, return q; } -void vp10_rc_compute_frame_size_bounds(const VP9_COMP *cpi, +void vp10_rc_compute_frame_size_bounds(const VP10_COMP *cpi, int frame_target, int *frame_under_shoot_limit, int *frame_over_shoot_limit) { @@ -1209,7 +1209,7 @@ void vp10_rc_compute_frame_size_bounds(const VP9_COMP *cpi, } } -void vp10_rc_set_frame_target(VP9_COMP *cpi, int target) { +void vp10_rc_set_frame_target(VP10_COMP *cpi, int target) { const VP10_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; @@ -1226,7 +1226,7 @@ void vp10_rc_set_frame_target(VP9_COMP *cpi, int target) { (cm->width * cm->height); } -static void update_alt_ref_frame_stats(VP9_COMP *cpi) { +static void update_alt_ref_frame_stats(VP10_COMP *cpi) { // this frame refreshes means next frames don't unless specified by user RATE_CONTROL *const rc = &cpi->rc; rc->frames_since_golden = 0; @@ -1238,7 +1238,7 @@ static void update_alt_ref_frame_stats(VP9_COMP *cpi) { rc->source_alt_ref_active = 1; } -static void update_golden_frame_stats(VP9_COMP *cpi) { +static void update_golden_frame_stats(VP10_COMP *cpi) { RATE_CONTROL *const rc = &cpi->rc; // Update the Golden frame usage counts. @@ -1265,7 +1265,7 @@ static void update_golden_frame_stats(VP9_COMP *cpi) { } } -void vp10_rc_postencode_update(VP9_COMP *cpi, uint64_t bytes_used) { +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; RATE_CONTROL *const rc = &cpi->rc; @@ -1362,7 +1362,7 @@ void vp10_rc_postencode_update(VP9_COMP *cpi, uint64_t bytes_used) { } } -void vp10_rc_postencode_update_drop_frame(VP9_COMP *cpi) { +void vp10_rc_postencode_update_drop_frame(VP10_COMP *cpi) { // Update buffer level with zero size, update frame counters, and return. update_buffer_level(cpi, 0); cpi->rc.frames_since_key++; @@ -1374,7 +1374,7 @@ void vp10_rc_postencode_update_drop_frame(VP9_COMP *cpi) { // Use this macro to turn on/off use of alt-refs in one-pass mode. #define USE_ALTREF_FOR_ONE_PASS 1 -static int calc_pframe_target_size_one_pass_vbr(const VP9_COMP *const cpi) { +static int calc_pframe_target_size_one_pass_vbr(const VP10_COMP *const cpi) { static const int af_ratio = 10; const RATE_CONTROL *const rc = &cpi->rc; int target; @@ -1391,14 +1391,14 @@ static int calc_pframe_target_size_one_pass_vbr(const VP9_COMP *const cpi) { return vp10_rc_clamp_pframe_target_size(cpi, target); } -static int calc_iframe_target_size_one_pass_vbr(const VP9_COMP *const cpi) { +static int calc_iframe_target_size_one_pass_vbr(const VP10_COMP *const cpi) { static const int kf_ratio = 25; const RATE_CONTROL *rc = &cpi->rc; const int target = rc->avg_frame_bandwidth * kf_ratio; return vp10_rc_clamp_iframe_target_size(cpi, target); } -void vp10_rc_get_one_pass_vbr_params(VP9_COMP *cpi) { +void vp10_rc_get_one_pass_vbr_params(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; int target; @@ -1438,7 +1438,7 @@ void vp10_rc_get_one_pass_vbr_params(VP9_COMP *cpi) { vp10_rc_set_frame_target(cpi, target); } -static int calc_pframe_target_size_one_pass_cbr(const VP9_COMP *cpi) { +static int calc_pframe_target_size_one_pass_cbr(const VP10_COMP *cpi) { const VP9EncoderConfig *oxcf = &cpi->oxcf; const RATE_CONTROL *rc = &cpi->rc; const SVC *const svc = &cpi->svc; @@ -1485,7 +1485,7 @@ static int calc_pframe_target_size_one_pass_cbr(const VP9_COMP *cpi) { return MAX(min_frame_target, target); } -static int calc_iframe_target_size_one_pass_cbr(const VP9_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 SVC *const svc = &cpi->svc; @@ -1516,7 +1516,7 @@ static int calc_iframe_target_size_one_pass_cbr(const VP9_COMP *cpi) { // Reset information needed to set proper reference frames and buffer updates // for temporal layering. This is called when a key frame is encoded. -static void reset_temporal_layer_to_zero(VP9_COMP *cpi) { +static void reset_temporal_layer_to_zero(VP10_COMP *cpi) { int sl; LAYER_CONTEXT *lc = NULL; cpi->svc.temporal_layer_id = 0; @@ -1528,7 +1528,7 @@ static void reset_temporal_layer_to_zero(VP9_COMP *cpi) { } } -void vp10_rc_get_svc_params(VP9_COMP *cpi) { +void vp10_rc_get_svc_params(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; int target = rc->avg_frame_bandwidth; @@ -1590,7 +1590,7 @@ void vp10_rc_get_svc_params(VP9_COMP *cpi) { rc->baseline_gf_interval = INT_MAX; } -void vp10_rc_get_one_pass_cbr_params(VP9_COMP *cpi) { +void vp10_rc_get_one_pass_cbr_params(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; int target; @@ -1686,7 +1686,7 @@ int vp10_compute_qdelta_by_rate(const RATE_CONTROL *rc, FRAME_TYPE frame_type, return target_index - qindex; } -void vp10_rc_set_gf_interval_range(const VP9_COMP *const cpi, +void vp10_rc_set_gf_interval_range(const VP10_COMP *const cpi, RATE_CONTROL *const rc) { const VP9EncoderConfig *const oxcf = &cpi->oxcf; @@ -1715,7 +1715,7 @@ void vp10_rc_set_gf_interval_range(const VP9_COMP *const cpi, rc->min_gf_interval = MIN(rc->min_gf_interval, rc->max_gf_interval); } -void vp10_rc_update_framerate(VP9_COMP *cpi) { +void vp10_rc_update_framerate(VP10_COMP *cpi) { const VP10_COMMON *const cm = &cpi->common; const VP9EncoderConfig *const oxcf = &cpi->oxcf; RATE_CONTROL *const rc = &cpi->rc; @@ -1744,7 +1744,7 @@ void vp10_rc_update_framerate(VP9_COMP *cpi) { #define VBR_PCT_ADJUSTMENT_LIMIT 50 // For VBR...adjustment to the frame target based on error from previous frames -static void vbr_rate_correction(VP9_COMP *cpi, int *this_frame_target) { +static void vbr_rate_correction(VP10_COMP *cpi, int *this_frame_target) { RATE_CONTROL *const rc = &cpi->rc; int64_t vbr_bits_off_target = rc->vbr_bits_off_target; int max_delta; @@ -1786,7 +1786,7 @@ static void vbr_rate_correction(VP9_COMP *cpi, int *this_frame_target) { } } -void vp10_set_target_rate(VP9_COMP *cpi) { +void vp10_set_target_rate(VP10_COMP *cpi) { RATE_CONTROL *const rc = &cpi->rc; int target_rate = rc->base_frame_target; @@ -1798,7 +1798,7 @@ void vp10_set_target_rate(VP9_COMP *cpi) { // Check if we should resize, based on average QP from past x frames. // Only allow for resize at most one scale down for now, scaling factor is 2. -int vp10_resize_one_pass_cbr(VP9_COMP *cpi) { +int vp10_resize_one_pass_cbr(VP10_COMP *cpi) { const VP10_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; int resize_now = 0; diff --git a/vp10/encoder/ratectrl.h b/vp10/encoder/ratectrl.h index 696a05561..2ec511794 100644 --- a/vp10/encoder/ratectrl.h +++ b/vp10/encoder/ratectrl.h @@ -144,7 +144,7 @@ typedef struct { int rf_level_maxq[RATE_FACTOR_LEVELS]; } RATE_CONTROL; -struct VP9_COMP; +struct VP10_COMP; struct VP9EncoderConfig; void vp10_rc_init(const struct VP9EncoderConfig *oxcf, int pass, @@ -188,37 +188,37 @@ int vp10_rc_get_default_max_gf_interval(double framerate, int min_frame_rate); // Functions to set parameters for encoding before the actual // encode_frame_to_data_rate() function. -void vp10_rc_get_one_pass_vbr_params(struct VP9_COMP *cpi); -void vp10_rc_get_one_pass_cbr_params(struct VP9_COMP *cpi); -void vp10_rc_get_svc_params(struct VP9_COMP *cpi); +void vp10_rc_get_one_pass_vbr_params(struct VP10_COMP *cpi); +void vp10_rc_get_one_pass_cbr_params(struct VP10_COMP *cpi); +void vp10_rc_get_svc_params(struct VP10_COMP *cpi); // Post encode update of the rate control parameters based // on bytes used -void vp10_rc_postencode_update(struct VP9_COMP *cpi, uint64_t bytes_used); +void vp10_rc_postencode_update(struct VP10_COMP *cpi, uint64_t bytes_used); // Post encode update of the rate control parameters for dropped frames -void vp10_rc_postencode_update_drop_frame(struct VP9_COMP *cpi); +void vp10_rc_postencode_update_drop_frame(struct VP10_COMP *cpi); // Updates rate correction factors // Changes only the rate correction factors in the rate control structure. -void vp10_rc_update_rate_correction_factors(struct VP9_COMP *cpi); +void vp10_rc_update_rate_correction_factors(struct VP10_COMP *cpi); // Decide if we should drop this frame: For 1-pass CBR. // Changes only the decimation count in the rate control structure -int vp10_rc_drop_frame(struct VP9_COMP *cpi); +int vp10_rc_drop_frame(struct VP10_COMP *cpi); // Computes frame size bounds. -void vp10_rc_compute_frame_size_bounds(const struct VP9_COMP *cpi, +void vp10_rc_compute_frame_size_bounds(const struct VP10_COMP *cpi, int this_frame_target, int *frame_under_shoot_limit, int *frame_over_shoot_limit); // Picks q and q bounds given the target for bits -int vp10_rc_pick_q_and_bounds(const struct VP9_COMP *cpi, +int vp10_rc_pick_q_and_bounds(const struct VP10_COMP *cpi, int *bottom_index, int *top_index); // Estimates q to achieve a target bits per frame -int vp10_rc_regulate_q(const struct VP9_COMP *cpi, int target_bits_per_frame, +int vp10_rc_regulate_q(const struct VP10_COMP *cpi, int target_bits_per_frame, int active_best_quality, int active_worst_quality); // Estimates bits per mb for a given qindex and correction factor. @@ -226,13 +226,13 @@ int vp10_rc_bits_per_mb(FRAME_TYPE frame_type, int qindex, double correction_factor, vpx_bit_depth_t bit_depth); // Clamping utilities for bitrate targets for iframes and pframes. -int vp10_rc_clamp_iframe_target_size(const struct VP9_COMP *const cpi, +int vp10_rc_clamp_iframe_target_size(const struct VP10_COMP *const cpi, int target); -int vp10_rc_clamp_pframe_target_size(const struct VP9_COMP *const cpi, +int vp10_rc_clamp_pframe_target_size(const struct VP10_COMP *const cpi, int target); // Utility to set frame_target into the RATE_CONTROL structure // This function is called only from the vp10_rc_get_..._params() functions. -void vp10_rc_set_frame_target(struct VP9_COMP *cpi, int target); +void vp10_rc_set_frame_target(struct VP10_COMP *cpi, int target); // Computes a q delta (in "q index" terms) to get from a starting q value // to a target q value @@ -245,16 +245,16 @@ int vp10_compute_qdelta_by_rate(const RATE_CONTROL *rc, FRAME_TYPE frame_type, int qindex, double rate_target_ratio, vpx_bit_depth_t bit_depth); -int vp10_frame_type_qdelta(const struct VP9_COMP *cpi, int rf_level, int q); +int vp10_frame_type_qdelta(const struct VP10_COMP *cpi, int rf_level, int q); -void vp10_rc_update_framerate(struct VP9_COMP *cpi); +void vp10_rc_update_framerate(struct VP10_COMP *cpi); -void vp10_rc_set_gf_interval_range(const struct VP9_COMP *const cpi, +void vp10_rc_set_gf_interval_range(const struct VP10_COMP *const cpi, RATE_CONTROL *const rc); -void vp10_set_target_rate(struct VP9_COMP *cpi); +void vp10_set_target_rate(struct VP10_COMP *cpi); -int vp10_resize_one_pass_cbr(struct VP9_COMP *cpi); +int vp10_resize_one_pass_cbr(struct VP10_COMP *cpi); #ifdef __cplusplus } // extern "C" diff --git a/vp10/encoder/rd.c b/vp10/encoder/rd.c index eb8be1614..999a6ac26 100644 --- a/vp10/encoder/rd.c +++ b/vp10/encoder/rd.c @@ -65,7 +65,7 @@ static const uint8_t rd_thresh_block_size_factor[BLOCK_SIZES] = { 2, 3, 3, 4, 6, 6, 8, 12, 12, 16, 24, 24, 32 }; -static void fill_mode_costs(VP9_COMP *cpi) { +static void fill_mode_costs(VP10_COMP *cpi) { const FRAME_CONTEXT *const fc = cpi->common.fc; int i, j; @@ -148,7 +148,7 @@ static const int rd_frame_type_factor[FRAME_UPDATE_TYPES] = { 128, 144, 128, 128, 144 }; -int vp10_compute_rd_mult(const VP9_COMP *cpi, int qindex) { +int vp10_compute_rd_mult(const VP10_COMP *cpi, int qindex) { const int64_t q = vp10_dc_quant(qindex, 0, cpi->common.bit_depth); #if CONFIG_VP9_HIGHBITDEPTH int64_t rdmult = 0; @@ -205,7 +205,7 @@ static int compute_rd_thresh_factor(int qindex, vpx_bit_depth_t bit_depth) { return MAX((int)(pow(q, RD_THRESH_POW) * 5.12), 8); } -void vp10_initialize_me_consts(VP9_COMP *cpi, MACROBLOCK *x, int qindex) { +void vp10_initialize_me_consts(VP10_COMP *cpi, MACROBLOCK *x, int qindex) { #if CONFIG_VP9_HIGHBITDEPTH switch (cpi->common.bit_depth) { case VPX_BITS_8: @@ -262,7 +262,7 @@ static void set_block_thresholds(const VP10_COMMON *cm, RD_OPT *rd) { } } -void vp10_initialize_rd_consts(VP9_COMP *cpi) { +void vp10_initialize_rd_consts(VP10_COMP *cpi) { VP10_COMMON *const cm = &cpi->common; MACROBLOCK *const x = &cpi->td.mb; MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; @@ -449,7 +449,7 @@ void vp10_get_entropy_contexts(BLOCK_SIZE bsize, TX_SIZE tx_size, } } -void vp10_mv_pred(VP9_COMP *cpi, MACROBLOCK *x, +void vp10_mv_pred(VP10_COMP *cpi, MACROBLOCK *x, uint8_t *ref_y_buffer, int ref_y_stride, int ref_frame, BLOCK_SIZE block_size) { int i; @@ -541,7 +541,7 @@ int16_t* vp10_raster_block_offset_int16(BLOCK_SIZE plane_bsize, return base + vp10_raster_block_offset(plane_bsize, raster_block, stride); } -YV12_BUFFER_CONFIG *vp10_get_scaled_ref_frame(const VP9_COMP *cpi, +YV12_BUFFER_CONFIG *vp10_get_scaled_ref_frame(const VP10_COMP *cpi, int ref_frame) { const VP10_COMMON *const cm = &cpi->common; const int scaled_idx = cpi->scaled_ref_idx[ref_frame - 1]; @@ -551,14 +551,15 @@ YV12_BUFFER_CONFIG *vp10_get_scaled_ref_frame(const VP9_COMP *cpi, &cm->buffer_pool->frame_bufs[scaled_idx].buf : NULL; } -int vp10_get_switchable_rate(const VP9_COMP *cpi, const MACROBLOCKD *const xd) { +int vp10_get_switchable_rate(const VP10_COMP *cpi, + const MACROBLOCKD *const xd) { const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; const int ctx = vp10_get_pred_context_switchable_interp(xd); return SWITCHABLE_INTERP_RATE_FACTOR * cpi->switchable_interp_costs[ctx][mbmi->interp_filter]; } -void vp10_set_rd_speed_thresholds(VP9_COMP *cpi) { +void vp10_set_rd_speed_thresholds(VP10_COMP *cpi) { int i; RD_OPT *const rd = &cpi->rd; SPEED_FEATURES *const sf = &cpi->sf; @@ -612,7 +613,7 @@ void vp10_set_rd_speed_thresholds(VP9_COMP *cpi) { rd->thresh_mult[THR_D63_PRED] += 2500; } -void vp10_set_rd_speed_thresholds_sub8x8(VP9_COMP *cpi) { +void vp10_set_rd_speed_thresholds_sub8x8(VP10_COMP *cpi) { static const int thresh_mult[2][MAX_REFS] = {{2500, 2500, 2500, 4500, 4500, 2500}, {2000, 2000, 2000, 4000, 4000, 2000}}; diff --git a/vp10/encoder/rd.h b/vp10/encoder/rd.h index b343e2452..cd58bf84f 100644 --- a/vp10/encoder/rd.h +++ b/vp10/encoder/rd.h @@ -123,20 +123,21 @@ void vp10_rd_cost_init(RD_COST *rd_cost); struct TileInfo; struct TileDataEnc; -struct VP9_COMP; +struct VP10_COMP; struct macroblock; -int vp10_compute_rd_mult(const struct VP9_COMP *cpi, int qindex); +int vp10_compute_rd_mult(const struct VP10_COMP *cpi, int qindex); -void vp10_initialize_rd_consts(struct VP9_COMP *cpi); +void vp10_initialize_rd_consts(struct VP10_COMP *cpi); -void vp10_initialize_me_consts(struct VP9_COMP *cpi, MACROBLOCK *x, int qindex); +void vp10_initialize_me_consts(struct VP10_COMP *cpi, + MACROBLOCK *x, int qindex); void vp10_model_rd_from_var_lapndz(unsigned int var, unsigned int n, unsigned int qstep, int *rate, int64_t *dist); -int vp10_get_switchable_rate(const struct VP9_COMP *cpi, +int vp10_get_switchable_rate(const struct VP10_COMP *cpi, const MACROBLOCKD *const xd); int vp10_raster_block_offset(BLOCK_SIZE plane_bsize, @@ -145,7 +146,7 @@ int vp10_raster_block_offset(BLOCK_SIZE plane_bsize, int16_t* vp10_raster_block_offset_int16(BLOCK_SIZE plane_bsize, int raster_block, int16_t *base); -YV12_BUFFER_CONFIG *vp10_get_scaled_ref_frame(const struct VP9_COMP *cpi, +YV12_BUFFER_CONFIG *vp10_get_scaled_ref_frame(const struct VP10_COMP *cpi, int ref_frame); void vp10_init_me_luts(void); @@ -155,9 +156,9 @@ void vp10_get_entropy_contexts(BLOCK_SIZE bsize, TX_SIZE tx_size, ENTROPY_CONTEXT t_above[16], ENTROPY_CONTEXT t_left[16]); -void vp10_set_rd_speed_thresholds(struct VP9_COMP *cpi); +void vp10_set_rd_speed_thresholds(struct VP10_COMP *cpi); -void vp10_set_rd_speed_thresholds_sub8x8(struct VP9_COMP *cpi); +void vp10_set_rd_speed_thresholds_sub8x8(struct VP10_COMP *cpi); void vp10_update_rd_thresh_fact(int (*fact)[MAX_MODES], int rd_thresh, int bsize, int best_mode_index); @@ -167,7 +168,7 @@ static INLINE int rd_less_than_thresh(int64_t best_rd, int thresh, return best_rd < ((int64_t)thresh * thresh_fact >> 5) || thresh == INT_MAX; } -void vp10_mv_pred(struct VP9_COMP *cpi, MACROBLOCK *x, +void vp10_mv_pred(struct VP10_COMP *cpi, MACROBLOCK *x, uint8_t *ref_y_buffer, int ref_y_stride, int ref_frame, BLOCK_SIZE block_size); diff --git a/vp10/encoder/rdopt.c b/vp10/encoder/rdopt.c index eca3e04b8..5f1ed365d 100644 --- a/vp10/encoder/rdopt.c +++ b/vp10/encoder/rdopt.c @@ -154,7 +154,7 @@ static void swap_block_ptr(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx, } } -static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize, +static void model_rd_for_sb(VP10_COMP *cpi, BLOCK_SIZE bsize, MACROBLOCK *x, MACROBLOCKD *xd, int *out_rate_sum, int64_t *out_dist_sum, int *skip_txfm_sb, int64_t *skip_sse_sb) { @@ -586,7 +586,7 @@ static void txfm_rd_in_plane(MACROBLOCK *x, } } -static void choose_largest_tx_size(VP9_COMP *cpi, MACROBLOCK *x, +static void choose_largest_tx_size(VP10_COMP *cpi, MACROBLOCK *x, int *rate, int64_t *distortion, int *skip, int64_t *sse, int64_t ref_best_rd, @@ -604,7 +604,7 @@ static void choose_largest_tx_size(VP9_COMP *cpi, MACROBLOCK *x, mbmi->tx_size, cpi->sf.use_fast_coef_costing); } -static void choose_tx_size_from_rd(VP9_COMP *cpi, MACROBLOCK *x, +static void choose_tx_size_from_rd(VP10_COMP *cpi, MACROBLOCK *x, int *rate, int64_t *distortion, int *skip, @@ -685,7 +685,7 @@ static void choose_tx_size_from_rd(VP9_COMP *cpi, MACROBLOCK *x, *psse = sse[mbmi->tx_size]; } -static void super_block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate, +static void super_block_yrd(VP10_COMP *cpi, MACROBLOCK *x, int *rate, int64_t *distortion, int *skip, int64_t *psse, BLOCK_SIZE bs, int64_t ref_best_rd) { @@ -725,7 +725,7 @@ static int conditional_skipintra(PREDICTION_MODE mode, return 0; } -static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, +static int64_t rd_pick_intra4x4block(VP10_COMP *cpi, MACROBLOCK *x, int row, int col, PREDICTION_MODE *best_mode, const int *bmode_costs, @@ -955,7 +955,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, return best_rd; } -static int64_t rd_pick_intra_sub_8x8_y_mode(VP9_COMP *cpi, MACROBLOCK *mb, +static int64_t rd_pick_intra_sub_8x8_y_mode(VP10_COMP *cpi, MACROBLOCK *mb, int *rate, int *rate_y, int64_t *distortion, int64_t best_rd) { @@ -1023,7 +1023,7 @@ static int64_t rd_pick_intra_sub_8x8_y_mode(VP9_COMP *cpi, MACROBLOCK *mb, } // This function is used only for intra_only frames -static int64_t rd_pick_intra_sby_mode(VP9_COMP *cpi, MACROBLOCK *x, +static int64_t rd_pick_intra_sby_mode(VP10_COMP *cpi, MACROBLOCK *x, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, BLOCK_SIZE bsize, @@ -1085,7 +1085,7 @@ static int64_t rd_pick_intra_sby_mode(VP9_COMP *cpi, MACROBLOCK *x, // Return value 0: early termination triggered, no valid rd cost available; // 1: rd cost values are valid. -static int super_block_uvrd(const VP9_COMP *cpi, MACROBLOCK *x, +static int super_block_uvrd(const VP10_COMP *cpi, MACROBLOCK *x, int *rate, int64_t *distortion, int *skippable, int64_t *sse, BLOCK_SIZE bsize, int64_t ref_best_rd) { @@ -1136,7 +1136,7 @@ static int super_block_uvrd(const VP9_COMP *cpi, MACROBLOCK *x, return is_cost_valid; } -static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x, +static int64_t rd_pick_intra_sbuv_mode(VP10_COMP *cpi, MACROBLOCK *x, PICK_MODE_CONTEXT *ctx, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, @@ -1178,7 +1178,7 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x, return best_rd; } -static int64_t rd_sbuv_dcpred(const VP9_COMP *cpi, MACROBLOCK *x, +static int64_t rd_sbuv_dcpred(const VP10_COMP *cpi, MACROBLOCK *x, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, BLOCK_SIZE bsize) { @@ -1193,7 +1193,7 @@ static int64_t rd_sbuv_dcpred(const VP9_COMP *cpi, MACROBLOCK *x, return RDCOST(x->rdmult, x->rddiv, *rate, *distortion); } -static void choose_intra_uv_mode(VP9_COMP *cpi, MACROBLOCK *const x, +static void choose_intra_uv_mode(VP10_COMP *cpi, MACROBLOCK *const x, PICK_MODE_CONTEXT *ctx, BLOCK_SIZE bsize, TX_SIZE max_tx_size, int *rate_uv, int *rate_uv_tokenonly, @@ -1214,13 +1214,13 @@ static void choose_intra_uv_mode(VP9_COMP *cpi, MACROBLOCK *const x, *mode_uv = x->e_mbd.mi[0]->mbmi.uv_mode; } -static int cost_mv_ref(const VP9_COMP *cpi, PREDICTION_MODE mode, +static int cost_mv_ref(const VP10_COMP *cpi, PREDICTION_MODE mode, int mode_context) { assert(is_inter_mode(mode)); return cpi->inter_mode_cost[mode_context][INTER_OFFSET(mode)]; } -static int set_and_cost_bmi_mvs(VP9_COMP *cpi, MACROBLOCK *x, MACROBLOCKD *xd, +static int set_and_cost_bmi_mvs(VP10_COMP *cpi, MACROBLOCK *x, MACROBLOCKD *xd, int i, PREDICTION_MODE mode, int_mv this_mv[2], int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES], @@ -1276,7 +1276,7 @@ static int set_and_cost_bmi_mvs(VP9_COMP *cpi, MACROBLOCK *x, MACROBLOCKD *xd, thismvcost; } -static int64_t encode_inter_mb_segment(VP9_COMP *cpi, +static int64_t encode_inter_mb_segment(VP10_COMP *cpi, MACROBLOCK *x, int64_t best_yrd, int i, @@ -1460,7 +1460,7 @@ static INLINE int mv_has_subpel(const MV *mv) { // Check if NEARESTMV/NEARMV/ZEROMV is the cheapest way encode zero motion. // TODO(aconverse): Find out if this is still productive then clean up or remove static int check_best_zero_mv( - const VP9_COMP *cpi, const uint8_t mode_context[MAX_REF_FRAMES], + const VP10_COMP *cpi, const uint8_t mode_context[MAX_REF_FRAMES], int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES], int this_mode, const MV_REFERENCE_FRAME ref_frames[2]) { if ((this_mode == NEARMV || this_mode == NEARESTMV || this_mode == ZEROMV) && @@ -1494,7 +1494,7 @@ static int check_best_zero_mv( return 1; } -static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x, +static void joint_motion_search(VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int_mv *frame_mv, int mi_row, int mi_col, @@ -1678,7 +1678,7 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x, } } -static int64_t rd_pick_best_sub8x8_mode(VP9_COMP *cpi, MACROBLOCK *x, +static int64_t rd_pick_best_sub8x8_mode(VP10_COMP *cpi, MACROBLOCK *x, int_mv *best_ref_mv, int_mv *second_best_ref_mv, int64_t best_rd, int *returntotrate, @@ -2144,7 +2144,7 @@ static void store_coding_context(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx, sizeof(*best_filter_diff) * SWITCHABLE_FILTER_CONTEXTS); } -static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x, +static void setup_buffer_inter(VP10_COMP *cpi, MACROBLOCK *x, MV_REFERENCE_FRAME ref_frame, BLOCK_SIZE block_size, int mi_row, int mi_col, @@ -2182,7 +2182,7 @@ static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x, ref_frame, block_size); } -static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x, +static void single_motion_search(VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col, int_mv *tmp_mv, int *rate_mv) { @@ -2328,7 +2328,7 @@ static INLINE void restore_dst_buf(MACROBLOCKD *xd, // However, once established that vector may be usable through the nearest and // near mv modes to reduce distortion in subsequent blocks and also improve // visual quality. -static int discount_newmv_test(const VP9_COMP *cpi, +static int discount_newmv_test(const VP10_COMP *cpi, int this_mode, int_mv this_mv, int_mv (*mode_mv)[MAX_REF_FRAMES], @@ -2342,7 +2342,7 @@ static int discount_newmv_test(const VP9_COMP *cpi, (mode_mv[NEARMV][ref_frame].as_int == INVALID_MV))); } -static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, +static int64_t handle_inter_mode(VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int *rate2, int64_t *distortion, int *skippable, @@ -2720,7 +2720,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, return 0; // The rate-distortion cost will be re-calculated by caller. } -void vp10_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, +void vp10_rd_pick_intra_mode_sb(VP10_COMP *cpi, MACROBLOCK *x, RD_COST *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx, int64_t best_rd) { VP10_COMMON *const cm = &cpi->common; @@ -2777,7 +2777,7 @@ void vp10_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, #define LOW_VAR_THRESH 16 #define VLOW_ADJ_MAX 25 #define VHIGH_ADJ_MAX 8 -static void rd_variance_adjustment(VP9_COMP *cpi, +static void rd_variance_adjustment(VP10_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int64_t *this_rd, @@ -2833,7 +2833,7 @@ static void rd_variance_adjustment(VP9_COMP *cpi, // Do we have an internal image edge (e.g. formatting bars). -int vp10_internal_image_edge(VP9_COMP *cpi) { +int vp10_internal_image_edge(VP10_COMP *cpi) { return (cpi->oxcf.pass == 2) && ((cpi->twopass.this_frame_stats.inactive_zone_rows > 0) || (cpi->twopass.this_frame_stats.inactive_zone_cols > 0)); @@ -2842,7 +2842,7 @@ int vp10_internal_image_edge(VP9_COMP *cpi) { // Checks to see if a super block is on a horizontal image edge. // In most cases this is the "real" edge unless there are formatting // bars embedded in the stream. -int vp10_active_h_edge(VP9_COMP *cpi, int mi_row, int mi_step) { +int vp10_active_h_edge(VP10_COMP *cpi, int mi_row, int mi_step) { int top_edge = 0; int bottom_edge = cpi->common.mi_rows; int is_active_h_edge = 0; @@ -2869,7 +2869,7 @@ int vp10_active_h_edge(VP9_COMP *cpi, int mi_row, int mi_step) { // Checks to see if a super block is on a vertical image edge. // In most cases this is the "real" edge unless there are formatting // bars embedded in the stream. -int vp10_active_v_edge(VP9_COMP *cpi, int mi_col, int mi_step) { +int vp10_active_v_edge(VP10_COMP *cpi, int mi_col, int mi_step) { int left_edge = 0; int right_edge = cpi->common.mi_cols; int is_active_v_edge = 0; @@ -2896,13 +2896,13 @@ int vp10_active_v_edge(VP9_COMP *cpi, int mi_col, int mi_step) { // Checks to see if a super block is at the edge of the active image. // In most cases this is the "real" edge unless there are formatting // bars embedded in the stream. -int vp10_active_edge_sb(VP9_COMP *cpi, +int vp10_active_edge_sb(VP10_COMP *cpi, int mi_row, int mi_col) { return vp10_active_h_edge(cpi, mi_row, MI_BLOCK_SIZE) || vp10_active_v_edge(cpi, mi_col, MI_BLOCK_SIZE); } -void vp10_rd_pick_inter_mode_sb(VP9_COMP *cpi, +void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi, TileDataEnc *tile_data, MACROBLOCK *x, int mi_row, int mi_col, @@ -3582,7 +3582,7 @@ void vp10_rd_pick_inter_mode_sb(VP9_COMP *cpi, best_filter_diff, best_mode_skippable); } -void vp10_rd_pick_inter_mode_sb_seg_skip(VP9_COMP *cpi, +void vp10_rd_pick_inter_mode_sb_seg_skip(VP10_COMP *cpi, TileDataEnc *tile_data, MACROBLOCK *x, RD_COST *rd_cost, @@ -3682,7 +3682,7 @@ void vp10_rd_pick_inter_mode_sb_seg_skip(VP9_COMP *cpi, best_pred_diff, best_filter_diff, 0); } -void vp10_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, +void vp10_rd_pick_inter_mode_sub8x8(VP10_COMP *cpi, TileDataEnc *tile_data, MACROBLOCK *x, int mi_row, int mi_col, diff --git a/vp10/encoder/rdopt.h b/vp10/encoder/rdopt.h index 78b0c22d3..b1a803627 100644 --- a/vp10/encoder/rdopt.h +++ b/vp10/encoder/rdopt.h @@ -21,24 +21,24 @@ extern "C" { #endif struct TileInfo; -struct VP9_COMP; +struct VP10_COMP; struct macroblock; struct RD_COST; -void vp10_rd_pick_intra_mode_sb(struct VP9_COMP *cpi, struct macroblock *x, +void vp10_rd_pick_intra_mode_sb(struct VP10_COMP *cpi, struct macroblock *x, struct RD_COST *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx, int64_t best_rd); -unsigned int vp10_get_sby_perpixel_variance(VP9_COMP *cpi, +unsigned int vp10_get_sby_perpixel_variance(VP10_COMP *cpi, const struct buf_2d *ref, BLOCK_SIZE bs); #if CONFIG_VP9_HIGHBITDEPTH -unsigned int vp10_high_get_sby_perpixel_variance(VP9_COMP *cpi, +unsigned int vp10_high_get_sby_perpixel_variance(VP10_COMP *cpi, const struct buf_2d *ref, BLOCK_SIZE bs, int bd); #endif -void vp10_rd_pick_inter_mode_sb(struct VP9_COMP *cpi, +void vp10_rd_pick_inter_mode_sb(struct VP10_COMP *cpi, struct TileDataEnc *tile_data, struct macroblock *x, int mi_row, int mi_col, @@ -46,7 +46,7 @@ void vp10_rd_pick_inter_mode_sb(struct VP9_COMP *cpi, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx, int64_t best_rd_so_far); -void vp10_rd_pick_inter_mode_sb_seg_skip(struct VP9_COMP *cpi, +void vp10_rd_pick_inter_mode_sb_seg_skip(struct VP10_COMP *cpi, struct TileDataEnc *tile_data, struct macroblock *x, struct RD_COST *rd_cost, @@ -54,12 +54,12 @@ void vp10_rd_pick_inter_mode_sb_seg_skip(struct VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx, int64_t best_rd_so_far); -int vp10_internal_image_edge(struct VP9_COMP *cpi); -int vp10_active_h_edge(struct VP9_COMP *cpi, int mi_row, int mi_step); -int vp10_active_v_edge(struct VP9_COMP *cpi, int mi_col, int mi_step); -int vp10_active_edge_sb(struct VP9_COMP *cpi, int mi_row, int mi_col); +int vp10_internal_image_edge(struct VP10_COMP *cpi); +int vp10_active_h_edge(struct VP10_COMP *cpi, int mi_row, int mi_step); +int vp10_active_v_edge(struct VP10_COMP *cpi, int mi_col, int mi_step); +int vp10_active_edge_sb(struct VP10_COMP *cpi, int mi_row, int mi_col); -void vp10_rd_pick_inter_mode_sub8x8(struct VP9_COMP *cpi, +void vp10_rd_pick_inter_mode_sub8x8(struct VP10_COMP *cpi, struct TileDataEnc *tile_data, struct macroblock *x, int mi_row, int mi_col, diff --git a/vp10/encoder/skin_detection.c b/vp10/encoder/skin_detection.c index dbb8b3485..5923eca8a 100644 --- a/vp10/encoder/skin_detection.c +++ b/vp10/encoder/skin_detection.c @@ -50,7 +50,7 @@ int vp10_skin_pixel(const uint8_t y, const uint8_t cb, const uint8_t cr) { #ifdef OUTPUT_YUV_SKINMAP // For viewing skin map on input source. -void vp10_compute_skin_map(VP9_COMP *const cpi, FILE *yuv_skinmap_file) { +void vp10_compute_skin_map(VP10_COMP *const cpi, FILE *yuv_skinmap_file) { int i, j, mi_row, mi_col; VP10_COMMON *const cm = &cpi->common; uint8_t *y; diff --git a/vp10/encoder/skin_detection.h b/vp10/encoder/skin_detection.h index 6c8927d36..26b7d5e7c 100644 --- a/vp10/encoder/skin_detection.h +++ b/vp10/encoder/skin_detection.h @@ -17,7 +17,7 @@ extern "C" { #endif -struct VP9_COMP; +struct VP10_COMP; // #define OUTPUT_YUV_SKINMAP @@ -25,7 +25,7 @@ int vp10_skin_pixel(const uint8_t y, const uint8_t cb, const uint8_t cr); #ifdef OUTPUT_YUV_SKINMAP // For viewing skin map on input source. -void vp10_compute_skin_map(VP9_COMP *const cpi, FILE *yuv_skinmap_file); +void vp10_compute_skin_map(VP10_COMP *const cpi, FILE *yuv_skinmap_file); #endif #ifdef __cplusplus diff --git a/vp10/encoder/speed_features.c b/vp10/encoder/speed_features.c index b3ae6871e..d4098c596 100644 --- a/vp10/encoder/speed_features.c +++ b/vp10/encoder/speed_features.c @@ -17,7 +17,7 @@ // Intra only frames, golden frames (except alt ref overlays) and // alt ref frames tend to be coded at a higher than ambient quality -static int frame_is_boosted(const VP9_COMP *cpi) { +static int frame_is_boosted(const VP10_COMP *cpi) { return frame_is_kf_gf_arf(cpi) || vp10_is_upper_layer_key_frame(cpi); } @@ -43,7 +43,7 @@ static BLOCK_SIZE set_partition_min_limit(VP10_COMMON *const cm) { } } -static void set_good_speed_feature_framesize_dependent(VP9_COMP *cpi, +static void set_good_speed_feature_framesize_dependent(VP10_COMP *cpi, SPEED_FEATURES *sf, int speed) { VP10_COMMON *const cm = &cpi->common; @@ -108,7 +108,7 @@ static void set_good_speed_feature_framesize_dependent(VP9_COMP *cpi, } } -static void set_good_speed_feature(VP9_COMP *cpi, VP10_COMMON *cm, +static void set_good_speed_feature(VP10_COMP *cpi, VP10_COMMON *cm, SPEED_FEATURES *sf, int speed) { const int boosted = frame_is_boosted(cpi); @@ -210,7 +210,7 @@ static void set_good_speed_feature(VP9_COMP *cpi, VP10_COMMON *cm, } } -static void set_rt_speed_feature_framesize_dependent(VP9_COMP *cpi, +static void set_rt_speed_feature_framesize_dependent(VP10_COMP *cpi, SPEED_FEATURES *sf, int speed) { VP10_COMMON *const cm = &cpi->common; @@ -246,7 +246,7 @@ static void set_rt_speed_feature_framesize_dependent(VP9_COMP *cpi, } } -static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf, +static void set_rt_speed_feature(VP10_COMP *cpi, SPEED_FEATURES *sf, int speed, vp9e_tune_content content) { VP10_COMMON *const cm = &cpi->common; const int is_keyframe = cm->frame_type == KEY_FRAME; @@ -402,7 +402,7 @@ static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf, } } -void vp10_set_speed_features_framesize_dependent(VP9_COMP *cpi) { +void vp10_set_speed_features_framesize_dependent(VP10_COMP *cpi) { SPEED_FEATURES *const sf = &cpi->sf; const VP9EncoderConfig *const oxcf = &cpi->oxcf; RD_OPT *const rd = &cpi->rd; @@ -431,7 +431,7 @@ void vp10_set_speed_features_framesize_dependent(VP9_COMP *cpi) { } } -void vp10_set_speed_features_framesize_independent(VP9_COMP *cpi) { +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; diff --git a/vp10/encoder/speed_features.h b/vp10/encoder/speed_features.h index 15443e3ba..70c11e9c9 100644 --- a/vp10/encoder/speed_features.h +++ b/vp10/encoder/speed_features.h @@ -420,10 +420,10 @@ typedef struct SPEED_FEATURES { int simple_model_rd_from_var; } SPEED_FEATURES; -struct VP9_COMP; +struct VP10_COMP; -void vp10_set_speed_features_framesize_independent(struct VP9_COMP *cpi); -void vp10_set_speed_features_framesize_dependent(struct VP9_COMP *cpi); +void vp10_set_speed_features_framesize_independent(struct VP10_COMP *cpi); +void vp10_set_speed_features_framesize_dependent(struct VP10_COMP *cpi); #ifdef __cplusplus } // extern "C" diff --git a/vp10/encoder/svc_layercontext.c b/vp10/encoder/svc_layercontext.c index 321ae8396..8f49c6dfd 100644 --- a/vp10/encoder/svc_layercontext.c +++ b/vp10/encoder/svc_layercontext.c @@ -18,7 +18,7 @@ #define SMALL_FRAME_WIDTH 16 #define SMALL_FRAME_HEIGHT 16 -void vp10_init_layer_context(VP9_COMP *const cpi) { +void vp10_init_layer_context(VP10_COMP *const cpi) { SVC *const svc = &cpi->svc; const VP9EncoderConfig *const oxcf = &cpi->oxcf; int sl, tl; @@ -103,7 +103,7 @@ void vp10_init_layer_context(VP9_COMP *const cpi) { } // Update the layer context from a change_config() call. -void vp10_update_layer_context_change_config(VP9_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; @@ -191,7 +191,7 @@ void vp10_update_layer_context_change_config(VP9_COMP *const cpi, } } -static LAYER_CONTEXT *get_layer_context(VP9_COMP *const cpi) { +static LAYER_CONTEXT *get_layer_context(VP10_COMP *const cpi) { if (is_one_pass_cbr_svc(cpi)) return &cpi->svc.layer_context[cpi->svc.spatial_layer_id * cpi->svc.number_temporal_layers + cpi->svc.temporal_layer_id]; @@ -202,7 +202,7 @@ static LAYER_CONTEXT *get_layer_context(VP9_COMP *const cpi) { &cpi->svc.layer_context[cpi->svc.spatial_layer_id]; } -void vp10_update_temporal_layer_framerate(VP9_COMP *const cpi) { +void vp10_update_temporal_layer_framerate(VP10_COMP *const cpi) { SVC *const svc = &cpi->svc; const VP9EncoderConfig *const oxcf = &cpi->oxcf; LAYER_CONTEXT *const lc = get_layer_context(cpi); @@ -229,7 +229,8 @@ void vp10_update_temporal_layer_framerate(VP9_COMP *const cpi) { } } -void vp10_update_spatial_layer_framerate(VP9_COMP *const cpi, double framerate) { +void vp10_update_spatial_layer_framerate(VP10_COMP *const cpi, + double framerate) { const VP9EncoderConfig *const oxcf = &cpi->oxcf; LAYER_CONTEXT *const lc = get_layer_context(cpi); RATE_CONTROL *const lrc = &lc->rc; @@ -243,7 +244,7 @@ void vp10_update_spatial_layer_framerate(VP9_COMP *const cpi, double framerate) vp10_rc_set_gf_interval_range(cpi, lrc); } -void vp10_restore_layer_context(VP9_COMP *const cpi) { +void vp10_restore_layer_context(VP10_COMP *const cpi) { LAYER_CONTEXT *const lc = get_layer_context(cpi); const int old_frame_since_key = cpi->rc.frames_since_key; const int old_frame_to_key = cpi->rc.frames_to_key; @@ -260,7 +261,7 @@ void vp10_restore_layer_context(VP9_COMP *const cpi) { } } -void vp10_save_layer_context(VP9_COMP *const cpi) { +void vp10_save_layer_context(VP10_COMP *const cpi) { const VP9EncoderConfig *const oxcf = &cpi->oxcf; LAYER_CONTEXT *const lc = get_layer_context(cpi); @@ -270,7 +271,7 @@ void vp10_save_layer_context(VP9_COMP *const cpi) { lc->alt_ref_source = cpi->alt_ref_source; } -void vp10_init_second_pass_spatial_svc(VP9_COMP *cpi) { +void vp10_init_second_pass_spatial_svc(VP10_COMP *cpi) { SVC *const svc = &cpi->svc; int i; @@ -286,7 +287,7 @@ void vp10_init_second_pass_spatial_svc(VP9_COMP *cpi) { svc->spatial_layer_id = 0; } -void vp10_inc_frame_in_layer(VP9_COMP *const cpi) { +void vp10_inc_frame_in_layer(VP10_COMP *const cpi) { LAYER_CONTEXT *const lc = &cpi->svc.layer_context[cpi->svc.spatial_layer_id * cpi->svc.number_temporal_layers]; @@ -294,7 +295,7 @@ void vp10_inc_frame_in_layer(VP9_COMP *const cpi) { ++lc->frames_from_key_frame; } -int vp10_is_upper_layer_key_frame(const VP9_COMP *const cpi) { +int vp10_is_upper_layer_key_frame(const VP10_COMP *const cpi) { return is_two_pass_svc(cpi) && cpi->svc.spatial_layer_id > 0 && cpi->svc.layer_context[cpi->svc.spatial_layer_id * @@ -324,7 +325,7 @@ static void get_layer_resolution(const int width_org, const int height_org, // The function sets proper ref_frame_flags, buffer indices, and buffer update // variables for temporal layering mode 3 - that does 0-2-1-2 temporal layering // scheme. -static void set_flags_and_fb_idx_for_temporal_mode3(VP9_COMP *const cpi) { +static void set_flags_and_fb_idx_for_temporal_mode3(VP10_COMP *const cpi) { int frame_num_within_temporal_struct = 0; int spatial_id, temporal_id; spatial_id = cpi->svc.spatial_layer_id = cpi->svc.spatial_layer_to_encode; @@ -411,7 +412,7 @@ static void set_flags_and_fb_idx_for_temporal_mode3(VP9_COMP *const cpi) { // The function sets proper ref_frame_flags, buffer indices, and buffer update // variables for temporal layering mode 2 - that does 0-1-0-1 temporal layering // scheme. -static void set_flags_and_fb_idx_for_temporal_mode2(VP9_COMP *const cpi) { +static void set_flags_and_fb_idx_for_temporal_mode2(VP10_COMP *const cpi) { int spatial_id, temporal_id; spatial_id = cpi->svc.spatial_layer_id = cpi->svc.spatial_layer_to_encode; temporal_id = cpi->svc.temporal_layer_id = @@ -457,7 +458,7 @@ static void set_flags_and_fb_idx_for_temporal_mode2(VP9_COMP *const cpi) { // The function sets proper ref_frame_flags, buffer indices, and buffer update // variables for temporal layering mode 0 - that has no temporal layering. static void set_flags_and_fb_idx_for_temporal_mode_noLayering( - VP9_COMP *const cpi) { + VP10_COMP *const cpi) { int spatial_id; spatial_id = cpi->svc.spatial_layer_id = cpi->svc.spatial_layer_to_encode; cpi->ext_refresh_last_frame = @@ -478,7 +479,7 @@ static void set_flags_and_fb_idx_for_temporal_mode_noLayering( cpi->gld_fb_idx = 0; } -int vp10_one_pass_cbr_svc_start_layer(VP9_COMP *const cpi) { +int vp10_one_pass_cbr_svc_start_layer(VP10_COMP *const cpi) { int width = 0, height = 0; LAYER_CONTEXT *lc = NULL; @@ -516,7 +517,7 @@ int vp10_one_pass_cbr_svc_start_layer(VP9_COMP *const cpi) { } #if CONFIG_SPATIAL_SVC -int vp10_svc_start_frame(VP9_COMP *const cpi) { +int vp10_svc_start_frame(VP10_COMP *const cpi) { int width = 0, height = 0; LAYER_CONTEXT *lc; struct lookahead_entry *buf; @@ -628,7 +629,7 @@ int vp10_svc_start_frame(VP9_COMP *const cpi) { #endif -struct lookahead_entry *vp10_svc_lookahead_pop(VP9_COMP *const cpi, +struct lookahead_entry *vp10_svc_lookahead_pop(VP10_COMP *const cpi, struct lookahead_ctx *ctx, int drain) { struct lookahead_entry *buf = NULL; diff --git a/vp10/encoder/svc_layercontext.h b/vp10/encoder/svc_layercontext.h index cf0ee901d..c9058ffc4 100644 --- a/vp10/encoder/svc_layercontext.h +++ b/vp10/encoder/svc_layercontext.h @@ -72,48 +72,48 @@ typedef struct { VP9E_TEMPORAL_LAYERING_MODE temporal_layering_mode; } SVC; -struct VP9_COMP; +struct VP10_COMP; // Initialize layer context data from init_config(). -void vp10_init_layer_context(struct VP9_COMP *const cpi); +void vp10_init_layer_context(struct VP10_COMP *const cpi); // Update the layer context from a change_config() call. -void vp10_update_layer_context_change_config(struct VP9_COMP *const cpi, +void vp10_update_layer_context_change_config(struct VP10_COMP *const cpi, const int target_bandwidth); // Prior to encoding the frame, update framerate-related quantities // for the current temporal layer. -void vp10_update_temporal_layer_framerate(struct VP9_COMP *const cpi); +void vp10_update_temporal_layer_framerate(struct VP10_COMP *const cpi); // Update framerate-related quantities for the current spatial layer. -void vp10_update_spatial_layer_framerate(struct VP9_COMP *const cpi, +void vp10_update_spatial_layer_framerate(struct VP10_COMP *const cpi, double framerate); // Prior to encoding the frame, set the layer context, for the current layer // to be encoded, to the cpi struct. -void vp10_restore_layer_context(struct VP9_COMP *const cpi); +void vp10_restore_layer_context(struct VP10_COMP *const cpi); // Save the layer context after encoding the frame. -void vp10_save_layer_context(struct VP9_COMP *const cpi); +void vp10_save_layer_context(struct VP10_COMP *const cpi); // Initialize second pass rc for spatial svc. -void vp10_init_second_pass_spatial_svc(struct VP9_COMP *cpi); +void vp10_init_second_pass_spatial_svc(struct VP10_COMP *cpi); // Increment number of video frames in layer -void vp10_inc_frame_in_layer(struct VP9_COMP *const cpi); +void vp10_inc_frame_in_layer(struct VP10_COMP *const cpi); // Check if current layer is key frame in spatial upper layer -int vp10_is_upper_layer_key_frame(const struct VP9_COMP *const cpi); +int vp10_is_upper_layer_key_frame(const struct VP10_COMP *const cpi); // Get the next source buffer to encode -struct lookahead_entry *vp10_svc_lookahead_pop(struct VP9_COMP *const cpi, +struct lookahead_entry *vp10_svc_lookahead_pop(struct VP10_COMP *const cpi, struct lookahead_ctx *ctx, int drain); // Start a frame and initialize svc parameters -int vp10_svc_start_frame(struct VP9_COMP *const cpi); +int vp10_svc_start_frame(struct VP10_COMP *const cpi); -int vp10_one_pass_cbr_svc_start_layer(struct VP9_COMP *const cpi); +int vp10_one_pass_cbr_svc_start_layer(struct VP10_COMP *const cpi); #ifdef __cplusplus } // extern "C" diff --git a/vp10/encoder/temporal_filter.c b/vp10/encoder/temporal_filter.c index 0a9330979..961e925bd 100644 --- a/vp10/encoder/temporal_filter.c +++ b/vp10/encoder/temporal_filter.c @@ -210,7 +210,7 @@ void vp10_highbd_temporal_filter_apply_c(uint8_t *frame1_8, } #endif // CONFIG_VP9_HIGHBITDEPTH -static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi, +static int temporal_filter_find_matching_mb_c(VP10_COMP *cpi, uint8_t *arf_frame_buf, uint8_t *frame_ptr_buf, int stride) { @@ -267,7 +267,7 @@ static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi, return bestsme; } -static void temporal_filter_iterate_c(VP9_COMP *cpi, +static void temporal_filter_iterate_c(VP10_COMP *cpi, YV12_BUFFER_CONFIG **frames, int frame_count, int alt_ref_index, @@ -588,7 +588,7 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi, } // Apply buffer limits and context specific adjustments to arnr filter. -static void adjust_arnr_filter(VP9_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; @@ -651,7 +651,7 @@ static void adjust_arnr_filter(VP9_COMP *cpi, *arnr_strength = strength; } -void vp10_temporal_filter(VP9_COMP *cpi, int distance) { +void vp10_temporal_filter(VP10_COMP *cpi, int distance) { VP10_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; diff --git a/vp10/encoder/temporal_filter.h b/vp10/encoder/temporal_filter.h index 9dae7d580..6e331e6ad 100644 --- a/vp10/encoder/temporal_filter.h +++ b/vp10/encoder/temporal_filter.h @@ -16,7 +16,7 @@ extern "C" { #endif void vp10_temporal_filter_init(void); -void vp10_temporal_filter(VP9_COMP *cpi, int distance); +void vp10_temporal_filter(VP10_COMP *cpi, int distance); #ifdef __cplusplus } // extern "C" diff --git a/vp10/encoder/tokenize.c b/vp10/encoder/tokenize.c index 1e868b54c..ccfa2b51f 100644 --- a/vp10/encoder/tokenize.c +++ b/vp10/encoder/tokenize.c @@ -438,7 +438,7 @@ const struct vp10_token vp10_coef_encodings[ENTROPY_TOKENS] = { struct tokenize_b_args { - VP9_COMP *cpi; + VP10_COMP *cpi; ThreadData *td; TOKENEXTRA **tp; }; @@ -490,7 +490,7 @@ static INLINE int get_tx_eob(const struct segmentation *seg, int segment_id, static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize, TX_SIZE tx_size, void *arg) { struct tokenize_b_args* const args = arg; - VP9_COMP *cpi = args->cpi; + VP10_COMP *cpi = args->cpi; ThreadData *const td = args->td; MACROBLOCK *const x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; @@ -610,7 +610,7 @@ int vp10_has_high_freq_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { return result; } -void vp10_tokenize_sb(VP9_COMP *cpi, ThreadData *td, TOKENEXTRA **t, +void vp10_tokenize_sb(VP10_COMP *cpi, ThreadData *td, TOKENEXTRA **t, int dry_run, BLOCK_SIZE bsize) { VP10_COMMON *const cm = &cpi->common; MACROBLOCK *const x = &td->mb; diff --git a/vp10/encoder/tokenize.h b/vp10/encoder/tokenize.h index e9df3004a..5bad415a9 100644 --- a/vp10/encoder/tokenize.h +++ b/vp10/encoder/tokenize.h @@ -48,10 +48,10 @@ extern const struct vp10_token vp10_coef_encodings[]; int vp10_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane); int vp10_has_high_freq_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane); -struct VP9_COMP; +struct VP10_COMP; struct ThreadData; -void vp10_tokenize_sb(struct VP9_COMP *cpi, struct ThreadData *td, +void vp10_tokenize_sb(struct VP10_COMP *cpi, struct ThreadData *td, TOKENEXTRA **t, int dry_run, BLOCK_SIZE bsize); extern const int16_t *vp10_dct_value_cost_ptr; diff --git a/vp10/vp10_cx_iface.c b/vp10/vp10_cx_iface.c index b3557574a..b5ae142a1 100644 --- a/vp10/vp10_cx_iface.c +++ b/vp10/vp10_cx_iface.c @@ -78,7 +78,7 @@ struct vpx_codec_alg_priv { vpx_codec_enc_cfg_t cfg; struct vp10_extracfg extra_cfg; VP9EncoderConfig oxcf; - VP9_COMP *cpi; + VP10_COMP *cpi; unsigned char *cx_data; size_t cx_data_sz; unsigned char *pending_cx_data; @@ -934,7 +934,7 @@ static int64_t ticks_to_timebase_units(const vpx_rational_t *timebase, return (n * timebase->den + round) / timebase->num / TICKS_PER_SEC; } -static vpx_codec_frame_flags_t get_frame_pkt_flags(const VP9_COMP *cpi, +static vpx_codec_frame_flags_t get_frame_pkt_flags(const VP10_COMP *cpi, unsigned int lib_flags) { vpx_codec_frame_flags_t flags = lib_flags << 16; @@ -959,7 +959,7 @@ static vpx_codec_err_t encoder_encode(vpx_codec_alg_priv_t *ctx, vpx_enc_frame_flags_t flags, unsigned long deadline) { vpx_codec_err_t res = VPX_CODEC_OK; - VP9_COMP *const cpi = ctx->cpi; + VP10_COMP *const cpi = ctx->cpi; const vpx_rational_t *const timebase = &ctx->cfg.g_timebase; size_t data_sz; @@ -1359,7 +1359,7 @@ static vpx_codec_err_t ctrl_set_svc(vpx_codec_alg_priv_t *ctx, va_list args) { static vpx_codec_err_t ctrl_set_svc_layer_id(vpx_codec_alg_priv_t *ctx, va_list args) { vpx_svc_layer_id_t *const data = va_arg(args, vpx_svc_layer_id_t *); - VP9_COMP *const cpi = (VP9_COMP *)ctx->cpi; + VP10_COMP *const cpi = (VP10_COMP *)ctx->cpi; SVC *const svc = &cpi->svc; svc->spatial_layer_id = data->spatial_layer_id; @@ -1379,7 +1379,7 @@ static vpx_codec_err_t ctrl_set_svc_layer_id(vpx_codec_alg_priv_t *ctx, static vpx_codec_err_t ctrl_get_svc_layer_id(vpx_codec_alg_priv_t *ctx, va_list args) { vpx_svc_layer_id_t *data = va_arg(args, vpx_svc_layer_id_t *); - VP9_COMP *const cpi = (VP9_COMP *)ctx->cpi; + VP10_COMP *const cpi = (VP10_COMP *)ctx->cpi; SVC *const svc = &cpi->svc; data->spatial_layer_id = svc->spatial_layer_id; @@ -1390,7 +1390,7 @@ static vpx_codec_err_t ctrl_get_svc_layer_id(vpx_codec_alg_priv_t *ctx, static vpx_codec_err_t ctrl_set_svc_parameters(vpx_codec_alg_priv_t *ctx, va_list args) { - VP9_COMP *const cpi = ctx->cpi; + VP10_COMP *const cpi = ctx->cpi; vpx_svc_extra_cfg_t *const params = va_arg(args, vpx_svc_extra_cfg_t *); int sl, tl;