OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 #ifndef TEST_CODEC_FACTORY_H_ | 10 #ifndef TEST_CODEC_FACTORY_H_ |
11 #define TEST_CODEC_FACTORY_H_ | 11 #define TEST_CODEC_FACTORY_H_ |
12 | 12 |
13 #include "./vpx_config.h" | 13 #include "./vpx_config.h" |
14 #include "vpx/vpx_decoder.h" | 14 #include "vpx/vpx_decoder.h" |
15 #include "vpx/vpx_encoder.h" | 15 #include "vpx/vpx_encoder.h" |
16 #if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER | 16 #if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER |
17 #include "vpx/vp8cx.h" | 17 #include "vpx/vp8cx.h" |
18 #endif | 18 #endif |
19 #if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER | 19 #if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER |
20 #include "vpx/vp8dx.h" | 20 #include "vpx/vp8dx.h" |
21 #endif | 21 #endif |
22 | 22 |
23 #include "test/decode_test_driver.h" | 23 #include "test/decode_test_driver.h" |
24 #include "test/encode_test_driver.h" | 24 #include "test/encode_test_driver.h" |
25 namespace libvpx_test { | 25 namespace libvpx_test { |
26 | 26 |
| 27 const int kCodecFactoryParam = 0; |
| 28 |
27 class CodecFactory { | 29 class CodecFactory { |
28 public: | 30 public: |
29 CodecFactory() {} | 31 CodecFactory() {} |
30 | 32 |
31 virtual ~CodecFactory() {} | 33 virtual ~CodecFactory() {} |
32 | 34 |
33 virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg, | 35 virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg, |
34 unsigned long deadline) const = 0; | 36 unsigned long deadline) const = 0; |
35 | 37 |
36 virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg, | 38 virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg, |
(...skipping 27 matching lines...) Expand all Loading... |
64 /* | 66 /* |
65 * VP8 Codec Definitions | 67 * VP8 Codec Definitions |
66 */ | 68 */ |
67 #if CONFIG_VP8 | 69 #if CONFIG_VP8 |
68 class VP8Decoder : public Decoder { | 70 class VP8Decoder : public Decoder { |
69 public: | 71 public: |
70 VP8Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline) | 72 VP8Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline) |
71 : Decoder(cfg, deadline) {} | 73 : Decoder(cfg, deadline) {} |
72 | 74 |
73 protected: | 75 protected: |
74 virtual const vpx_codec_iface_t* CodecInterface() const { | 76 virtual vpx_codec_iface_t* CodecInterface() const { |
75 #if CONFIG_VP8_DECODER | 77 #if CONFIG_VP8_DECODER |
76 return &vpx_codec_vp8_dx_algo; | 78 return &vpx_codec_vp8_dx_algo; |
77 #else | 79 #else |
78 return NULL; | 80 return NULL; |
79 #endif | 81 #endif |
80 } | 82 } |
81 }; | 83 }; |
82 | 84 |
83 class VP8Encoder : public Encoder { | 85 class VP8Encoder : public Encoder { |
84 public: | 86 public: |
85 VP8Encoder(vpx_codec_enc_cfg_t cfg, unsigned long deadline, | 87 VP8Encoder(vpx_codec_enc_cfg_t cfg, unsigned long deadline, |
86 const unsigned long init_flags, TwopassStatsStore *stats) | 88 const unsigned long init_flags, TwopassStatsStore *stats) |
87 : Encoder(cfg, deadline, init_flags, stats) {} | 89 : Encoder(cfg, deadline, init_flags, stats) {} |
88 | 90 |
89 protected: | 91 protected: |
90 virtual const vpx_codec_iface_t* CodecInterface() const { | 92 virtual vpx_codec_iface_t* CodecInterface() const { |
91 #if CONFIG_VP8_ENCODER | 93 #if CONFIG_VP8_ENCODER |
92 return &vpx_codec_vp8_cx_algo; | 94 return &vpx_codec_vp8_cx_algo; |
93 #else | 95 #else |
94 return NULL; | 96 return NULL; |
95 #endif | 97 #endif |
96 } | 98 } |
97 }; | 99 }; |
98 | 100 |
99 class VP8CodecFactory : public CodecFactory { | 101 class VP8CodecFactory : public CodecFactory { |
100 public: | 102 public: |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 /* | 148 /* |
147 * VP9 Codec Definitions | 149 * VP9 Codec Definitions |
148 */ | 150 */ |
149 #if CONFIG_VP9 | 151 #if CONFIG_VP9 |
150 class VP9Decoder : public Decoder { | 152 class VP9Decoder : public Decoder { |
151 public: | 153 public: |
152 VP9Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline) | 154 VP9Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline) |
153 : Decoder(cfg, deadline) {} | 155 : Decoder(cfg, deadline) {} |
154 | 156 |
155 protected: | 157 protected: |
156 virtual const vpx_codec_iface_t* CodecInterface() const { | 158 virtual vpx_codec_iface_t* CodecInterface() const { |
157 #if CONFIG_VP9_DECODER | 159 #if CONFIG_VP9_DECODER |
158 return &vpx_codec_vp9_dx_algo; | 160 return &vpx_codec_vp9_dx_algo; |
159 #else | 161 #else |
160 return NULL; | 162 return NULL; |
161 #endif | 163 #endif |
162 } | 164 } |
163 }; | 165 }; |
164 | 166 |
165 class VP9Encoder : public Encoder { | 167 class VP9Encoder : public Encoder { |
166 public: | 168 public: |
167 VP9Encoder(vpx_codec_enc_cfg_t cfg, unsigned long deadline, | 169 VP9Encoder(vpx_codec_enc_cfg_t cfg, unsigned long deadline, |
168 const unsigned long init_flags, TwopassStatsStore *stats) | 170 const unsigned long init_flags, TwopassStatsStore *stats) |
169 : Encoder(cfg, deadline, init_flags, stats) {} | 171 : Encoder(cfg, deadline, init_flags, stats) {} |
170 | 172 |
171 protected: | 173 protected: |
172 virtual const vpx_codec_iface_t* CodecInterface() const { | 174 virtual vpx_codec_iface_t* CodecInterface() const { |
173 #if CONFIG_VP9_ENCODER | 175 #if CONFIG_VP9_ENCODER |
174 return &vpx_codec_vp9_cx_algo; | 176 return &vpx_codec_vp9_cx_algo; |
175 #else | 177 #else |
176 return NULL; | 178 return NULL; |
177 #endif | 179 #endif |
178 } | 180 } |
179 }; | 181 }; |
180 | 182 |
181 class VP9CodecFactory : public CodecFactory { | 183 class VP9CodecFactory : public CodecFactory { |
182 public: | 184 public: |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 &libvpx_test::kVP9)), \ | 223 &libvpx_test::kVP9)), \ |
222 __VA_ARGS__)) | 224 __VA_ARGS__)) |
223 #else | 225 #else |
224 #define VP9_INSTANTIATE_TEST_CASE(test, ...) | 226 #define VP9_INSTANTIATE_TEST_CASE(test, ...) |
225 #endif // CONFIG_VP9 | 227 #endif // CONFIG_VP9 |
226 | 228 |
227 | 229 |
228 } // namespace libvpx_test | 230 } // namespace libvpx_test |
229 | 231 |
230 #endif // TEST_CODEC_FACTORY_H_ | 232 #endif // TEST_CODEC_FACTORY_H_ |
OLD | NEW |