chromium/third_party/libaom/source/libaom/test/noise_model_test.cc

/*
 * Copyright (c) 2018, Alliance for Open Media. All rights reserved.
 *
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed with this source code in the LICENSE file, you can
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 */

#include <limits.h>
#include <math.h>
#include <algorithm>
#include <vector>

#include "aom_dsp/noise_model.h"
#include "aom_dsp/noise_util.h"
#include "config/aom_dsp_rtcd.h"
#include "gtest/gtest.h"
#include "test/acm_random.h"

namespace {

// Return normally distrbuted values with standard deviation of sigma.
double randn(libaom_test::ACMRandom *random, double sigma) {}

// Synthesizes noise using the auto-regressive filter of the given lag,
// with the provided n coefficients sampled at the given coords.
void noise_synth(libaom_test::ACMRandom *random, int lag, int n,
                 const int (*coords)[2], const double *coeffs, double *data,
                 int w, int h) {}

std::vector<float> get_noise_psd(double *noise, int width, int height,
                                 int block_size) {}

}  // namespace

TEST(NoiseStrengthSolver, GetCentersTwoBins) {}

TEST(NoiseStrengthSolver, GetCentersTwoBins10bit) {}

TEST(NoiseStrengthSolver, GetCenters256Bins) {}

// Tests that the noise strength solver returns the identity transform when
// given identity-like constraints.
TEST(NoiseStrengthSolver, ObserveIdentity) {}

TEST(NoiseStrengthSolver, SimplifiesCurve) {}

TEST(NoiseStrengthLut, LutInitNegativeOrZeroSize) {}

TEST(NoiseStrengthLut, LutEvalSinglePoint) {}

TEST(NoiseStrengthLut, LutEvalMultiPointInterp) {}

TEST(NoiseModel, InitSuccessWithValidSquareShape) {}

TEST(NoiseModel, InitSuccessWithValidDiamondShape) {}

TEST(NoiseModel, InitFailsWithTooLargeLag) {}

TEST(NoiseModel, InitFailsWithTooSmallLag) {}

TEST(NoiseModel, InitFailsWithInvalidShape) {}

TEST(NoiseModel, InitFailsWithInvalidBitdepth) {}

// A container template class to hold a data type and extra arguments.
// All of these args are bundled into one struct so that we can use
// parameterized tests on combinations of supported data types
// (uint8_t and uint16_t) and bit depths (8, 10, 12).
template <typename T, int bit_depth, bool use_highbd>
struct BitDepthParams {};

template <typename T>
class FlatBlockEstimatorTest : public ::testing::Test, public T {};

TYPED_TEST_SUITE_P();

TYPED_TEST_P(FlatBlockEstimatorTest, ExtractBlock) {}

TYPED_TEST_P(FlatBlockEstimatorTest, FindFlatBlocks) {}

REGISTER_TYPED_TEST_SUITE_P();

AllBitDepthParams;
// Note the empty final argument can be removed if C++20 is made the minimum
// requirement.
INSTANTIATE_TYPED_TEST_SUITE_P();

template <typename T>
class NoiseModelUpdateTest : public ::testing::Test, public T {};

TYPED_TEST_SUITE_P();

TYPED_TEST_P()

TYPED_TEST_P()

TYPED_TEST_P()

TYPED_TEST_P(NoiseModelUpdateTest, UpdateSuccessForWhiteRandomNoise) {}

TYPED_TEST_P(NoiseModelUpdateTest, UpdateSuccessForScaledWhiteNoise) {}

TYPED_TEST_P(NoiseModelUpdateTest, UpdateSuccessForCorrelatedNoise) {}

TYPED_TEST_P(NoiseModelUpdateTest,
             NoiseStrengthChangeSignalsDifferentNoiseType) {}

TYPED_TEST_P(NoiseModelUpdateTest, NoiseCoeffsSignalsDifferentNoiseType) {}
REGISTER_TYPED_TEST_SUITE_P();

// Note the empty final argument can be removed if C++20 is made the minimum
// requirement.
INSTANTIATE_TYPED_TEST_SUITE_P();

TEST(NoiseModelGetGrainParameters, TestLagSize) {}

TEST(NoiseModelGetGrainParameters, TestARCoeffShiftBounds) {}

TEST(NoiseModelGetGrainParameters, TestNoiseStrengthShiftBounds) {}

// The AR coefficients are the same inputs used to generate "Test 2" in the test
// vectors
TEST(NoiseModelGetGrainParameters, GetGrainParametersReal) {}

template <typename T>
class WienerDenoiseTest : public ::testing::Test, public T {};

TYPED_TEST_SUITE_P();

TYPED_TEST_P(WienerDenoiseTest, InvalidBlockSize) {}

TYPED_TEST_P(WienerDenoiseTest, InvalidChromaSubsampling) {}

TYPED_TEST_P(WienerDenoiseTest, GradientTest) {}

REGISTER_TYPED_TEST_SUITE_P();

// Note the empty final argument can be removed if C++20 is made the minimum
// requirement.
INSTANTIATE_TYPED_TEST_SUITE_P();