diff options
author | James Zern <jzern@google.com> | 2016-02-04 06:25:44 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-02-04 06:25:44 +0000 |
commit | 497b6744eae5553f5264b1c2350351a03d4a6351 (patch) | |
tree | 85c6c0948d9604ec1015936839192330c0e559dd /vp9/encoder | |
parent | b63788a116d3f503b11bee4797470bd658109530 (diff) | |
parent | 29b9461a5a1d9cdb59ae788e1c24507f82dc12b5 (diff) | |
download | libvpx-497b6744eae5553f5264b1c2350351a03d4a6351.tar libvpx-497b6744eae5553f5264b1c2350351a03d4a6351.tar.gz libvpx-497b6744eae5553f5264b1c2350351a03d4a6351.tar.bz2 libvpx-497b6744eae5553f5264b1c2350351a03d4a6351.zip |
Merge changes from topic 'dead-code'
* changes:
yv12config.c: remove dead CONFIG_ALPHA code
vp9_encoder.c: remove unused macro
vpx_mem.c: remove unused macro
vp9_svc_layercontext.c: relocate a macro definition
vp9_encoder.c: protect SNPRINT* macros w/CONFIG check
vp9_aq_360.c: remove some unused macros
vp9_diamond_search_sad_avx.c: rename (un)likely macros
vp9_resize.c: add missing include
vp9_aq_complexity.c: remove unused macros
vp9_detokenize.c: remove unused macros
Diffstat (limited to 'vp9/encoder')
-rw-r--r-- | vp9/encoder/vp9_aq_360.c | 6 | ||||
-rw-r--r-- | vp9/encoder/vp9_aq_complexity.c | 4 | ||||
-rw-r--r-- | vp9/encoder/vp9_encoder.c | 5 | ||||
-rw-r--r-- | vp9/encoder/vp9_resize.c | 1 | ||||
-rw-r--r-- | vp9/encoder/vp9_svc_layercontext.c | 6 | ||||
-rw-r--r-- | vp9/encoder/x86/vp9_diamond_search_sad_avx.c | 16 |
6 files changed, 16 insertions, 22 deletions
diff --git a/vp9/encoder/vp9_aq_360.c b/vp9/encoder/vp9_aq_360.c index 7f937344d..f8c187cc5 100644 --- a/vp9/encoder/vp9_aq_360.c +++ b/vp9/encoder/vp9_aq_360.c @@ -21,12 +21,6 @@ #include "vp9/encoder/vp9_rd.h" #include "vp9/encoder/vp9_segmentation.h" -#define ENERGY_MIN (-4) -#define ENERGY_MAX (1) -#define ENERGY_SPAN (ENERGY_MAX - ENERGY_MIN + 1) -#define ENERGY_IN_BOUNDS(energy)\ - assert((energy) >= ENERGY_MIN && (energy) <= ENERGY_MAX) - static const double rate_ratio[MAX_SEGMENTS] = {1.0, 0.75, 0.6, 0.5, 0.4, 0.3, 0.25}; diff --git a/vp9/encoder/vp9_aq_complexity.c b/vp9/encoder/vp9_aq_complexity.c index e5973220e..2d979ec70 100644 --- a/vp9/encoder/vp9_aq_complexity.c +++ b/vp9/encoder/vp9_aq_complexity.c @@ -35,9 +35,6 @@ static const double aq_c_var_thresholds[AQ_C_STRENGTHS][AQ_C_SEGMENTS] = {-3.5, -2.5, -1.5, 100.00, 100.0}, {-3.0, -2.0, -1.0, 100.00, 100.0} }; -#define DEFAULT_COMPLEXITY 64 - - static int get_aq_c_strength(int q_index, vpx_bit_depth_t bit_depth) { // Approximate base quatizer (truncated to int) const int base_quant = vp9_ac_quant(q_index, 0, bit_depth) / 4; @@ -107,7 +104,6 @@ void vp9_setup_in_frame_q_adj(VP9_COMP *cpi) { #define DEFAULT_LV_THRESH 10.0 #define MIN_DEFAULT_LV_THRESH 8.0 -#define VAR_STRENGTH_STEP 0.25 // 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. diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 1d081fdd4..53c6dd698 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -62,8 +62,6 @@ #define AM_SEGMENT_ID_INACTIVE 7 #define AM_SEGMENT_ID_ACTIVE 0 -#define SHARP_FILTER_QTHRESH 0 /* Q threshold for 8-tap sharp filter */ - #define ALTREF_HIGH_PRECISION_MV 1 // Whether to use high precision mv // for altref computation. #define HIGH_PRECISION_MV_QTHRESH 200 // Q threshold for high precision @@ -1967,11 +1965,14 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf, return cpi; } + +#if CONFIG_INTERNAL_STATS #define SNPRINT(H, T) \ snprintf((H) + strlen(H), sizeof(H) - strlen(H), (T)) #define SNPRINT2(H, T, V) \ snprintf((H) + strlen(H), sizeof(H) - strlen(H), (T), (V)) +#endif // CONFIG_INTERNAL_STATS void vp9_remove_compressor(VP9_COMP *cpi) { VP9_COMMON *cm; diff --git a/vp9/encoder/vp9_resize.c b/vp9/encoder/vp9_resize.c index 59c747852..f4d0db4d5 100644 --- a/vp9/encoder/vp9_resize.c +++ b/vp9/encoder/vp9_resize.c @@ -15,6 +15,7 @@ #include <stdlib.h> #include <string.h> +#include "./vpx_config.h" #if CONFIG_VP9_HIGHBITDEPTH #include "vpx_dsp/vpx_dsp_common.h" #endif // CONFIG_VP9_HIGHBITDEPTH diff --git a/vp9/encoder/vp9_svc_layercontext.c b/vp9/encoder/vp9_svc_layercontext.c index e0236aa6e..9724df4cd 100644 --- a/vp9/encoder/vp9_svc_layercontext.c +++ b/vp9/encoder/vp9_svc_layercontext.c @@ -16,7 +16,6 @@ #include "vp9/encoder/vp9_extend.h" #include "vpx_dsp/vpx_dsp_common.h" -#define SMALL_FRAME_FB_IDX 7 #define SMALL_FRAME_WIDTH 32 #define SMALL_FRAME_HEIGHT 16 @@ -644,6 +643,8 @@ int vp9_one_pass_cbr_svc_start_layer(VP9_COMP *const cpi) { } #if CONFIG_SPATIAL_SVC +#define SMALL_FRAME_FB_IDX 7 + int vp9_svc_start_frame(VP9_COMP *const cpi) { int width = 0, height = 0; LAYER_CONTEXT *lc; @@ -754,7 +755,8 @@ int vp9_svc_start_frame(VP9_COMP *const cpi) { return 0; } -#endif +#undef SMALL_FRAME_FB_IDX +#endif // CONFIG_SPATIAL_SVC struct lookahead_entry *vp9_svc_lookahead_pop(VP9_COMP *const cpi, struct lookahead_ctx *ctx, diff --git a/vp9/encoder/x86/vp9_diamond_search_sad_avx.c b/vp9/encoder/x86/vp9_diamond_search_sad_avx.c index 7b28e1335..b475f8db1 100644 --- a/vp9/encoder/x86/vp9_diamond_search_sad_avx.c +++ b/vp9/encoder/x86/vp9_diamond_search_sad_avx.c @@ -19,11 +19,11 @@ #include "vpx_ports/mem.h" #ifdef __GNUC__ -# define __likely__(v) __builtin_expect(v, 1) -# define __unlikely__(v) __builtin_expect(v, 0) +# define LIKELY(v) __builtin_expect(v, 1) +# define UNLIKELY(v) __builtin_expect(v, 0) #else -# define __likely__(v) (v) -# define __unlikely__(v) (v) +# define LIKELY(v) (v) +# define UNLIKELY(v) (v) #endif static INLINE int_mv pack_int_mv(int16_t row, int16_t col) { @@ -163,7 +163,7 @@ int vp9_diamond_search_sad_avx(const MACROBLOCK *x, v_inside_d = _mm_cmpeq_epi32(v_these_mv_clamp_w, v_these_mv_w); // If none of them are inside, then move on - if (__likely__(_mm_test_all_zeros(v_inside_d, v_inside_d))) { + if (LIKELY(_mm_test_all_zeros(v_inside_d, v_inside_d))) { continue; } @@ -269,7 +269,7 @@ int vp9_diamond_search_sad_avx(const MACROBLOCK *x, // If the local best value is not saturated, just use it, otherwise // find the horizontal minimum again the hard way on 32 bits. // This is executed rarely. - if (__unlikely__(local_best_sad == 0xffff)) { + if (UNLIKELY(local_best_sad == 0xffff)) { __m128i v_loval_d, v_hival_d, v_loidx_d, v_hiidx_d, v_sel_d; v_loval_d = v_sad_d; @@ -294,7 +294,7 @@ int vp9_diamond_search_sad_avx(const MACROBLOCK *x, } // Update the global minimum if the local minimum is smaller - if (__likely__(local_best_sad < best_sad)) { + if (LIKELY(local_best_sad < best_sad)) { new_bmv = ((const int_mv *)&v_these_mv_w)[local_best_idx]; new_best_address = ((const uint8_t **)v_blocka)[local_best_idx]; @@ -313,7 +313,7 @@ int vp9_diamond_search_sad_avx(const MACROBLOCK *x, v_ba_d = _mm_set1_epi32((intptr_t)best_address); #endif - if (__unlikely__(best_address == in_what)) { + if (UNLIKELY(best_address == in_what)) { (*num00)++; } } |