From: Paul Wilkins Date: Thu, 3 Nov 2011 12:50:09 +0000 (+0000) Subject: Segment Features. Removal of #ifdefs X-Git-Tag: v1.3.0~1217^2~380^2~174 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a10a268e58ffd4366f6dbddd5f26600d688714c9;p=libvpx Segment Features. Removal of #ifdefs Removal of configure #ifdefs so that segment features always available. Removal of code supporting old segment feature method. Still a good deal of tidying up to do. Change-Id: I397855f086f8c09ab1fae0a5f65d9e06d2e3e39f --- diff --git a/vp8/common/blockd.h b/vp8/common/blockd.h index 27bc25314..fdac08adf 100644 --- a/vp8/common/blockd.h +++ b/vp8/common/blockd.h @@ -104,16 +104,12 @@ typedef enum { SEG_LVL_ALT_Q = 0, // Use alternate Quantizer .... SEG_LVL_ALT_LF = 1, // Use alternate loop filter value... -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES SEG_LVL_REF_FRAME = 2, // Optional Segment reference frame SEG_LVL_MODE = 3, // Optional Segment mode SEG_LVL_EOB = 4, // EOB end stop marker. SEG_LVL_TRANSFORM = 5, // Block transform size. - SEG_LVL_MAX = 6 // Number of MB level features supported -#else - SEG_LVL_MAX = 2 // Number of MB level features supported -#endif } SEG_LVL_FEATURES; @@ -261,9 +257,8 @@ typedef struct MacroBlockD // Segment features signed char segment_feature_data[MAX_MB_SEGMENTS][SEG_LVL_MAX]; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES unsigned int segment_feature_mask[MAX_MB_SEGMENTS]; -#endif /* mode_based Loop filter adjustment */ unsigned char mode_ref_lf_delta_enabled; diff --git a/vp8/common/entropy.c b/vp8/common/entropy.c index ba1e5aed5..e5a58646c 100644 --- a/vp8/common/entropy.c +++ b/vp8/common/entropy.c @@ -92,12 +92,6 @@ DECLARE_ALIGNED(16, short, vp8_default_zig_zag_mask[16]); DECLARE_ALIGNED(64, short, vp8_default_zig_zag_mask_8x8[64]);//int64_t #endif -#if CONFIG_SEGFEATURES -const int vp8_seg_feature_data_bits[SEG_LVL_MAX] = {7, 6, 4, 4, 4, 2}; -#else -const int vp8_seg_feature_data_bits[SEG_LVL_MAX] = {7, 6}; -#endif - /* Array indices are identical to previously-existing CONTEXT_NODE indices */ const vp8_tree_index vp8_coef_tree[ 22] = /* corresponding _CONTEXT_NODEs */ diff --git a/vp8/common/entropy.h b/vp8/common/entropy.h index e75c3966b..3bce23da5 100644 --- a/vp8/common/entropy.h +++ b/vp8/common/entropy.h @@ -106,7 +106,5 @@ extern short vp8_default_zig_zag_mask[16]; extern DECLARE_ALIGNED(64, const int, vp8_default_zig_zag1d_8x8[64]); extern short vp8_default_zig_zag_mask_8x8[64];//int64_t #endif -extern const int vp8_seg_feature_data_bits[SEG_LVL_MAX]; - void vp8_coef_tree_initialize(void); #endif diff --git a/vp8/common/loopfilter.c b/vp8/common/loopfilter.c index 56baca809..0ee151e82 100644 --- a/vp8/common/loopfilter.c +++ b/vp8/common/loopfilter.c @@ -14,9 +14,9 @@ #include "onyxc_int.h" #include "vpx_mem/vpx_mem.h" -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #include "vp8/common/seg_common.h" -#endif +//#endif typedef unsigned char uc; @@ -221,11 +221,8 @@ void vp8_loop_filter_frame_init(VP8_COMMON *cm, // Set the baseline filter values for each segment -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if ( segfeature_active( xd, seg, SEG_LVL_ALT_LF ) ) -#else - if ( xd->segmentation_enabled ) -#endif { /* Abs value */ if (xd->mb_segement_abs_delta == SEGMENT_ABSDATA) diff --git a/vp8/common/seg_common.c b/vp8/common/seg_common.c index ddf7c6fcf..42dcadaad 100644 --- a/vp8/common/seg_common.c +++ b/vp8/common/seg_common.c @@ -10,9 +10,9 @@ #include "vp8/common/seg_common.h" -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES const int segfeaturedata_signed[SEG_LVL_MAX] = {1, 1, 0, 0, 0, 0}; - +const int vp8_seg_feature_data_bits[SEG_LVL_MAX] = {7, 6, 4, 4, 4, 2}; // These functions provide access to new segment level features. // Eventually these function may be "optimized out" but for the moment, @@ -48,6 +48,11 @@ void disable_segfeature( MACROBLOCKD *xd, xd->segment_feature_mask[segment_id] &= ~(1 << feature_id); } +int seg_feature_data_bits( SEG_LVL_FEATURES feature_id ) +{ + return vp8_seg_feature_data_bits[feature_id]; +} + int is_segfeature_signed( SEG_LVL_FEATURES feature_id ) { return ( segfeaturedata_signed[feature_id] ); @@ -103,5 +108,3 @@ int check_segref_inter(MACROBLOCKD *xd, int segment_id) } // TBD? Functions to read and write segment data with range / validity checking - -#endif diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c index 34a3c84e0..db836e030 100644 --- a/vp8/decoder/decodemv.c +++ b/vp8/decoder/decodemv.c @@ -15,9 +15,8 @@ #include "onyxd_int.h" #include "vp8/common/findnearmv.h" -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #include "vp8/common/seg_common.h" -#endif #if CONFIG_SEGMENTATION #include "vp8/common/seg_common.h" @@ -93,21 +92,18 @@ static void vp8_kfread_modes(VP8D_COMP *pbi, MODE_INFO *m, int mb_row, int mb_co if (pbi->mb.update_mb_segmentation_map) vp8_read_mb_features(bc, &m->mbmi, &pbi->mb); -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if ( pbi->common.mb_no_coeff_skip && ( !segfeature_active( &pbi->mb, m->mbmi.segment_id, SEG_LVL_EOB ) || (pbi->mb.segment_feature_data[m->mbmi.segment_id] [SEG_LVL_EOB] != 0) ) ) -#else - // Read the macroblock coeff skip flag if this feature is in use, - // else default to 0 - if (pbi->common.mb_no_coeff_skip) -#endif + { m->mbmi.mb_skip_coeff = vp8_read(bc, pbi->prob_skip_false); + } else { -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if ( segfeature_active( &pbi->mb, m->mbmi.segment_id, SEG_LVL_EOB ) && (pbi->mb.segment_feature_data[m->mbmi.segment_id] @@ -116,7 +112,6 @@ static void vp8_kfread_modes(VP8D_COMP *pbi, MODE_INFO *m, int mb_row, int mb_co m->mbmi.mb_skip_coeff = 1; } else -#endif m->mbmi.mb_skip_coeff = 0; } @@ -238,15 +233,12 @@ static MV_REFERENCE_FRAME read_ref_frame( VP8D_COMP *pbi, MV_REFERENCE_FRAME ref_frame; int seg_ref_active; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES MACROBLOCKD *const xd = &pbi->mb; seg_ref_active = segfeature_active( xd, segment_id, SEG_LVL_REF_FRAME ); -#else - seg_ref_active = 0; -#endif // Segment reference frame features not available if ( !seg_ref_active ) @@ -264,7 +256,7 @@ static MV_REFERENCE_FRAME read_ref_frame( VP8D_COMP *pbi, } } -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // Segment reference frame features are enabled else { @@ -335,7 +327,6 @@ static MV_REFERENCE_FRAME read_ref_frame( VP8D_COMP *pbi, } } } -#endif return (MV_REFERENCE_FRAME)ref_frame; } @@ -500,15 +491,12 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, #endif } -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if ( pbi->common.mb_no_coeff_skip && ( !segfeature_active( xd, mbmi->segment_id, SEG_LVL_EOB ) || (xd->segment_feature_data[mbmi->segment_id] [SEG_LVL_EOB] != 0) ) ) -#else - if (pbi->common.mb_no_coeff_skip) -#endif { // Read the macroblock coeff skip flag if this feature is in use, // else default to 0 @@ -516,7 +504,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, } else { -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if ( segfeature_active( xd, mbmi->segment_id, SEG_LVL_EOB ) && (xd->segment_feature_data[mbmi->segment_id] @@ -525,7 +513,6 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, mbmi->mb_skip_coeff = 1; } else -#endif mbmi->mb_skip_coeff = 0; } @@ -543,7 +530,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, mbmi->ref_frame, pbi->common.ref_frame_sign_bias); vp8_mv_ref_probs(mv_ref_p, rct); -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // Is the segment level mode feature enabled for this segment if ( segfeature_active( xd, mbmi->segment_id, SEG_LVL_MODE ) ) { @@ -554,9 +541,6 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, { mbmi->mode = read_mv_ref(bc, mv_ref_p); } -#else - mbmi->mode = read_mv_ref(bc, mv_ref_p); -#endif mbmi->uv_mode = DC_PRED; switch (mbmi->mode) @@ -709,12 +693,11 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, /* required for left and above block mv */ mbmi->mv.as_int = 0; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if ( segfeature_active( xd, mbmi->segment_id, SEG_LVL_MODE ) ) mbmi->mode = (MB_PREDICTION_MODE) get_segdata( xd, mbmi->segment_id, SEG_LVL_MODE ); else -#endif { mbmi->mode = (MB_PREDICTION_MODE) vp8_read_ymode(bc, pbi->common.fc.ymode_prob); @@ -741,12 +724,11 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi) MODE_INFO *mi = pbi->common.mi; int mb_row = -1; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #if 0 FILE *statsfile; statsfile = fopen("decsegmap.stt", "a"); fprintf(statsfile, "\n" ); -#endif #endif mb_mode_mv_init(pbi); @@ -772,10 +754,9 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi) mb_to_bottom_edge = ((pbi->common.mb_rows - 1 - mb_row) * 16) << 3; mb_to_bottom_edge += RIGHT_BOTTOM_MARGIN; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #if 0 fprintf(statsfile, "\n" ); -#endif #endif while (++mb_col < pbi->common.mb_cols) @@ -818,12 +799,12 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi) } #endif -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #if 0 fprintf(statsfile, "%2d%2d%2d ", mi->mbmi.segment_id, mi->mbmi.ref_frame, mi->mbmi.mode ); #endif -#endif + mi++; /* next macroblock */ } @@ -831,10 +812,10 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi) mi++; /* skip left predictor each row */ } -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #if 0 fclose(statsfile); #endif -#endif + } diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c index 842bcc209..e81a8c58b 100644 --- a/vp8/decoder/decodframe.c +++ b/vp8/decoder/decodframe.c @@ -37,9 +37,8 @@ #include "decoderthreading.h" #include "dboolhuff.h" -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #include "vp8/common/seg_common.h" -#endif #include #include @@ -81,11 +80,8 @@ void mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd) // Set the Q baseline allowing for any segment level adjustment -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if ( segfeature_active( xd, segment_id, SEG_LVL_ALT_Q ) ) -#else - if ( xd->segmentation_enabled ) -#endif { /* Abs Value */ if (xd->mb_segement_abs_delta == SEGMENT_ABSDATA) @@ -807,10 +803,9 @@ static void init_frame(VP8D_COMP *pbi) // Reset the segment feature data to the default stats: // Features disabled, 0, with delta coding (Default state). -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES vpx_memset(xd->segment_feature_mask, 0, sizeof(xd->segment_feature_mask)); -#endif vpx_memset(xd->segment_feature_data, 0, sizeof(xd->segment_feature_data)); @@ -883,7 +878,6 @@ int vp8_decode_frame(VP8D_COMP *pbi) int mb_row; int i, j, k, l; - const int *const mb_feature_data_bits = vp8_seg_feature_data_bits; int corrupt_tokens = 0; int prev_independent_partitions = pbi->independent_partitions; @@ -1028,58 +1022,41 @@ int vp8_decode_frame(VP8D_COMP *pbi) if (xd->update_mb_segmentation_data) { + int data; + xd->mb_segement_abs_delta = (unsigned char)vp8_read_bit(bc); -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES clearall_segfeatures( xd ); // For each segmentation... - for (j = 0; j < MAX_MB_SEGMENTS; j++) + for (i = 0; i < MAX_MB_SEGMENTS; i++) { // For each of the segments features... - for (i = 0; i < SEG_LVL_MAX; i++) - { -#else - // Clear down feature data structure - vpx_memset(xd->segment_feature_data, 0, - sizeof(xd->segment_feature_data)); - - // For each segmentation feature... - for (i = 0; i < SEG_LVL_MAX; i++) - { - // For each segmentation... - for (j = 0; j < MAX_MB_SEGMENTS; j++) + for (j = 0; j < SEG_LVL_MAX; j++) { -#endif // Is the feature enabled if (vp8_read_bit(bc)) { -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // Update the feature data and mask - enable_segfeature(xd, j, i); -#endif - xd->segment_feature_data[j][i] = - (signed char)vp8_read_literal( - bc, mb_feature_data_bits[i]); + enable_segfeature(xd, i, j); -#if CONFIG_SEGFEATURES + data = (signed char)vp8_read_literal( + bc, seg_feature_data_bits(j)); + +//#if CONFIG_SEGFEATURES // Is the segment data signed.. - if ( is_segfeature_signed(i) ) -#else - if ( 1 ) -#endif + if ( is_segfeature_signed(j) ) { if (vp8_read_bit(bc)) - { - xd->segment_feature_data[j][i] = - -xd->segment_feature_data[j][i]; - } + data = - data; } } else - { - xd->segment_feature_data[j][i] = 0; - } + data = 0; + + set_segdata(xd, i, j, data); } } } diff --git a/vp8/decoder/detokenize.c b/vp8/decoder/detokenize.c index e01ce4183..e69a7d34f 100644 --- a/vp8/decoder/detokenize.c +++ b/vp8/decoder/detokenize.c @@ -16,9 +16,8 @@ #include "vpx_ports/mem.h" #include "detokenize.h" -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #include "vp8/common/seg_common.h" -#endif #define BOOL_DATA UINT8 @@ -651,7 +650,7 @@ int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *xd) INT16 v; const vp8_prob *Prob; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES int seg_eob = 16; int segment_id = xd->mode_info_context->mbmi.segment_id; @@ -659,7 +658,6 @@ int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *xd) { seg_eob = xd->segment_feature_data[segment_id][SEG_LVL_EOB]; } -#endif type = 3; i = 0; @@ -701,10 +699,9 @@ BLOCK_LOOP: Prob += v * ENTROPY_NODES; DO_WHILE: -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if ( c == seg_eob ) goto BLOCK_FINISHED; -#endif Prob += coef_bands_x[c]; DECODE_AND_BRANCH_IF_ZERO(Prob[EOB_CONTEXT_NODE], BLOCK_FINISHED); diff --git a/vp8/decoder/threading.c b/vp8/decoder/threading.c index 68df61821..e6d31008d 100644 --- a/vp8/decoder/threading.c +++ b/vp8/decoder/threading.c @@ -69,11 +69,10 @@ static void setup_decoding_thread_data(VP8D_COMP *pbi, MACROBLOCKD *xd, MB_ROW_D vpx_memcpy(mbd->segment_feature_data, xd->segment_feature_data, sizeof(xd->segment_feature_data)); -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES vpx_memcpy(mbd->segment_feature_mask, xd->segment_feature_mask, sizeof(xd->segment_feature_mask)); -#endif /*signed char ref_lf_deltas[MAX_REF_LF_DELTAS];*/ vpx_memcpy(mbd->ref_lf_deltas, xd->ref_lf_deltas, sizeof(xd->ref_lf_deltas)); diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c index 9eb9de1ca..5506e9a57 100644 --- a/vp8/encoder/bitstream.c +++ b/vp8/encoder/bitstream.c @@ -25,9 +25,8 @@ #include "defaultcoefcounts.h" -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #include "vp8/common/seg_common.h" -#endif #if CONFIG_SEGMENTATION static int segment_cost = 0; @@ -883,13 +882,10 @@ static void encode_ref_frame( vp8_writer *const w, int prob_gf_coded ) { int seg_ref_active; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES seg_ref_active = segfeature_active( xd, segment_id, SEG_LVL_REF_FRAME ); -#else - seg_ref_active = 0; -#endif // No segment features or segment reference frame featuure is disabled if ( !seg_ref_active ) @@ -913,7 +909,7 @@ static void encode_ref_frame( vp8_writer *const w, } } } -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES else { if (rf == INTRA_FRAME) @@ -955,7 +951,6 @@ static void encode_ref_frame( vp8_writer *const w, } } } -#endif } static void pack_inter_mode_mvs(VP8_COMP *const cpi) @@ -985,13 +980,12 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) cpi->mb.partition_info = cpi->mb.pi; - // Calculate the probabilities to be used to code the reference frame based on actual useage this frame -#if CONFIG_SEGFEATURES + // Calculate the probabilities to be used to code the reference frame + // based on actual useage this frame +//#if CONFIG_SEGFEATURES cpi->prob_intra_coded = (rf_intra + rf_inter) ? rf_intra * 255 / (rf_intra + rf_inter) : 1; -#else - cpi->prob_intra_coded = rf_intra * 255 / (rf_intra + rf_inter); -#endif + if (!cpi->prob_intra_coded) cpi->prob_intra_coded = 1; @@ -1111,13 +1105,10 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) #endif } -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if ( pc->mb_no_coeff_skip && ( !segfeature_active( xd, segment_id, SEG_LVL_EOB ) || (xd->segment_feature_data[segment_id][SEG_LVL_EOB] != 0) ) ) -#else - if (pc->mb_no_coeff_skip) -#endif { vp8_encode_bool(w, mi->mb_skip_coeff, prob_skip_false); } @@ -1133,12 +1124,9 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) active_section = 6; #endif -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if ( !segfeature_active( xd, segment_id, SEG_LVL_MODE ) ) write_ymode(w, mode, pc->fc.ymode_prob); -#else - write_ymode(w, mode, pc->fc.ymode_prob); -#endif if (mode == B_PRED) { @@ -1172,15 +1160,13 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) active_section = 3; #endif -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // Is the segment coding of reference frame enabled if ( !segfeature_active( xd, segment_id, SEG_LVL_MODE ) ) { write_mv_ref(w, mode, mv_ref_p); } -#else - write_mv_ref(w, mode, mv_ref_p); -#endif + { switch (mode) /* new, split require MVs */ { @@ -1268,9 +1254,8 @@ static void write_kfmodes(VP8_COMP *cpi) int mb_row = -1; int prob_skip_false = 0; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES MACROBLOCKD *xd = &cpi->mb.e_mbd; -#endif if (c->mb_no_coeff_skip) { @@ -1332,13 +1317,10 @@ static void write_kfmodes(VP8_COMP *cpi) #endif } -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if ( c->mb_no_coeff_skip && ( !segfeature_active( xd, segment_id, SEG_LVL_EOB ) || (xd->segment_feature_data[segment_id][SEG_LVL_EOB] != 0) ) ) -#else - if (c->mb_no_coeff_skip) -#endif { vp8_encode_bool(bc, m->mbmi.mb_skip_coeff, prob_skip_false); } @@ -1591,12 +1573,10 @@ int vp8_estimate_entropy_savings(VP8_COMP *cpi) if (cpi->common.frame_type != KEY_FRAME) { -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES new_intra = (rf_intra + rf_inter) ? rf_intra * 255 / (rf_intra + rf_inter) : 1; -#else - new_intra = rf_intra * 255 / (rf_intra + rf_inter); -#endif + if (!new_intra) new_intra = 1; @@ -1988,7 +1968,6 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size) oh.version = pc->version; oh.first_partition_length_in_bytes = 0; - mb_feature_data_bits = vp8_seg_feature_data_bits; cx_data += 3; #if defined(SECTIONBITS_OUTPUT) @@ -2049,59 +2028,44 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size) vp8_write_bit(bc, (xd->mb_segement_abs_delta) ? 1 : 0); -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // For each segments id... - for (j = 0; j < MAX_MB_SEGMENTS; j++) + for (i = 0; i < MAX_MB_SEGMENTS; i++) { // For each segmentation codable feature... - for (i = 0; i < SEG_LVL_MAX; i++) -#else - // For each segmentation codable feature... - for (i = 0; i < SEG_LVL_MAX; i++) - { - // For each of the segments id... - for (j = 0; j < MAX_MB_SEGMENTS; j++) -#endif + for (j = 0; j < SEG_LVL_MAX; j++) { - Data = xd->segment_feature_data[j][i]; + Data = get_segdata( xd, i, j ); -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // If the feature is enabled... - if ( segfeature_active( xd, j, i ) ) -#else - // If the feature is enabled...Indicated by non zero - // value in VP8 - if (Data) -#endif + if ( segfeature_active( xd, i, j ) ) { vp8_write_bit(bc, 1); -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // Is the segment data signed.. - if ( is_segfeature_signed(i) ) -#else - if ( 1 ) -#endif + if ( is_segfeature_signed(j) ) { // Encode the relevant feature data if (Data < 0) { Data = - Data; vp8_write_literal(bc, Data, - mb_feature_data_bits[i]); + seg_feature_data_bits(j)); vp8_write_bit(bc, 1); } else { vp8_write_literal(bc, Data, - mb_feature_data_bits[i]); + seg_feature_data_bits(j)); vp8_write_bit(bc, 0); } } // Unsigned data element so no sign bit needed else vp8_write_literal(bc, Data, - mb_feature_data_bits[i]); + seg_feature_data_bits(j)); } else vp8_write_bit(bc, 0); diff --git a/vp8/encoder/block.h b/vp8/encoder/block.h index 78d410801..12209ab4c 100644 --- a/vp8/encoder/block.h +++ b/vp8/encoder/block.h @@ -46,9 +46,8 @@ typedef struct int src; int src_stride; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES int eob_max_offset; -#endif } BLOCK; diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c index 7192ae539..36abff562 100644 --- a/vp8/encoder/encodeframe.c +++ b/vp8/encoder/encodeframe.c @@ -31,9 +31,8 @@ #include "vp8/common/subpixel.h" #include "vpx_ports/vpx_timer.h" -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES //#define DBG_PRNT_SEGMAP 1 -#endif #if CONFIG_RUNTIME_CPU_DETECT #define RTCD(x) &cpi->common.rtcd.x @@ -846,7 +845,7 @@ void encode_mb_row(VP8_COMP *cpi, #endif -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // debug output #if DBG_PRNT_SEGMAP { @@ -856,7 +855,6 @@ void encode_mb_row(VP8_COMP *cpi, fclose(statsfile); } #endif -#endif } void init_encode_frame_mb_context(VP8_COMP *cpi) @@ -967,7 +965,7 @@ void vp8_encode_frame(VP8_COMP *cpi) int totalrate; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // debug output #if DBG_PRNT_SEGMAP { @@ -976,7 +974,6 @@ void vp8_encode_frame(VP8_COMP *cpi) fprintf(statsfile, "\n" ); fclose(statsfile); } -#endif #endif vpx_memset(segment_counts, 0, sizeof(segment_counts)); @@ -1350,7 +1347,7 @@ void vp8_encode_frame(VP8_COMP *cpi) cpi->prob_gf_coded = 1; } } -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES else { // Trap case where cpi->count_mb_ref_frame_usage[] blank. @@ -1358,7 +1355,6 @@ void vp8_encode_frame(VP8_COMP *cpi) cpi->prob_last_coded = 128; cpi->prob_gf_coded = 128; } -#endif } #if 0 // Keep record of the total distortion this time around for future use @@ -1661,7 +1657,7 @@ int vp8cx_encode_inter_macroblock vp8cx_mb_init_quantizer(cpi, x); } } -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES else { //segfeature_test_function(cpi, xd); @@ -1680,7 +1676,6 @@ int vp8cx_encode_inter_macroblock } #endif } -#endif } { @@ -1711,8 +1706,7 @@ int vp8cx_encode_inter_macroblock vp8_update_zbin_extra(cpi, x); } -#if CONFIG_SEGFEATURES - +//#if CONFIG_SEGFEATURES // If we have just a single reference frame coded for a segment then // exclude from the reference frame counts used to work out // probabilities. NOTE: At the moment we dont support custom trees @@ -1726,9 +1720,6 @@ int vp8cx_encode_inter_macroblock { cpi->count_mb_ref_frame_usage[xd->mode_info_context->mbmi.ref_frame]++; } -#else - cpi->count_mb_ref_frame_usage[xd->mode_info_context->mbmi.ref_frame] ++; -#endif #if CONFIG_T8X8 if (xd->segmentation_enabled) diff --git a/vp8/encoder/ethreading.c b/vp8/encoder/ethreading.c index e1e4b1476..94fb429d8 100644 --- a/vp8/encoder/ethreading.c +++ b/vp8/encoder/ethreading.c @@ -356,9 +356,8 @@ static void setup_mbby_copy(MACROBLOCK *mbdst, MACROBLOCK *mbsrc) z->block[i].src = x->block[i].src; */ z->block[i].src_stride = x->block[i].src_stride; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES z->block[i].eob_max_offset = x->block[i].eob_max_offset; -#endif } { @@ -397,11 +396,10 @@ static void setup_mbby_copy(MACROBLOCK *mbdst, MACROBLOCK *mbsrc) xd->segment_feature_data, sizeof(xd->segment_feature_data)); -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES vpx_memcpy(zd->segment_feature_mask, xd->segment_feature_mask, sizeof(xd->segment_feature_mask)); -#endif for (i = 0; i < 25; i++) { diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index ee3a59eeb..98933c19c 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -34,10 +34,9 @@ #include "vpx_ports/vpx_timer.h" #include "temporal_filter.h" -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #include "vp8/common/seg_common.h" #include "mbgraph.h" -#endif #if ARCH_ARM #include "vpx_ports/arm.h" @@ -338,9 +337,8 @@ static void setup_features(VP8_COMP *cpi) vpx_memset(xd->mb_segment_tree_probs, 255, sizeof(xd->mb_segment_tree_probs)); vpx_memset(xd->segment_feature_data, 0, sizeof(xd->segment_feature_data)); -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES vpx_memset(xd->segment_feature_mask, 0, sizeof(xd->segment_feature_mask)); -#endif xd->mode_ref_lf_delta_enabled = 0; xd->mode_ref_lf_delta_update = 0; @@ -458,10 +456,9 @@ static void segmentation_test_function(VP8_PTR ptr) feature_data[SEG_LVL_ALT_LF][2] = 0; feature_data[SEG_LVL_ALT_LF][3] = 0; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // Enable features as required enable_segfeature(xd, 1, SEG_LVL_ALT_Q); -#endif // Initialise the feature data structure // SEGMENT_DELTADATA 0, SEGMENT_ABSDATA 1 @@ -474,7 +471,7 @@ static void segmentation_test_function(VP8_PTR ptr) } -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES static void init_seg_features(VP8_COMP *cpi) { VP8_COMMON *cm = &cpi->common; @@ -656,8 +653,6 @@ static void print_seg_map(VP8_COMP *cpi) fclose(statsfile); } -#endif - // A simple function to cyclically refresh the background at a lower Q static void cyclic_background_refresh(VP8_COMP *cpi, int Q, int lf_adjustment) { @@ -741,11 +736,10 @@ static void cyclic_background_refresh(VP8_COMP *cpi, int Q, int lf_adjustment) feature_data[SEG_LVL_ALT_LF][2] = 0; feature_data[SEG_LVL_ALT_LF][3] = 0; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // Enable the loop and quant changes in the feature mask enable_segfeature(xd, 1, SEG_LVL_ALT_Q); enable_segfeature(xd, 1, SEG_LVL_ALT_LF); -#endif // Initialise the feature data structure // SEGMENT_DELTADATA 0, SEGMENT_ABSDATA 1 @@ -2133,7 +2127,7 @@ VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf) } #endif -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES for (i = 0; i < ( sizeof(cpi->mbgraph_stats) / sizeof(cpi->mbgraph_stats[0]) ); i++) { @@ -2142,7 +2136,6 @@ VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf) sizeof(*cpi->mbgraph_stats[i].mb_stats), 1)); } -#endif // Should we use the cyclic refresh method. // Currently this is tied to error resilliant mode @@ -2598,12 +2591,11 @@ void vp8_remove_compressor(VP8_PTR *ptr) vpx_free(cpi->tok); vpx_free(cpi->cyclic_refresh_map); -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES for (i = 0; i < sizeof(cpi->mbgraph_stats) / sizeof(cpi->mbgraph_stats[0]); i++) { vpx_free(cpi->mbgraph_stats[i].mb_stats); } -#endif vp8_remove_common(&cpi->common); vpx_free(cpi); @@ -3698,14 +3690,9 @@ static void encode_frame_to_data_rate cpi->mb.e_mbd.segmentation_enabled = 1; cpi->mb.e_mbd.update_mb_segmentation_map = 1; #else - #if CONFIG_SEGFEATURES - // Test code for new segment features - init_seg_features( cpi ); - #else - // Set default state for segment update flags - cpi->mb.e_mbd.update_mb_segmentation_map = 0; - cpi->mb.e_mbd.update_mb_segmentation_data = 0; - #endif +//#if CONFIG_SEGFEATURES + // Test code for new segment features + init_seg_features( cpi ); #endif if (cpi->drop_frames_allowed) @@ -4712,11 +4699,10 @@ static void encode_frame_to_data_rate #endif -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #if 0 // Debug stats for segment feature experiments. print_seg_map(cpi); -#endif #endif // If this was a kf or Gf note the Q @@ -5445,7 +5431,7 @@ int vp8_set_roimap(VP8_PTR comp, unsigned char *map, unsigned int rows, unsigned cpi->segment_encode_breakout[2] = threshold[2]; cpi->segment_encode_breakout[3] = threshold[3]; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // Enable the loop and quant changes in the feature mask for ( i = 0; i < 4; i++ ) { @@ -5459,7 +5445,6 @@ int vp8_set_roimap(VP8_PTR comp, unsigned char *map, unsigned int rows, unsigned else disable_segfeature(xd, i, SEG_LVL_ALT_LF); } -#endif // Initialise the feature data structure // SEGMENT_DELTADATA 0, SEGMENT_ABSDATA 1 diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c index 3eb446e1c..ee9c43a15 100644 --- a/vp8/encoder/pickinter.c +++ b/vp8/encoder/pickinter.c @@ -27,9 +27,8 @@ #include "rdopt.h" #include "vpx_mem/vpx_mem.h" -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #include "vp8/common/seg_common.h" -#endif #if CONFIG_RUNTIME_CPU_DETECT #define IF_RTCD(x) (x) @@ -521,7 +520,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, this_mode = vp8_mode_order[mode_index]; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // Experimental use of Segment features. if ( xd->segmentation_enabled && !cm->refresh_alt_ref_frame ) { @@ -542,7 +541,9 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, continue; } } -#else + +//#if !CONFIG_SEGFEATURES + /* TBD PGW // Only consider ZEROMV/ALTREF_FRAME for alt ref frame, // unless ARNR filtering is enabled in which case we want // an unfiltered alternative @@ -552,27 +553,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, x->e_mbd.mode_info_context->mbmi.ref_frame != ALTREF_FRAME) continue; } - - // Check to see if the testing frequency for this mode is at its max - // If so then prevent it from being tested and increase the threshold for its testing - if (cpi->mode_test_hit_counts[mode_index] && (cpi->mode_check_freq[mode_index] > 1)) - { - //if ( (cpi->mbs_tested_so_far / cpi->mode_test_hit_counts[mode_index]) <= cpi->mode_check_freq[mode_index] ) - if (cpi->mbs_tested_so_far <= (cpi->mode_check_freq[mode_index] * cpi->mode_test_hit_counts[mode_index])) - { - // Increase the threshold for coding this mode to make it less likely to be chosen - cpi->rd_thresh_mult[mode_index] += 4; - - if (cpi->rd_thresh_mult[mode_index] > MAX_THRESHMULT) - cpi->rd_thresh_mult[mode_index] = MAX_THRESHMULT; - - cpi->rd_threshes[mode_index] = (cpi->rd_baseline_thresh[mode_index] >> 7) * cpi->rd_thresh_mult[mode_index]; - - continue; - } - } -#endif - +*/ // We have now reached the point where we are going to test the current mode so increment the counter for the number of times it has been tested cpi->mode_test_hit_counts[mode_index] ++; diff --git a/vp8/encoder/quantize.c b/vp8/encoder/quantize.c index 89559273f..c34749c97 100644 --- a/vp8/encoder/quantize.c +++ b/vp8/encoder/quantize.c @@ -16,9 +16,8 @@ #include "quantize.h" #include "vp8/common/quant_common.h" -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #include "vp8/common/seg_common.h" -#endif #ifdef ENC_DEBUG extern int enc_debug; @@ -136,11 +135,8 @@ void vp8_regular_quantize_b(BLOCK *b, BLOCKD *d) eob = -1; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES for (i = 0; i < b->eob_max_offset; i++) -#else - for (i = 0; i < 16; i++) -#endif { rc = vp8_default_zig_zag1d[i]; z = coeff_ptr[rc]; @@ -1178,11 +1174,8 @@ void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x) int segment_id = xd->mode_info_context->mbmi.segment_id; // Select the baseline MB Q index allowing for any segment level change. -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if ( segfeature_active( xd, segment_id, SEG_LVL_ALT_Q ) ) -#else - if ( xd->segmentation_enabled ) -#endif { // Abs Value if (xd->mb_segement_abs_delta == SEGMENT_ABSDATA) @@ -1217,16 +1210,15 @@ void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x) x->e_mbd.block[i].dequant = cpi->common.Y1dequant[QIndex]; x->block[i].zrun_zbin_boost = cpi->zrun_zbin_boost_y1[QIndex]; x->block[i].zbin_extra = (short)zbin_extra; -#if CONFIG_SEGFEATURES - // Segment max eob offset feature. - if ( segfeature_active( xd, segment_id, SEG_LVL_EOB ) ) - { - x->block[i].eob_max_offset = - xd->segment_feature_data[segment_id][SEG_LVL_EOB]; - } - else - x->block[i].eob_max_offset = 16; -#endif +//#if CONFIG_SEGFEATURES + // Segment max eob offset feature. + if ( segfeature_active( xd, segment_id, SEG_LVL_EOB ) ) + { + x->block[i].eob_max_offset = + xd->segment_feature_data[segment_id][SEG_LVL_EOB]; + } + else + x->block[i].eob_max_offset = 16; } // UV @@ -1245,16 +1237,15 @@ void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x) x->e_mbd.block[i].dequant = cpi->common.UVdequant[QIndex]; x->block[i].zrun_zbin_boost = cpi->zrun_zbin_boost_uv[QIndex]; x->block[i].zbin_extra = (short)zbin_extra; -#if CONFIG_SEGFEATURES - // Segment max eob offset feature. - if ( segfeature_active( xd, segment_id, SEG_LVL_EOB ) ) - { - x->block[i].eob_max_offset = - xd->segment_feature_data[segment_id][SEG_LVL_EOB]; - } - else - x->block[i].eob_max_offset = 16; -#endif +//#if CONFIG_SEGFEATURES + // Segment max eob offset feature. + if ( segfeature_active( xd, segment_id, SEG_LVL_EOB ) ) + { + x->block[i].eob_max_offset = + xd->segment_feature_data[segment_id][SEG_LVL_EOB]; + } + else + x->block[i].eob_max_offset = 16; } // Y2 @@ -1272,7 +1263,7 @@ void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x) x->block[24].zrun_zbin_boost = cpi->zrun_zbin_boost_y2[QIndex]; x->block[24].zbin_extra = (short)zbin_extra; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // TBD perhaps not use for Y2 // Segment max eob offset feature. if ( segfeature_active( xd, segment_id, SEG_LVL_EOB ) ) @@ -1282,7 +1273,6 @@ void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x) } else x->block[24].eob_max_offset = 16; -#endif /* save this macroblock QIndex for vp8_update_zbin_extra() */ x->q_index = QIndex; diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index 644739371..a2d132e5c 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -36,9 +36,8 @@ #include "dct.h" #include "vp8/common/systemdependent.h" -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #include "vp8/common/seg_common.h" -#endif #if CONFIG_RUNTIME_CPU_DETECT #define IF_RTCD(x) (x) @@ -2124,7 +2123,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int x->e_mbd.mode_info_context->mbmi.uv_mode = DC_PRED; x->e_mbd.mode_info_context->mbmi.ref_frame = vp8_ref_frame_order[mode_index]; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // Experimental use of Segment features. if ( xd->segmentation_enabled && !cm->refresh_alt_ref_frame ) { @@ -2145,7 +2144,9 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int continue; } } -#else +//#if !CONFIG_SEGFEATURES + // TBD PGW + /* // Only consider ZEROMV/ALTREF_FRAME for alt ref frame, // unless ARNR filtering is enabled in which case we want // an unfiltered alternative @@ -2154,8 +2155,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int if (this_mode != ZEROMV || x->e_mbd.mode_info_context->mbmi.ref_frame != ALTREF_FRAME) continue; - } -#endif + }*/ /* everything but intra */ if (x->e_mbd.mode_info_context->mbmi.ref_frame) @@ -2170,29 +2170,6 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int lf_or_gf = frame_lf_or_gf[x->e_mbd.mode_info_context->mbmi.ref_frame]; } -#if !CONFIG_SEGFEATURES - // Check to see if the testing frequency for this mode is at its max - // If so then prevent it from being tested and increase the threshold for its testing - if (cpi->mode_test_hit_counts[mode_index] && (cpi->mode_check_freq[mode_index] > 1)) - { - if (cpi->mbs_tested_so_far <= cpi->mode_check_freq[mode_index] * cpi->mode_test_hit_counts[mode_index]) - { - // Increase the threshold for coding this mode to make it less likely to be chosen - cpi->rd_thresh_mult[mode_index] += 4; - - if (cpi->rd_thresh_mult[mode_index] > MAX_THRESHMULT) - cpi->rd_thresh_mult[mode_index] = MAX_THRESHMULT; - - cpi->rd_threshes[mode_index] = (cpi->rd_baseline_thresh[mode_index] >> 7) * cpi->rd_thresh_mult[mode_index]; - - continue; - } - } - - // We have now reached the point where we are going to test the current mode so increment the counter for the number of times it has been tested - cpi->mode_test_hit_counts[mode_index] ++; -#endif - // Experimental code. Special case for gf and arf zeromv modes. Increase zbin size to supress noise if (cpi->zbin_mode_boost_enabled) { diff --git a/vp8/encoder/segmentation.c b/vp8/encoder/segmentation.c index e3d510642..752053dd9 100644 --- a/vp8/encoder/segmentation.c +++ b/vp8/encoder/segmentation.c @@ -109,10 +109,8 @@ void vp8_set_segment_data(VP8_PTR ptr, vpx_memcpy(cpi->mb.e_mbd.segment_feature_data, feature_data, sizeof(cpi->mb.e_mbd.segment_feature_data)); -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // TBD ?? Set the feature mask // vpx_memcpy(cpi->mb.e_mbd.segment_feature_mask, 0, // sizeof(cpi->mb.e_mbd.segment_feature_mask)); -#endif - } diff --git a/vp8/encoder/tokenize.c b/vp8/encoder/tokenize.c index 138f99447..24be76bd9 100644 --- a/vp8/encoder/tokenize.c +++ b/vp8/encoder/tokenize.c @@ -17,9 +17,8 @@ #include "tokenize.h" #include "vpx_mem/vpx_mem.h" -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES #include "vp8/common/seg_common.h" -#endif /* Global event counters used for accumulating statistics across several compressions, then generating context.c = initial stats. */ @@ -185,7 +184,7 @@ static void tokenize2nd_order_b ENTROPY_CONTEXT * l; int band, rc, v, token; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES int seg_eob = 16; int segment_id = xd->mode_info_context->mbmi.segment_id; @@ -193,7 +192,6 @@ static void tokenize2nd_order_b { seg_eob = xd->segment_feature_data[segment_id][SEG_LVL_EOB]; } -#endif b = xd->block + 24; qcoeff_ptr = b->qcoeff; @@ -222,11 +220,8 @@ static void tokenize2nd_order_b t++; } -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if (c < seg_eob) -#else - if (c < 16) -#endif { band = vp8_coef_bands[c]; t->Token = DCT_EOB_TOKEN; @@ -325,7 +320,7 @@ static void tokenize1st_order_b int band, rc, v; int tmp1, tmp2; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES int seg_eob = 16; int segment_id = xd->mode_info_context->mbmi.segment_id; @@ -333,7 +328,6 @@ static void tokenize1st_order_b { seg_eob = xd->segment_feature_data[segment_id][SEG_LVL_EOB]; } -#endif b = xd->block; /* Luma */ @@ -370,11 +364,8 @@ static void tokenize1st_order_b t++; } -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if (c < seg_eob) -#else - if (c < 16) -#endif { band = vp8_coef_bands[c]; t->Token = DCT_EOB_TOKEN; @@ -422,11 +413,8 @@ static void tokenize1st_order_b pt = vp8_prev_token_class[token]; t++; } -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES if (c < seg_eob) -#else - if (c < 16) -#endif { band = vp8_coef_bands[c]; t->Token = DCT_EOB_TOKEN; @@ -491,7 +479,7 @@ void vp8_tokenize_mb(VP8_COMP *cpi, MACROBLOCKD *x, TOKENEXTRA **t) int has_y2_block; int b; -#if CONFIG_SEGFEATURES +//#if CONFIG_SEGFEATURES // If the MB is going to be skipped because of a segment level flag // exclude this from the skip count stats used to calculate the // transmitted skip probability; @@ -505,9 +493,6 @@ void vp8_tokenize_mb(VP8_COMP *cpi, MACROBLOCKD *x, TOKENEXTRA **t) } else skip_inc = 0; -#else - int skip_inc = 1; -#endif has_y2_block = (x->mode_info_context->mbmi.mode != B_PRED #if CONFIG_I8X8 diff --git a/vp8/encoder/x86/x86_csystemdependent.c b/vp8/encoder/x86/x86_csystemdependent.c index ba980a60c..382eb0e42 100644 --- a/vp8/encoder/x86/x86_csystemdependent.c +++ b/vp8/encoder/x86/x86_csystemdependent.c @@ -217,9 +217,9 @@ void vp8_arch_x86_encoder_init(VP8_COMP *cpi) cpi->rtcd.encodemb.submby = vp8_subtract_mby_sse2; cpi->rtcd.encodemb.submbuv = vp8_subtract_mbuv_sse2; -#if !CONFIG_SEGFEATURES - cpi->rtcd.quantize.quantb = vp8_regular_quantize_b_sse2; -#endif +//#if !CONFIG_SEGFEATURES +// cpi->rtcd.quantize.quantb = vp8_regular_quantize_b_sse2; +//#endif cpi->rtcd.quantize.fastquantb = vp8_fast_quantize_b_sse2; #if !(CONFIG_REALTIME_ONLY) @@ -281,9 +281,9 @@ void vp8_arch_x86_encoder_init(VP8_COMP *cpi) cpi->rtcd.variance.sad4x4x8 = vp8_sad4x4x8_sse4; cpi->rtcd.search.full_search = vp8_full_search_sadx8; -#if !CONFIG_SEGFEATURES - cpi->rtcd.quantize.quantb = vp8_regular_quantize_b_sse4; -#endif +//#if !CONFIG_SEGFEATURES +// cpi->rtcd.quantize.quantb = vp8_regular_quantize_b_sse4; +//#endif } #endif