Namespace compute_cross_correlation() functions BUG=aomedia:1540 Change-Id: Ia29f4ea1c7754a35f8d43d3aaaaeeedf1afb4bbd
diff --git a/av1/common/av1_rtcd_defs.pl b/av1/common/av1_rtcd_defs.pl index 14f67c8f..eda699b 100644 --- a/av1/common/av1_rtcd_defs.pl +++ b/av1/common/av1_rtcd_defs.pl
@@ -341,8 +341,8 @@ specialize qw/av1_highbd_warp_affine sse4_1/; if (aom_config("CONFIG_AV1_ENCODER") eq "yes") { - add_proto qw/double compute_cross_correlation/, "unsigned char *im1, int stride1, int x1, int y1, unsigned char *im2, int stride2, int x2, int y2"; - specialize qw/compute_cross_correlation sse4_1 avx2/; + add_proto qw/double av1_compute_cross_correlation/, "unsigned char *im1, int stride1, int x1, int y1, unsigned char *im2, int stride2, int x2, int y2"; + specialize qw/av1_compute_cross_correlation sse4_1 avx2/; } # LOOP_RESTORATION functions
diff --git a/av1/encoder/corner_match.c b/av1/encoder/corner_match.c index 29e934d..3a631fb 100644 --- a/av1/encoder/corner_match.c +++ b/av1/encoder/corner_match.c
@@ -44,9 +44,9 @@ correlation/standard deviation are taken over MATCH_SZ by MATCH_SZ windows of each image, centered at (x1, y1) and (x2, y2) respectively. */ -double compute_cross_correlation_c(unsigned char *im1, int stride1, int x1, - int y1, unsigned char *im2, int stride2, - int x2, int y2) { +double av1_compute_cross_correlation_c(unsigned char *im1, int stride1, int x1, + int y1, unsigned char *im2, int stride2, + int x2, int y2) { int v1, v2; int sum1 = 0; int sum2 = 0; @@ -99,7 +99,7 @@ correspondences[i].rx + x, correspondences[i].ry + y, width, height)) continue; - match_ncc = compute_cross_correlation( + match_ncc = av1_compute_cross_correlation( frm, frm_stride, correspondences[i].x, correspondences[i].y, ref, ref_stride, correspondences[i].rx + x, correspondences[i].ry + y); if (match_ncc > best_match_ncc) { @@ -125,7 +125,7 @@ correspondences[i].x + x, correspondences[i].y + y, correspondences[i].rx, correspondences[i].ry, width, height)) continue; - match_ncc = compute_cross_correlation( + match_ncc = av1_compute_cross_correlation( ref, ref_stride, correspondences[i].rx, correspondences[i].ry, frm, frm_stride, correspondences[i].x + x, correspondences[i].y + y); if (match_ncc > best_match_ncc) { @@ -164,7 +164,7 @@ ref_corners[2 * j], ref_corners[2 * j + 1], width, height)) continue; - match_ncc = compute_cross_correlation( + match_ncc = av1_compute_cross_correlation( frm, frm_stride, frm_corners[2 * i], frm_corners[2 * i + 1], ref, ref_stride, ref_corners[2 * j], ref_corners[2 * j + 1]); if (match_ncc > best_match_ncc) { @@ -173,7 +173,8 @@ } } // Note: We want to test if the best correlation is >= THRESHOLD_NCC, - // but need to account for the normalization in compute_cross_correlation. + // but need to account for the normalization in + // av1_compute_cross_correlation. template_norm = compute_variance(frm, frm_stride, frm_corners[2 * i], frm_corners[2 * i + 1]); if (best_match_ncc > THRESHOLD_NCC * sqrt(template_norm)) {
diff --git a/av1/encoder/x86/corner_match_avx2.c b/av1/encoder/x86/corner_match_avx2.c index 554122b..033ae37 100644 --- a/av1/encoder/x86/corner_match_avx2.c +++ b/av1/encoder/x86/corner_match_avx2.c
@@ -28,9 +28,9 @@ correlation/standard deviation are taken over MATCH_SZ by MATCH_SZ windows of each image, centered at (x1, y1) and (x2, y2) respectively. */ -double compute_cross_correlation_avx2(unsigned char *im1, int stride1, int x1, - int y1, unsigned char *im2, int stride2, - int x2, int y2) { +double av1_compute_cross_correlation_avx2(unsigned char *im1, int stride1, + int x1, int y1, unsigned char *im2, + int stride2, int x2, int y2) { int i, stride1_i = 0, stride2_i = 0; __m256i temp1, sum_vec, sumsq2_vec, cross_vec, v, v1_1, v2_1; const __m128i mask = _mm_load_si128((__m128i *)byte_mask);
diff --git a/av1/encoder/x86/corner_match_sse4.c b/av1/encoder/x86/corner_match_sse4.c index 1b5f470..1a879da 100644 --- a/av1/encoder/x86/corner_match_sse4.c +++ b/av1/encoder/x86/corner_match_sse4.c
@@ -32,9 +32,9 @@ correlation/standard deviation are taken over MATCH_SZ by MATCH_SZ windows of each image, centered at (x1, y1) and (x2, y2) respectively. */ -double compute_cross_correlation_sse4_1(unsigned char *im1, int stride1, int x1, - int y1, unsigned char *im2, int stride2, - int x2, int y2) { +double av1_compute_cross_correlation_sse4_1(unsigned char *im1, int stride1, + int x1, int y1, unsigned char *im2, + int stride2, int x2, int y2) { int i; // 2 16-bit partial sums in lanes 0, 4 (== 2 32-bit partial sums in lanes 0, // 2)
diff --git a/test/corner_match_test.cc b/test/corner_match_test.cc index 0f79b52..584cea3 100644 --- a/test/corner_match_test.cc +++ b/test/corner_match_test.cc
@@ -88,13 +88,13 @@ int y2 = MATCH_SZ_BY2 + rnd_.PseudoUniform(h - 2 * MATCH_SZ_BY2); double res_c = - compute_cross_correlation_c(input1, w, x1, y1, input2, w, x2, y2); + av1_compute_cross_correlation_c(input1, w, x1, y1, input2, w, x2, y2); double res_simd = target_func(input1, w, x1, y1, input2, w, x2, y2); if (run_times > 1) { aom_usec_timer_start(&ref_timer); for (j = 0; j < run_times; j++) { - compute_cross_correlation_c(input1, w, x1, y1, input2, w, x2, y2); + av1_compute_cross_correlation_c(input1, w, x1, y1, input2, w, x2, y2); } aom_usec_timer_mark(&ref_timer); const int elapsed_time_c = @@ -127,15 +127,15 @@ #if HAVE_SSE4_1 INSTANTIATE_TEST_CASE_P( SSE4_1, AV1CornerMatchTest, - ::testing::Values(make_tuple(0, &compute_cross_correlation_sse4_1), - make_tuple(1, &compute_cross_correlation_sse4_1))); + ::testing::Values(make_tuple(0, &av1_compute_cross_correlation_sse4_1), + make_tuple(1, &av1_compute_cross_correlation_sse4_1))); #endif #if HAVE_AVX2 INSTANTIATE_TEST_CASE_P( AVX2, AV1CornerMatchTest, - ::testing::Values(make_tuple(0, &compute_cross_correlation_avx2), - make_tuple(1, &compute_cross_correlation_avx2))); + ::testing::Values(make_tuple(0, &av1_compute_cross_correlation_avx2), + make_tuple(1, &av1_compute_cross_correlation_avx2))); #endif } // namespace AV1CornerMatch