From cc5bdf4920801f644c34609e949b3f03f4bf3cc8 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Mon, 19 Dec 2016 11:14:30 -0800 Subject: [PATCH] Add 2x2 block level variance functions for high bd Change-Id: I38259c4074f77a8941baefbe7585fff2eded6b12 --- aom_dsp/aom_dsp_rtcd_defs.pl | 6 ++++++ aom_dsp/variance.c | 3 +++ av1/encoder/encoder.c | 27 +++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/aom_dsp/aom_dsp_rtcd_defs.pl b/aom_dsp/aom_dsp_rtcd_defs.pl index dfd8c1c1e..de150e678 100644 --- a/aom_dsp/aom_dsp_rtcd_defs.pl +++ b/aom_dsp/aom_dsp_rtcd_defs.pl @@ -1697,6 +1697,12 @@ specialize qw/aom_sub_pixel_avg_variance4x8 msa sse2 ssse3/; specialize qw/aom_sub_pixel_avg_variance4x4 msa sse2 ssse3/; if (aom_config("CONFIG_AOM_HIGHBITDEPTH") eq "yes") { foreach $bd (8, 10, 12) { + add_proto qw/unsigned int/, "aom_highbd_${bd}_variance2x2", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; + + add_proto qw/unsigned int/, "aom_highbd_${bd}_variance2x4", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; + + add_proto qw/unsigned int/, "aom_highbd_${bd}_variance4x2", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; + foreach (@block_sizes) { ($w, $h) = @$_; add_proto qw/unsigned int/, "aom_highbd_${bd}_variance${w}x${h}", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; diff --git a/aom_dsp/variance.c b/aom_dsp/variance.c index 89f841624..7d7517c9b 100644 --- a/aom_dsp/variance.c +++ b/aom_dsp/variance.c @@ -590,6 +590,9 @@ HIGHBD_VARIANCES(8, 8) HIGHBD_VARIANCES(8, 4) HIGHBD_VARIANCES(4, 8) HIGHBD_VARIANCES(4, 4) +HIGHBD_VARIANCES(4, 2) +HIGHBD_VARIANCES(2, 4) +HIGHBD_VARIANCES(2, 2) HIGHBD_GET_VAR(8) HIGHBD_GET_VAR(16) diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c index a882a0b46..564b409ce 100644 --- a/av1/encoder/encoder.c +++ b/av1/encoder/encoder.c @@ -1291,6 +1291,15 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) { aom_highbd_8_sub_pixel_avg_variance4x4, aom_highbd_sad4x4x3_bits8, aom_highbd_sad4x4x8_bits8, aom_highbd_sad4x4x4d_bits8) +#if CONFIG_CB4X4 + HIGHBD_BFP(BLOCK_2X2, NULL, NULL, aom_highbd_8_variance2x2, NULL, NULL, + NULL, NULL, NULL) + HIGHBD_BFP(BLOCK_4X2, NULL, NULL, aom_highbd_8_variance4x2, NULL, NULL, + NULL, NULL, NULL) + HIGHBD_BFP(BLOCK_2X4, NULL, NULL, aom_highbd_8_variance2x4, NULL, NULL, + NULL, NULL, NULL) +#endif + #if CONFIG_EXT_PARTITION HIGHBD_BFP(BLOCK_128X128, aom_highbd_sad128x128_bits8, aom_highbd_sad128x128_avg_bits8, @@ -1503,6 +1512,15 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) { aom_highbd_10_sub_pixel_avg_variance4x4, aom_highbd_sad4x4x3_bits10, aom_highbd_sad4x4x8_bits10, aom_highbd_sad4x4x4d_bits10) +#if CONFIG_CB4X4 + HIGHBD_BFP(BLOCK_2X2, NULL, NULL, aom_highbd_10_variance2x2, NULL, NULL, + NULL, NULL, NULL) + HIGHBD_BFP(BLOCK_4X2, NULL, NULL, aom_highbd_10_variance4x2, NULL, NULL, + NULL, NULL, NULL) + HIGHBD_BFP(BLOCK_2X4, NULL, NULL, aom_highbd_10_variance2x4, NULL, NULL, + NULL, NULL, NULL) +#endif + #if CONFIG_EXT_PARTITION HIGHBD_BFP( BLOCK_128X128, aom_highbd_sad128x128_bits10, @@ -1717,6 +1735,15 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) { aom_highbd_12_sub_pixel_avg_variance4x4, aom_highbd_sad4x4x3_bits12, aom_highbd_sad4x4x8_bits12, aom_highbd_sad4x4x4d_bits12) +#if CONFIG_CB4X4 + HIGHBD_BFP(BLOCK_2X2, NULL, NULL, aom_highbd_12_variance2x2, NULL, NULL, + NULL, NULL, NULL) + HIGHBD_BFP(BLOCK_4X2, NULL, NULL, aom_highbd_12_variance4x2, NULL, NULL, + NULL, NULL, NULL) + HIGHBD_BFP(BLOCK_2X4, NULL, NULL, aom_highbd_12_variance2x4, NULL, NULL, + NULL, NULL, NULL) +#endif + #if CONFIG_EXT_PARTITION HIGHBD_BFP( BLOCK_128X128, aom_highbd_sad128x128_bits12,