Files
vpx/test/array_utils.h
Geza Lore f19700fe52 Add 1D version of vpx_sum_squares_i16
Change-Id: I0d7bda2fe6f995a9e88a9f66540b4979b3f7fab1
2016-06-03 09:34:55 +01:00

40 lines
1018 B
C++

/*
* Copyright (c) 2016 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef TEST_ARRAY_UTILS_H_
#define TEST_ARRAY_UTILS_H_
#include "third_party/googletest/src/include/gtest/gtest.h"
namespace libvpx_test {
namespace array_utils {
template<typename T, size_t n, typename V>
void arraySet(T (&arr)[n], const V &v) {
for (size_t i = 0; i < n ; i++) {
arr[i] = v;
}
}
template<typename T, size_t n, size_t m, typename V>
void arraySet(T (&arr)[n][m], const V &v) {
for (size_t i = 0; i < n ; i++) {
for (size_t j = 0; j < m ; j++) {
arr[i][j] = v;
}
}
}
} // namespace array_utils
} // namespace libvpx_test
#endif // TEST_ARRAY_UTILS_H_