chromium/third_party/libvpx/source/libvpx/test/codec_factory.h

/*
 *  Copyright (c) 2013 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 VPX_TEST_CODEC_FACTORY_H_
#define VPX_TEST_CODEC_FACTORY_H_

#include <tuple>

#include "./vpx_config.h"
#include "vpx/vpx_decoder.h"
#include "vpx/vpx_encoder.h"
#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER
#include "vpx/vp8cx.h"
#endif
#if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER
#include "vpx/vp8dx.h"
#endif

#include "test/decode_test_driver.h"
#include "test/encode_test_driver.h"
namespace libvpx_test {

const int kCodecFactoryParam =;

class CodecFactory {};

/* Provide CodecTestWith<n>Params classes for a variable number of parameters
 * to avoid having to include a pointer to the CodecFactory in every test
 * definition.
 */
template <class T1>
class CodecTestWithParam
    : public ::testing::TestWithParam<
          std::tuple<const libvpx_test::CodecFactory *, T1> > {};

template <class T1, class T2>
class CodecTestWith2Params
    : public ::testing::TestWithParam<
          std::tuple<const libvpx_test::CodecFactory *, T1, T2> > {};

template <class T1, class T2, class T3>
class CodecTestWith3Params
    : public ::testing::TestWithParam<
          std::tuple<const libvpx_test::CodecFactory *, T1, T2, T3> > {};

template <class T1, class T2, class T3, class T4>
class CodecTestWith4Params
    : public ::testing::TestWithParam<
          std::tuple<const libvpx_test::CodecFactory *, T1, T2, T3, T4> > {};

/*
 * VP8 Codec Definitions
 */
#if CONFIG_VP8
class VP8Decoder : public Decoder {};

class VP8Encoder : public Encoder {};

class VP8CodecFactory : public CodecFactory {};

const libvpx_test::VP8CodecFactory kVP8;

#define VP8_INSTANTIATE_TEST_SUITE(test, ...)
#else
// static_assert() is used to avoid warnings about an extra ';' outside of a
// function.
#define VP8_INSTANTIATE_TEST_SUITE
#endif  // CONFIG_VP8

/*
 * VP9 Codec Definitions
 */
#if CONFIG_VP9
class VP9Decoder : public Decoder {};

class VP9Encoder : public Encoder {};

class VP9CodecFactory : public CodecFactory {};

const libvpx_test::VP9CodecFactory kVP9;

#define VP9_INSTANTIATE_TEST_SUITE(test, ...)
#else
// static_assert() is used to avoid warnings about an extra ';' outside of a
// function.
#define VP9_INSTANTIATE_TEST_SUITE
#endif  // CONFIG_VP9

}  // namespace libvpx_test
#endif  // VPX_TEST_CODEC_FACTORY_H_