rm aom_highbd_calc_variance_stat() in non-hbd builds Change-Id: I1c84b8446cede6009c3bcfebf958723f168f4a25
diff --git a/aom_dsp/aom_dsp_rtcd_defs.pl b/aom_dsp/aom_dsp_rtcd_defs.pl index 0abd013..5c274aa 100755 --- a/aom_dsp/aom_dsp_rtcd_defs.pl +++ b/aom_dsp/aom_dsp_rtcd_defs.pl
@@ -1388,8 +1388,10 @@ add_proto qw/int64_t/, "aom_calc_variance_stat", "const uint8_t *src, int stride, int bw, int bh"; specialize qw/aom_calc_variance_stat avx2/; - add_proto qw/int64_t/, "aom_highbd_calc_variance_stat", "const uint16_t *src, int stride, int bw, int bh"; - specialize qw/aom_highbd_calc_variance_stat avx2/; + if (aom_config("CONFIG_AV1_HIGHBITDEPTH") eq "yes") { + add_proto qw/int64_t/, "aom_highbd_calc_variance_stat", "const uint16_t *src, int stride, int bw, int bh"; + specialize qw/aom_highbd_calc_variance_stat avx2/; + } add_proto qw/uint64_t/, "aom_mse_16xh_16bit", "uint8_t *dst, int dstride,uint16_t *src, int w, int h"; specialize qw/aom_mse_16xh_16bit sse2 avx2 neon/;
diff --git a/aom_dsp/variance.c b/aom_dsp/variance.c index 0409652..e360741 100644 --- a/aom_dsp/variance.c +++ b/aom_dsp/variance.c
@@ -1145,6 +1145,7 @@ return var_stats; } +#if CONFIG_AV1_HIGHBITDEPTH int64_t aom_highbd_calc_variance_stat_c(const uint16_t *src, int stride, int bw, int bh) { DECLARE_ALIGNED(16, uint16_t, dclevel[(MAX_SB_SIZE + 2) * (MAX_SB_SIZE + 2)]); @@ -1192,7 +1193,6 @@ return var_stats; } -#if CONFIG_AV1_HIGHBITDEPTH uint64_t aom_mse_wxh_16bit_highbd_c(uint16_t *dst, int dstride, uint16_t *src, int sstride, int w, int h) { uint64_t sum = 0;
diff --git a/aom_dsp/x86/variance_avx2.c b/aom_dsp/x86/variance_avx2.c index 9b264c8..f74eb95 100644 --- a/aom_dsp/x86/variance_avx2.c +++ b/aom_dsp/x86/variance_avx2.c
@@ -1131,6 +1131,7 @@ return total_var << 4; } +#if CONFIG_AV1_HIGHBITDEPTH static inline int64_t yy_hsum_epi64_si64(__m256i v) { __m128i v128 = _mm_add_epi64(_mm256_castsi256_si128(v), _mm256_extracti128_si256(v, 1)); @@ -1310,6 +1311,7 @@ return total_var << 4; } +#endif // CONFIG_AV1_HIGHBITDEPTH void aom_get_var_sse_sum_8x8_quad_avx2(const uint8_t *src_ptr, int source_stride,
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c index 5d00742..5f0edb1 100644 --- a/av1/encoder/rdopt.c +++ b/av1/encoder/rdopt.c
@@ -621,6 +621,7 @@ } } +#if CONFIG_AV1_HIGHBITDEPTH static void get_variance_stats_hbd(const MACROBLOCK *x, int64_t *src_var, int64_t *rec_var) { const MACROBLOCKD *xd = &x->e_mbd; @@ -637,9 +638,16 @@ *src_var = aom_highbd_calc_variance_stat(CONVERT_TO_SHORTPTR(p->src.buf), p->src.stride, bw, bh); } +#endif // CONFIG_AV1_HIGHBITDEPTH static void get_variance_stats(const MACROBLOCK *x, int64_t *src_var, int64_t *rec_var) { +#if CONFIG_AV1_HIGHBITDEPTH + if (is_cur_buf_hbd(&x->e_mbd)) { + get_variance_stats_hbd(x, src_var, rec_var); + return; + } +#endif // CONFIG_AV1_HIGHBITDEPTH const MACROBLOCKD *xd = &x->e_mbd; const MB_MODE_INFO *mbmi = xd->mi[0]; const struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y]; @@ -681,12 +689,7 @@ if (frame_is_kf_gf_arf(cpi)) return; int64_t src_var, rec_var; - - const bool is_hbd = is_cur_buf_hbd(&x->e_mbd); - if (is_hbd) - get_variance_stats_hbd(x, &src_var, &rec_var); - else - get_variance_stats(x, &src_var, &rec_var); + get_variance_stats(x, &src_var, &rec_var); if (src_var <= rec_var) return; @@ -711,12 +714,7 @@ if (frame_is_kf_gf_arf(cpi)) return; int64_t src_var, rec_var; - const bool is_hbd = is_cur_buf_hbd(&x->e_mbd); - - if (is_hbd) - get_variance_stats_hbd(x, &src_var, &rec_var); - else - get_variance_stats(x, &src_var, &rec_var); + get_variance_stats(x, &src_var, &rec_var); if (src_var <= rec_var) return;