From e2ffaf884de292c0713ee8f7cab18ec5034001c1 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Wed, 14 Dec 2016 15:26:30 -0800 Subject: [PATCH] Add 2x4 and 4x2 variance functions Change-Id: Ic2fbc66e9212da32930c6a8ba1a749e3a37c5b9a --- aom_dsp/aom_dsp_rtcd_defs.pl | 6 ++++++ aom_dsp/variance.c | 2 ++ av1/encoder/encoder.c | 2 ++ 3 files changed, 10 insertions(+) diff --git a/aom_dsp/aom_dsp_rtcd_defs.pl b/aom_dsp/aom_dsp_rtcd_defs.pl index fd599627c..1faf9fc45 100644 --- a/aom_dsp/aom_dsp_rtcd_defs.pl +++ b/aom_dsp/aom_dsp_rtcd_defs.pl @@ -1592,6 +1592,12 @@ specialize qw/aom_get4x4sse_cs neon msa/; add_proto qw/unsigned int/, "aom_variance2x2", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/aom_variance2x2/; + add_proto qw/unsigned int/, "aom_variance2x4", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; + specialize qw/aom_variance2x4/; + + add_proto qw/unsigned int/, "aom_variance4x2", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; + specialize qw/aom_variance4x2/; + foreach (@block_sizes) { ($w, $h) = @$_; add_proto qw/unsigned int/, "aom_variance${w}x${h}", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; diff --git a/aom_dsp/variance.c b/aom_dsp/variance.c index b9b674178..89f841624 100644 --- a/aom_dsp/variance.c +++ b/aom_dsp/variance.c @@ -233,6 +233,8 @@ VARIANCES(8, 8) VARIANCES(8, 4) VARIANCES(4, 8) VARIANCES(4, 4) +VARIANCES(4, 2) +VARIANCES(2, 4) VARIANCES(2, 2) GET_VAR(16, 16) diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c index 621f1f5c7..319ad3805 100644 --- a/av1/encoder/encoder.c +++ b/av1/encoder/encoder.c @@ -2298,6 +2298,8 @@ AV1_COMP *av1_create_compressor(AV1EncoderConfig *oxcf, #if CONFIG_CB4X4 BFP(BLOCK_2X2, NULL, NULL, aom_variance2x2, NULL, NULL, NULL, NULL, NULL) + BFP(BLOCK_2X4, NULL, NULL, aom_variance2x4, NULL, NULL, NULL, NULL, NULL) + BFP(BLOCK_4X2, NULL, NULL, aom_variance4x2, NULL, NULL, NULL, NULL, NULL) #endif #if CONFIG_MOTION_VAR