chromium/third_party/libvpx/source/libvpx/test/vp9_datarate_test.cc

/*
 *  Copyright (c) 2012 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.
 */
#include "./vpx_config.h"
#include "gtest/gtest.h"
#include "test/acm_random.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
#include "test/util.h"
#include "test/y4m_video_source.h"
#include "vpx/vpx_codec.h"
#include "vpx_ports/bitops.h"

namespace {

class DatarateTestVP9 : public ::libvpx_test::EncoderTest {};

// Params: test mode, speed setting and index for bitrate array.
class DatarateTestVP9RealTimeMultiBR
    : public DatarateTestVP9,
      public ::libvpx_test::CodecTestWith2Params<int, int> {};

// Params: speed setting and index for bitrate array.
class DatarateTestVP9LargeVBR
    : public DatarateTestVP9,
      public ::libvpx_test::CodecTestWith2Params<int, int> {};

// Check basic rate targeting for VBR mode with 0 lag.
TEST_P(DatarateTestVP9LargeVBR, BasicRateTargetingVBRLagZero) {}

// Check basic rate targeting for VBR mode with non-zero lag.
TEST_P(DatarateTestVP9LargeVBR, BasicRateTargetingVBRLagNonZero) {}

// Check basic rate targeting for VBR mode with non-zero lag, with
// frame_parallel_decoding_mode off. This enables the adapt_coeff/mode/mv probs
// since error_resilience is off.
TEST_P(DatarateTestVP9LargeVBR, BasicRateTargetingVBRLagNonZeroFrameParDecOff) {}

// Check basic rate targeting for CBR mode.
TEST_P(DatarateTestVP9RealTimeMultiBR, BasicRateTargeting) {}

// Check basic rate targeting for CBR mode, with frame_parallel_decoding_mode
// off( and error_resilience off).
TEST_P(DatarateTestVP9RealTimeMultiBR, BasicRateTargetingFrameParDecOff) {}

// Check basic rate targeting for CBR.
TEST_P(DatarateTestVP9RealTimeMultiBR, BasicRateTargeting444) {}

// Check that (1) the first dropped frame gets earlier and earlier
// as the drop frame threshold is increased, and (2) that the total number of
// frame drops does not decrease as we increase frame drop threshold.
// Use a lower qp-max to force some frame drops.
TEST_P(DatarateTestVP9RealTimeMultiBR, ChangingDropFrameThresh) {}  // namespace

// Check basic rate targeting for 2 temporal layers.
TEST_P(DatarateTestVP9RealTimeMultiBR, BasicRateTargeting2TemporalLayers) {}

// Check basic rate targeting for 3 temporal layers.
TEST_P(DatarateTestVP9RealTimeMultiBR, BasicRateTargeting3TemporalLayers) {}

// Params: speed setting.
class DatarateTestVP9RealTime : public DatarateTestVP9,
                                public ::libvpx_test::CodecTestWithParam<int> {};

// Check basic rate targeting for CBR mode, with 2 threads and dropped frames.
TEST_P(DatarateTestVP9RealTime, BasicRateTargetingDropFramesMultiThreads) {}

// Check basic rate targeting for 3 temporal layers, with frame dropping.
// Only for one (low) bitrate with lower max_quantizer, and somewhat higher
// frame drop threshold, to force frame dropping.
TEST_P(DatarateTestVP9RealTime,
       BasicRateTargeting3TemporalLayersFrameDropping) {}

// Check VP9 region of interest feature.
TEST_P(DatarateTestVP9RealTime, RegionOfInterest) {}

// Params: speed setting, delta q UV.
class DatarateTestVP9RealTimeDeltaQUV
    : public DatarateTestVP9,
      public ::libvpx_test::CodecTestWith2Params<int, int> {};

TEST_P(DatarateTestVP9RealTimeDeltaQUV, DeltaQUV) {}

// Params: test mode, speed setting and index for bitrate array.
class DatarateTestVP9PostEncodeDrop
    : public DatarateTestVP9,
      public ::libvpx_test::CodecTestWithParam<int> {};

// Check basic rate targeting for CBR mode, with 2 threads and dropped frames.
TEST_P(DatarateTestVP9PostEncodeDrop, PostEncodeDropScreenContent) {}

ACMRandom;

class DatarateTestVP9FrameQp
    : public DatarateTestVP9,
      public ::testing::TestWithParam<const libvpx_test::CodecFactory *> {};

TEST_P(DatarateTestVP9FrameQp, VP9SetFrameQp) {}

TEST_P(DatarateTestVP9FrameQp, VP9SetFrameQp3TemporalLayersBypass) {}

TEST_P(DatarateTestVP9FrameQp, VP9SetFrameQp3TemporalLayersFixedMode) {}

#if CONFIG_VP9_TEMPORAL_DENOISING
// Params: speed setting.
class DatarateTestVP9RealTimeDenoiser : public DatarateTestVP9RealTime {};

// Check basic datarate targeting, for a single bitrate, when denoiser is on.
TEST_P(DatarateTestVP9RealTimeDenoiser, LowNoise) {}

// Check basic datarate targeting, for a single bitrate, when denoiser is on,
// for clip with high noise level. Use 2 threads.
TEST_P(DatarateTestVP9RealTimeDenoiser, HighNoise) {}

// Check basic datarate targeting, for a single bitrate, when denoiser is on,
// for 1280x720 clip with 4 threads.
TEST_P(DatarateTestVP9RealTimeDenoiser, 4threads) {}

// Check basic datarate targeting, for a single bitrate, when denoiser is off
// and on.
TEST_P(DatarateTestVP9RealTimeDenoiser, DenoiserOffOn) {}
#endif  // CONFIG_VP9_TEMPORAL_DENOISING

VP9_INSTANTIATE_TEST_SUITE();

VP9_INSTANTIATE_TEST_SUITE();

VP9_INSTANTIATE_TEST_SUITE();

#if CONFIG_VP9
INSTANTIATE_TEST_SUITE_P();
#endif

VP9_INSTANTIATE_TEST_SUITE();

VP9_INSTANTIATE_TEST_SUITE();

#if CONFIG_VP9_TEMPORAL_DENOISING
VP9_INSTANTIATE_TEST_SUITE();
#endif
}  // namespace