From 8ae92aef662e94bfbdb01d940a61f1b55c67ff42 Mon Sep 17 00:00:00 2001 From: Tero Rintaluoma Date: Wed, 23 Feb 2011 13:27:27 +0200 Subject: [PATCH] ARMv6 optimized half pixel variance calculations Adds following ARMv6 optimized functions to the encoder: - vp8_variance_halfpixvar16x16_h_armv6 - vp8_variance_halfpixvar16x16_v_armv6 - vp8_variance_halfpixvar16x16_hv_armv6 Change-Id: I1e9c2af7acd2a51b72b3845beecd990db4bebd29 --- vp8/encoder/arm/arm_csystemdependent.c | 3 +++ vp8/encoder/arm/variance_arm.c | 36 +++++++++++++++++++++++++- vp8/encoder/arm/variance_arm.h | 13 ++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/vp8/encoder/arm/arm_csystemdependent.c b/vp8/encoder/arm/arm_csystemdependent.c index 5852afddb..73007d414 100644 --- a/vp8/encoder/arm/arm_csystemdependent.c +++ b/vp8/encoder/arm/arm_csystemdependent.c @@ -46,6 +46,9 @@ void vp8_arch_arm_encoder_init(VP8_COMP *cpi) cpi->rtcd.variance.subpixvar8x16 = vp8_sub_pixel_variance8x16_c; cpi->rtcd.variance.subpixvar16x8 = vp8_sub_pixel_variance16x8_c;*/ cpi->rtcd.variance.subpixvar16x16 = vp8_sub_pixel_variance16x16_armv6; + cpi->rtcd.variance.halfpixvar16x16_h = vp8_variance_halfpixvar16x16_h_armv6; + cpi->rtcd.variance.halfpixvar16x16_v = vp8_variance_halfpixvar16x16_v_armv6; + cpi->rtcd.variance.halfpixvar16x16_hv = vp8_variance_halfpixvar16x16_hv_armv6; /*cpi->rtcd.variance.mse16x16 = vp8_mse16x16_c; cpi->rtcd.variance.getmbss = vp8_get_mb_ss_c;*/ diff --git a/vp8/encoder/arm/variance_arm.c b/vp8/encoder/arm/variance_arm.c index 1cf9fd8f0..64d76bcf8 100644 --- a/vp8/encoder/arm/variance_arm.c +++ b/vp8/encoder/arm/variance_arm.c @@ -43,7 +43,41 @@ unsigned int vp8_sub_pixel_variance16x16_armv6 dst_pixels_per_line, sse); } -#endif +unsigned int vp8_variance_halfpixvar16x16_h_armv6( + const unsigned char *src_ptr, + int source_stride, + const unsigned char *ref_ptr, + int recon_stride, + unsigned int *sse) +{ + return vp8_sub_pixel_variance16x16_armv6(src_ptr, source_stride, 4, 0, + ref_ptr, recon_stride, sse); +} + +unsigned int vp8_variance_halfpixvar16x16_v_armv6( + const unsigned char *src_ptr, + int source_stride, + const unsigned char *ref_ptr, + int recon_stride, + unsigned int *sse) +{ + return vp8_sub_pixel_variance16x16_armv6(src_ptr, source_stride, 0, 4, + ref_ptr, recon_stride, sse); +} + +unsigned int vp8_variance_halfpixvar16x16_hv_armv6( + const unsigned char *src_ptr, + int source_stride, + const unsigned char *ref_ptr, + int recon_stride, + unsigned int *sse) +{ + return vp8_sub_pixel_variance16x16_armv6(src_ptr, source_stride, 4, 4, + ref_ptr, recon_stride, sse); +} + +#endif /* HAVE_ARMV6 */ + #if HAVE_ARMV7 diff --git a/vp8/encoder/arm/variance_arm.h b/vp8/encoder/arm/variance_arm.h index c807e29c0..7ac0ac08e 100644 --- a/vp8/encoder/arm/variance_arm.h +++ b/vp8/encoder/arm/variance_arm.h @@ -17,6 +17,9 @@ extern prototype_sad(vp8_sad16x16_armv6); extern prototype_variance(vp8_variance16x16_armv6); extern prototype_subpixvariance(vp8_sub_pixel_variance16x16_armv6); +extern prototype_variance(vp8_variance_halfpixvar16x16_h_armv6); +extern prototype_variance(vp8_variance_halfpixvar16x16_v_armv6); +extern prototype_variance(vp8_variance_halfpixvar16x16_hv_armv6); #if !CONFIG_RUNTIME_CPU_DETECT @@ -29,10 +32,20 @@ extern prototype_subpixvariance(vp8_sub_pixel_variance16x16_armv6); #undef vp8_variance_var16x16 #define vp8_variance_var16x16 vp8_variance16x16_armv6 +#undef vp8_variance_halfpixvar16x16_h +#define vp8_variance_halfpixvar16x16_h vp8_variance_halfpixvar16x16_h_armv6 + +#undef vp8_variance_halfpixvar16x16_v +#define vp8_variance_halfpixvar16x16_v vp8_variance_halfpixvar16x16_v_armv6 + +#undef vp8_variance_halfpixvar16x16_hv +#define vp8_variance_halfpixvar16x16_hv vp8_variance_halfpixvar16x16_hv_armv6 + #endif /* !CONFIG_RUNTIME_CPU_DETECT */ #endif /* HAVE_ARMV6 */ + #if HAVE_ARMV7 extern prototype_sad(vp8_sad4x4_neon); extern prototype_sad(vp8_sad8x8_neon);