blob: beff9886b4e6f06bb27df9206b319405931c6f55 [file] [log] [blame]
Neil Birkbecked25a612017-12-21 13:18:32 -08001/*
2 * Copyright (c) 2017, Alliance for Open Media. All rights reserved
3 *
4 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 * Media Patent License 1.0 was not distributed with this source code in the
9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10 */
11
12#ifndef AOM_DSP_NOISE_UTIL_H_
13#define AOM_DSP_NOISE_UTIL_H_
14
15#ifdef __cplusplus
16extern "C" {
17#endif // __cplusplus
18
19// Computes normalized cross correlation of two vectors a and b of length n.
20double aom_normalized_cross_correlation(const double *a, const double *b,
21 int n);
22
23// Synthesizes noise using the auto-regressive filter of the given lag,
24// with the provided n coefficients sampled at the given coords.
25void aom_noise_synth(int lag, int n, const int (*coords)[2],
26 const double *coeffs, double *data, int w, int h);
27
28// Validates the correlated noise in the data buffer of size (w, h).
29int aom_noise_data_validate(const double *data, int w, int h);
30
31#ifdef __cplusplus
32} // extern "C"
33#endif // __cplusplus
34
35#endif // AOM_DSP_NOISE_UTIL_H_