av1_txfm_test.h: move template function to .cc Quiets a `-Wunused-template` warning. This matches the other templates in the header: `fliplr`, `flipud`, `fliplrud`. Change-Id: I24d65c90730bd44b22bc7e96900b497bb560adbb (cherry picked from commit c94d9ed9b9705394b31ba9ec98ad34086c8bd370)
diff --git a/test/av1_txfm_test.cc b/test/av1_txfm_test.cc index 5d633d3..55d33a6 100644 --- a/test/av1_txfm_test.cc +++ b/test/av1_txfm_test.cc
@@ -342,6 +342,23 @@ } } +template <typename Type1, typename Type2> +double compute_avg_abs_error(const Type1 *a, const Type2 *b, const int size) { + double error = 0; + for (int i = 0; i < size; i++) { + error += fabs(static_cast<double>(a[i]) - static_cast<double>(b[i])); + } + error = error / size; + return error; +} + +template double compute_avg_abs_error<int32_t, double>(const int32_t *a, + const double *b, + const int size); +template double compute_avg_abs_error<uint16_t, uint16_t>(const uint16_t *a, + const uint16_t *b, + const int size); + template <typename Type> void fliplr(Type *dest, int width, int height, int stride) { for (int r = 0; r < height; ++r) {
diff --git a/test/av1_txfm_test.h b/test/av1_txfm_test.h index e50dace..8328f0d 100644 --- a/test/av1_txfm_test.h +++ b/test/av1_txfm_test.h
@@ -57,15 +57,7 @@ void reference_hybrid_2d(double *in, double *out, TX_TYPE tx_type, TX_SIZE tx_size); template <typename Type1, typename Type2> -static double compute_avg_abs_error(const Type1 *a, const Type2 *b, - const int size) { - double error = 0; - for (int i = 0; i < size; i++) { - error += fabs(static_cast<double>(a[i]) - static_cast<double>(b[i])); - } - error = error / size; - return error; -} +double compute_avg_abs_error(const Type1 *a, const Type2 *b, const int size); template <typename Type> void fliplr(Type *dest, int width, int height, int stride);