From b16fac42d49bd357ed107a23376deb98dbb25016 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Wed, 8 Jan 2014 18:36:38 -0800 Subject: Using VP9_COMMON instead of VP9_COMP. Change-Id: If7d3958653104f3e170853e931f8489de3ecf3cc --- vp9/encoder/vp9_bitstream.c | 34 ++++++++++++++-------------------- vp9/encoder/vp9_bitstream.h | 2 +- vp9/encoder/vp9_encodemv.c | 6 +++--- vp9/encoder/vp9_encodemv.h | 2 +- 4 files changed, 19 insertions(+), 25 deletions(-) (limited to 'vp9/encoder') diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c index bab6a9767..69c569dc6 100644 --- a/vp9/encoder/vp9_bitstream.c +++ b/vp9/encoder/vp9_bitstream.c @@ -125,8 +125,7 @@ static int write_skip_coeff(const VP9_COMP *cpi, int segment_id, MODE_INFO *m, } } -void vp9_update_skip_probs(VP9_COMP *cpi, vp9_writer *w) { - VP9_COMMON *cm = &cpi->common; +void vp9_update_skip_probs(VP9_COMMON *cm, vp9_writer *w) { int k; for (k = 0; k < MBSKIP_CONTEXTS; ++k) @@ -935,9 +934,7 @@ static void write_interp_filter_type(INTERPOLATION_TYPE type, vp9_wb_write_literal(wb, type_to_literal[type], 2); } -static void fix_mcomp_filter_type(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - +static void fix_mcomp_filter_type(VP9_COMMON *cm) { if (cm->mcomp_filter_type == SWITCHABLE) { // Check to see if only one of the filters is actually used int count[SWITCHABLE_FILTERS]; @@ -1066,9 +1063,8 @@ static size_t encode_tiles(VP9_COMP *cpi, uint8_t *data_ptr) { return total_size; } -static void write_display_size(VP9_COMP *cpi, struct vp9_write_bit_buffer *wb) { - VP9_COMMON *const cm = &cpi->common; - +static void write_display_size(const VP9_COMMON *cm, + struct vp9_write_bit_buffer *wb) { const int scaling_active = cm->width != cm->display_width || cm->height != cm->display_height; vp9_wb_write_bit(wb, scaling_active); @@ -1078,13 +1074,12 @@ static void write_display_size(VP9_COMP *cpi, struct vp9_write_bit_buffer *wb) { } } -static void write_frame_size(VP9_COMP *cpi, +static void write_frame_size(const VP9_COMMON *cm, struct vp9_write_bit_buffer *wb) { - VP9_COMMON *const cm = &cpi->common; vp9_wb_write_literal(wb, cm->width - 1, 16); vp9_wb_write_literal(wb, cm->height - 1, 16); - write_display_size(cpi, wb); + write_display_size(cm, wb); } static void write_frame_size_with_refs(VP9_COMP *cpi, @@ -1114,7 +1109,7 @@ static void write_frame_size_with_refs(VP9_COMP *cpi, vp9_wb_write_literal(wb, cm->height - 1, 16); } - write_display_size(cpi, wb); + write_display_size(cm, wb); } static void write_sync_code(struct vp9_write_bit_buffer *wb) { @@ -1156,7 +1151,7 @@ static void write_uncompressed_header(VP9_COMP *cpi, vp9_wb_write_bit(wb, 0); // has extra plane } - write_frame_size(cpi, wb); + write_frame_size(cm, wb); } else { if (!cm->show_frame) vp9_wb_write_bit(wb, cm->intra_only); @@ -1168,7 +1163,7 @@ static void write_uncompressed_header(VP9_COMP *cpi, write_sync_code(wb); vp9_wb_write_literal(wb, get_refresh_mask(cpi), REF_FRAMES); - write_frame_size(cpi, wb); + write_frame_size(cm, wb); } else { MV_REFERENCE_FRAME ref_frame; vp9_wb_write_literal(wb, get_refresh_mask(cpi), REF_FRAMES); @@ -1182,7 +1177,7 @@ static void write_uncompressed_header(VP9_COMP *cpi, vp9_wb_write_bit(wb, cm->allow_high_precision_mv); - fix_mcomp_filter_type(cpi); + fix_mcomp_filter_type(cm); write_interp_filter_type(cm->mcomp_filter_type, wb); } } @@ -1220,7 +1215,7 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) { active_section = 2; #endif - vp9_update_skip_probs(cpi, &header_bc); + vp9_update_skip_probs(cm, &header_bc); if (!frame_is_intra_only(cm)) { int i; @@ -1242,9 +1237,8 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) { cm->counts.intra_inter[i]); if (cm->allow_comp_inter_inter) { - const int reference_mode = cpi->common.reference_mode; - const int use_compound_pred = reference_mode != SINGLE_REFERENCE; - const int use_hybrid_pred = reference_mode == REFERENCE_MODE_SELECT; + const int use_compound_pred = cm->reference_mode != SINGLE_REFERENCE; + const int use_hybrid_pred = cm->reference_mode == REFERENCE_MODE_SELECT; vp9_write_bit(&header_bc, use_compound_pred); if (use_compound_pred) { @@ -1278,7 +1272,7 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) { prob_diff_update(vp9_partition_tree, fc->partition_prob[i], cm->counts.partition[i], PARTITION_TYPES, &header_bc); - vp9_write_nmv_probs(cpi, cm->allow_high_precision_mv, &header_bc); + vp9_write_nmv_probs(cm, cm->allow_high_precision_mv, &header_bc); } vp9_stop_encode(&header_bc); diff --git a/vp9/encoder/vp9_bitstream.h b/vp9/encoder/vp9_bitstream.h index b3dbee1a7..52be50272 100644 --- a/vp9/encoder/vp9_bitstream.h +++ b/vp9/encoder/vp9_bitstream.h @@ -12,6 +12,6 @@ #ifndef VP9_ENCODER_VP9_BITSTREAM_H_ #define VP9_ENCODER_VP9_BITSTREAM_H_ -void vp9_update_skip_probs(VP9_COMP *cpi, vp9_writer *bc); +void vp9_update_skip_probs(VP9_COMMON *cm, vp9_writer *bc); #endif // VP9_ENCODER_VP9_BITSTREAM_H_ diff --git a/vp9/encoder/vp9_encodemv.c b/vp9/encoder/vp9_encodemv.c index dae89ad1d..af710a8f4 100644 --- a/vp9/encoder/vp9_encodemv.c +++ b/vp9/encoder/vp9_encodemv.c @@ -163,10 +163,10 @@ static void write_mv_update(const vp9_tree_index *tree, update_mv(w, branch_ct[i], &probs[i], NMV_UPDATE_PROB); } -void vp9_write_nmv_probs(VP9_COMP* const cpi, int usehp, vp9_writer *w) { +void vp9_write_nmv_probs(VP9_COMMON *cm, int usehp, vp9_writer *w) { int i, j; - nmv_context *mvc = &cpi->common.fc.nmvc; - nmv_context_counts *counts = &cpi->common.counts.mv; + nmv_context *const mvc = &cm->fc.nmvc; + nmv_context_counts *const counts = &cm->counts.mv; write_mv_update(vp9_mv_joint_tree, mvc->joints, counts->joints, MV_JOINTS, w); diff --git a/vp9/encoder/vp9_encodemv.h b/vp9/encoder/vp9_encodemv.h index 4cc10da73..761278fd1 100644 --- a/vp9/encoder/vp9_encodemv.h +++ b/vp9/encoder/vp9_encodemv.h @@ -16,7 +16,7 @@ void vp9_entropy_mv_init(); -void vp9_write_nmv_probs(VP9_COMP* const, int usehp, vp9_writer* const); +void vp9_write_nmv_probs(VP9_COMMON *cm, int usehp, vp9_writer* const); void vp9_encode_mv(VP9_COMP *cpi, vp9_writer* w, const MV* mv, const MV* ref, const nmv_context* mvctx, int usehp); -- cgit v1.2.3