From cca866f578191c9d1ea381642e53c12c76dbaa15 Mon Sep 17 00:00:00 2001 From: Scott LaVarnway Date: Thu, 11 Jun 2015 09:52:00 -0700 Subject: [PATCH] inline vp9_get_segdata() and change name. Change-Id: I706645cf9d9dc04f1b3b6ac80df80edb7f101854 --- vp9/common/vp9_loopfilter.c | 2 +- vp9/common/vp9_quant_common.c | 2 +- vp9/common/vp9_seg_common.c | 6 ------ vp9/common/vp9_seg_common.h | 7 ++++--- vp9/decoder/vp9_decodemv.c | 7 +++---- vp9/encoder/vp9_bitstream.c | 4 ++-- vp9/encoder/vp9_pickmode.c | 2 +- vp9/encoder/vp9_rdopt.c | 4 ++-- 8 files changed, 14 insertions(+), 20 deletions(-) diff --git a/vp9/common/vp9_loopfilter.c b/vp9/common/vp9_loopfilter.c index f95ff2146..981672836 100644 --- a/vp9/common/vp9_loopfilter.c +++ b/vp9/common/vp9_loopfilter.c @@ -268,7 +268,7 @@ void vp9_loop_filter_frame_init(VP9_COMMON *cm, int default_filt_lvl) { for (seg_id = 0; seg_id < MAX_SEGMENTS; seg_id++) { int lvl_seg = default_filt_lvl; if (segfeature_active(seg, seg_id, SEG_LVL_ALT_LF)) { - const int data = vp9_get_segdata(seg, seg_id, SEG_LVL_ALT_LF); + const int data = get_segdata(seg, seg_id, SEG_LVL_ALT_LF); lvl_seg = clamp(seg->abs_delta == SEGMENT_ABSDATA ? data : default_filt_lvl + data, 0, MAX_LOOP_FILTER); diff --git a/vp9/common/vp9_quant_common.c b/vp9/common/vp9_quant_common.c index 504288075..d83f3c1a2 100644 --- a/vp9/common/vp9_quant_common.c +++ b/vp9/common/vp9_quant_common.c @@ -267,7 +267,7 @@ int16_t vp9_ac_quant(int qindex, int delta, vpx_bit_depth_t bit_depth) { int vp9_get_qindex(const struct segmentation *seg, int segment_id, int base_qindex) { if (segfeature_active(seg, segment_id, SEG_LVL_ALT_Q)) { - const int data = vp9_get_segdata(seg, segment_id, SEG_LVL_ALT_Q); + const int data = get_segdata(seg, segment_id, SEG_LVL_ALT_Q); const int seg_qindex = seg->abs_delta == SEGMENT_ABSDATA ? data : base_qindex + data; return clamp(seg_qindex, 0, MAXQ); diff --git a/vp9/common/vp9_seg_common.c b/vp9/common/vp9_seg_common.c index 78e842c05..471e238cc 100644 --- a/vp9/common/vp9_seg_common.c +++ b/vp9/common/vp9_seg_common.c @@ -54,12 +54,6 @@ void vp9_set_segdata(struct segmentation *seg, int segment_id, seg->feature_data[segment_id][feature_id] = seg_data; } -int vp9_get_segdata(const struct segmentation *seg, int segment_id, - SEG_LVL_FEATURES feature_id) { - return seg->feature_data[segment_id][feature_id]; -} - - const vp9_tree_index vp9_segment_tree[TREE_SIZE(MAX_SEGMENTS)] = { 2, 4, 6, 8, 10, 12, 0, -1, -2, -3, -4, -5, -6, -7 diff --git a/vp9/common/vp9_seg_common.h b/vp9/common/vp9_seg_common.h index 679476388..95c991830 100644 --- a/vp9/common/vp9_seg_common.h +++ b/vp9/common/vp9_seg_common.h @@ -71,9 +71,10 @@ void vp9_set_segdata(struct segmentation *seg, SEG_LVL_FEATURES feature_id, int seg_data); -int vp9_get_segdata(const struct segmentation *seg, - int segment_id, - SEG_LVL_FEATURES feature_id); +static INLINE int get_segdata(const struct segmentation *seg, int segment_id, + SEG_LVL_FEATURES feature_id) { + return seg->feature_data[segment_id][feature_id]; +} extern const vp9_tree_index vp9_segment_tree[TREE_SIZE(MAX_SEGMENTS)]; diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c index 3cb68ad5f..d34926dc6 100644 --- a/vp9/decoder/vp9_decodemv.c +++ b/vp9/decoder/vp9_decodemv.c @@ -308,8 +308,8 @@ static void read_ref_frames(VP9_COMMON *const cm, MACROBLOCKD *const xd, FRAME_COUNTS *counts = xd->counts; if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) { - ref_frame[0] = (MV_REFERENCE_FRAME)vp9_get_segdata(&cm->seg, segment_id, - SEG_LVL_REF_FRAME); + ref_frame[0] = (MV_REFERENCE_FRAME)get_segdata(&cm->seg, segment_id, + SEG_LVL_REF_FRAME); ref_frame[1] = NONE; } else { const REFERENCE_MODE mode = read_block_reference_mode(cm, xd, r); @@ -445,8 +445,7 @@ static INLINE int assign_mv(VP9_COMMON *cm, MACROBLOCKD *xd, static int read_is_inter_block(VP9_COMMON *const cm, MACROBLOCKD *const xd, int segment_id, vp9_reader *r) { if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) { - return vp9_get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME) != - INTRA_FRAME; + return get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME) != INTRA_FRAME; } else { const int ctx = vp9_get_intra_inter_context(xd); const int is_inter = vp9_read(r, cm->fc->intra_inter_prob[ctx]); diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c index e14706f36..092d265a3 100644 --- a/vp9/encoder/vp9_bitstream.c +++ b/vp9/encoder/vp9_bitstream.c @@ -210,7 +210,7 @@ static void write_ref_frames(const VP9_COMMON *cm, const MACROBLOCKD *xd, if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) { assert(!is_compound); assert(mbmi->ref_frame[0] == - vp9_get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME)); + get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME)); } else { // does the feature use compound prediction or not // (if not specified at the frame/segment level) @@ -790,7 +790,7 @@ static void encode_segmentation(VP9_COMMON *cm, MACROBLOCKD *xd, const int active = segfeature_active(seg, i, j); vp9_wb_write_bit(wb, active); if (active) { - const int data = vp9_get_segdata(seg, i, j); + const int data = get_segdata(seg, i, j); const int data_max = vp9_seg_feature_data_max(j); if (vp9_is_segfeature_signed(j)) { diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index ec1869722..2479b6e73 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -1693,7 +1693,7 @@ void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x, // If the segment reference frame feature is enabled.... // then do nothing if the current ref frame is not allowed.. if (segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME) && - vp9_get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) != (int)ref_frame) + get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) != (int)ref_frame) continue; mbmi->ref_frame[0] = ref_frame; diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 4c6ee9485..162d4de5f 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -3008,7 +3008,7 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, // If the segment reference frame feature is enabled.... // then do nothing if the current ref frame is not allowed.. if (segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME) && - vp9_get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) != (int)ref_frame) { + get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) != (int)ref_frame) { ref_frame_skip_mask[0] |= (1 << ref_frame); ref_frame_skip_mask[1] |= SECOND_REF_FRAME_MASK; } @@ -3876,7 +3876,7 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, // If the segment reference frame feature is enabled.... // then do nothing if the current ref frame is not allowed.. if (segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME) && - vp9_get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) != (int)ref_frame) { + get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) != (int)ref_frame) { continue; // Disable this drop out case if the ref frame // segment level feature is enabled for this segment. This is to