Commit c94d9ed9b9 for aom
commit c94d9ed9b9705394b31ba9ec98ad34086c8bd370
Author: James Zern <jzern@google.com>
Date: Tue Aug 18 11:23:48 2026 -0700
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
diff --git a/test/av1_txfm_test.cc b/test/av1_txfm_test.cc
index 5d633d32df..55d33a6fdd 100644
--- a/test/av1_txfm_test.cc
+++ b/test/av1_txfm_test.cc
@@ -342,6 +342,23 @@ void reference_hybrid_2d(double *in, double *out, TX_TYPE tx_type,
}
}
+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 e50dace791..8328f0dd30 100644
--- a/test/av1_txfm_test.h
+++ b/test/av1_txfm_test.h
@@ -57,15 +57,7 @@ double get_amplification_factor(TX_TYPE tx_type, TX_SIZE tx_size);
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);