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

/*
 * Copyright (c) 2016, 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 "config/aom_config.h"

#include "gtest/gtest.h"
#include "test/acm_random.h"
#include "test/codec_factory.h"
#include "test/datarate_test.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
#include "test/util.h"
#include "test/y4m_video_source.h"
#include "aom/aom_codec.h"

namespace datarate_test {
namespace {

// Params: test mode, speed, aq mode and index for bitrate array.
class DatarateTestLarge
    : public ::libaom_test::CodecTestWith4Params<libaom_test::TestMode, int,
                                                 unsigned int, int>,
      public DatarateTest {};

// Params: test mode, speed, aq mode.
class DatarateTestFrameDropLarge
    : public ::libaom_test::CodecTestWith3Params<libaom_test::TestMode, int,
                                                 unsigned int>,
      public DatarateTest {};

// Check basic rate targeting for VBR mode.
TEST_P(DatarateTestLarge, BasicRateTargetingVBR) {}

// Check basic rate targeting for CBR.
TEST_P(DatarateTestLarge, BasicRateTargetingCBR) {}

// Check basic rate targeting for CBR, with 4 threads
TEST_P(DatarateTestLarge, BasicRateTargetingMultiThreadCBR) {}

// Check basic rate targeting for periodic key frame.
TEST_P(DatarateTestLarge, PeriodicKeyFrameCBR) {}

// Check basic rate targeting for periodic key frame, aligned with scene change.
TEST_P(DatarateTestLarge, PeriodicKeyFrameCBROnSceneCuts) {}

// Check basic rate targeting with error resilience on for scene cuts.
TEST_P(DatarateTestLarge, ErrorResilienceOnSceneCuts) {}

// Check basic rate targeting for CBR, for 444 input screen mode.
#if defined(CONFIG_MAX_DECODE_PROFILE) && CONFIG_MAX_DECODE_PROFILE < 1
TEST_P(DatarateTestLarge, DISABLED_BasicRateTargeting444CBRScreen) {
#else
TEST_P(DatarateTestLarge, BasicRateTargeting444CBRScreen) {}

// Check basic rate targeting for Superres mode with CBR.
TEST_P(DatarateTestLarge, BasicRateTargetingSuperresCBR) {}

// Check basic rate targeting for Superres mode with CBR and multi-threads.
TEST_P(DatarateTestLarge, BasicRateTargetingSuperresCBRMultiThreads) {}

// 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(DatarateTestFrameDropLarge, ChangingDropFrameThresh) {}

TEST_P(DatarateTestLarge, BasicRateTargetingAQModeOnOffCBR) {}

class DatarateTestRealtime : public DatarateTestLarge {};

class DatarateTestFrameDropRealtime : public DatarateTestFrameDropLarge {};

// Params: aq mode.
class DatarateTestSpeedChangeRealtime
    : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode,
                                                 unsigned int>,
      public DatarateTest {};

// Check basic rate targeting for VBR mode.
TEST_P(DatarateTestRealtime, BasicRateTargetingVBR) {}

// Check basic rate targeting for CBR.
TEST_P(DatarateTestRealtime, BasicRateTargetingCBR) {}

// Check basic rate targeting for CBR. Use a longer clip,
// and verify #encode size spikes above threshold.
TEST_P(DatarateTestRealtime, BasicRateTargetingCBRSpike) {}

// Check basic rate targeting for CBR. Use a longer clip,
// and verify encoder can respnd and hit new bitrates updated
// within the stream.
TEST_P(DatarateTestRealtime, BasicRateTargetingCBRDynamicBitrate) {}

// Check basic rate targeting for CBR, with 4 threads
TEST_P(DatarateTestRealtime, BasicRateTargetingMultiThreadCBR) {}

// Check basic rate targeting for periodic key frame.
TEST_P(DatarateTestRealtime, PeriodicKeyFrameCBR) {}

// Check basic rate targeting for periodic key frame, aligned with scene change.
TEST_P(DatarateTestRealtime, PeriodicKeyFrameCBROnSceneCuts) {}

// Check basic rate targeting with error resilience on for scene cuts.
TEST_P(DatarateTestRealtime, ErrorResilienceOnSceneCuts) {}

// Check basic rate targeting for CBR for 444 screen mode.
#if defined(CONFIG_MAX_DECODE_PROFILE) && CONFIG_MAX_DECODE_PROFILE < 1
TEST_P(DatarateTestRealtime, DISABLED_BasicRateTargeting444CBRScreen) {
#else
TEST_P(DatarateTestRealtime, BasicRateTargeting444CBRScreen) {}

// Check basic rate targeting for Superres mode with CBR.
TEST_P(DatarateTestRealtime, BasicRateTargetingSuperresCBR) {}

// Check basic rate targeting for Superres mode with CBR and multi-threads.
TEST_P(DatarateTestRealtime, BasicRateTargetingSuperresCBRMultiThreads) {}

// 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(DatarateTestFrameDropRealtime, ChangingDropFrameThresh) {}

TEST_P(DatarateTestSpeedChangeRealtime, ChangingSpeedTest) {}

class DatarateTestSetFrameQpRealtime
    : public DatarateTest,
      public ::testing::TestWithParam<const libaom_test::AV1CodecFactory *> {};

TEST_P(DatarateTestSetFrameQpRealtime, SetFrameQpOnePass) {}

AV1_INSTANTIATE_TEST_SUITE();

AV1_INSTANTIATE_TEST_SUITE();

AV1_INSTANTIATE_TEST_SUITE();

AV1_INSTANTIATE_TEST_SUITE();

AV1_INSTANTIATE_TEST_SUITE();

INSTANTIATE_TEST_SUITE_P();

}  // namespace
}  // namespace datarate_test