From 59b560acef8bff4c50d66a553f24a3ff7f2e1b30 Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 2 Feb 2016 17:42:07 -0800 Subject: vp9_aq_complexity.c: remove unused macros DEFAULT_COMPLEXITY VAR_STRENGTH_STEP unused since first commit Change-Id: I4a47544098caf0d72e571633b7776146be88237c --- vp9/encoder/vp9_aq_complexity.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'vp9/encoder') 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. -- cgit v1.2.3 From 8a515c16fdfd9ab3c1ebf9d842ad0722663e9e20 Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 2 Feb 2016 17:43:33 -0800 Subject: vp9_resize.c: add missing include Change-Id: I429e3c80216102ed0a85ce348ecac0bf1e1e28eb --- vp9/encoder/vp9_resize.c | 1 + 1 file changed, 1 insertion(+) (limited to 'vp9/encoder') 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 #include +#include "./vpx_config.h" #if CONFIG_VP9_HIGHBITDEPTH #include "vpx_dsp/vpx_dsp_common.h" #endif // CONFIG_VP9_HIGHBITDEPTH -- cgit v1.2.3 From 8647792975b68797fc98d0e1bca20380e06e22e5 Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 2 Feb 2016 17:44:02 -0800 Subject: vp9_diamond_search_sad_avx.c: rename (un)likely macros avoid using '__' this is a reserved namespace for the compiler Change-Id: I7d2be4dba2bdddc6f1010a16ad9e59a2e211b064 --- vp9/encoder/x86/vp9_diamond_search_sad_avx.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'vp9/encoder') diff --git a/vp9/encoder/x86/vp9_diamond_search_sad_avx.c b/vp9/encoder/x86/vp9_diamond_search_sad_avx.c index 2ed3f1a8b..f6fe7a4eb 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) { @@ -162,7 +162,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; } @@ -268,7 +268,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; @@ -293,7 +293,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]; @@ -312,7 +312,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)++; } } -- cgit v1.2.3 From d78ebb82f54333634fb6a40fad057da3536c4d07 Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 2 Feb 2016 17:46:44 -0800 Subject: vp9_aq_360.c: remove some unused macros ENERGY_MIN ENERGY_MAX ENERGY_SPAN ENERGY_IN_BOUNDS unused since first commit Change-Id: I5507d36487aaee3e64f7a5fba582791ef9a533b0 --- vp9/encoder/vp9_aq_360.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'vp9/encoder') 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}; -- cgit v1.2.3 From d6c66d46916c4dfc1da31694409326bf35d82ee0 Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 2 Feb 2016 17:50:42 -0800 Subject: vp9_encoder.c: protect SNPRINT* macros w/CONFIG check these are only used with CONFIG_INTERNAL_STATS Change-Id: Ibbcefbdc1db79d93f75e5865289f9960a8c2358a --- vp9/encoder/vp9_encoder.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vp9/encoder') diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 1d081fdd4..047d28d6e 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -1967,11 +1967,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; -- cgit v1.2.3 From c9e057a9a0d49ff878895272ba1f072ad64b0157 Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 2 Feb 2016 17:51:25 -0800 Subject: vp9_svc_layercontext.c: relocate a macro definition move SMALL_FRAME_FB_IDX closer to its first use. this is only used with CONFIG_SPATIAL_SVC. Change-Id: Ibf2b3e59a3aab2be2c3b3f89b4380ebe272e0ed6 --- vp9/encoder/vp9_svc_layercontext.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'vp9/encoder') 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, -- cgit v1.2.3 From fc110235addbd6724ec5736d9d1c1b795ceaef14 Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 2 Feb 2016 17:56:50 -0800 Subject: vp9_encoder.c: remove unused macro SHARP_FILTER_QTHRESH unused since: 5373119 Merging in the Switchable interp experiment Change-Id: I9ccc1883828babffd1886810b59aa16aca4766bf --- vp9/encoder/vp9_encoder.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'vp9/encoder') diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 047d28d6e..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 -- cgit v1.2.3