OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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_ENCODE_TEST_DRIVER_H_ | 10 #ifndef TEST_ENCODE_TEST_DRIVER_H_ |
11 #define TEST_ENCODE_TEST_DRIVER_H_ | 11 #define TEST_ENCODE_TEST_DRIVER_H_ |
12 | 12 |
13 #include <string> | 13 #include <string> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "./vpx_config.h" | 16 #include "./vpx_config.h" |
17 #include "third_party/googletest/src/include/gtest/gtest.h" | 17 #include "third_party/googletest/src/include/gtest/gtest.h" |
18 #include "vpx/vpx_encoder.h" | 18 #include "vpx/vpx_encoder.h" |
| 19 #if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER |
| 20 #include "vpx/vp8cx.h" |
| 21 #endif |
19 | 22 |
20 namespace libvpx_test { | 23 namespace libvpx_test { |
21 | 24 |
22 class CodecFactory; | 25 class CodecFactory; |
23 class VideoSource; | 26 class VideoSource; |
24 | 27 |
25 enum TestMode { | 28 enum TestMode { |
26 kRealTime, | 29 kRealTime, |
27 kOnePassGood, | 30 kOnePassGood, |
28 kOnePassBest, | 31 kOnePassBest, |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 void Control(int ctrl_id, struct vpx_scaling_mode *arg) { | 124 void Control(int ctrl_id, struct vpx_scaling_mode *arg) { |
122 const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg); | 125 const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg); |
123 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); | 126 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); |
124 } | 127 } |
125 | 128 |
126 void Control(int ctrl_id, struct vpx_svc_layer_id *arg) { | 129 void Control(int ctrl_id, struct vpx_svc_layer_id *arg) { |
127 const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg); | 130 const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg); |
128 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); | 131 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); |
129 } | 132 } |
130 | 133 |
| 134 #if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER |
| 135 void Control(int ctrl_id, vpx_active_map_t *arg) { |
| 136 const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg); |
| 137 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); |
| 138 } |
| 139 #endif |
| 140 |
131 void set_deadline(unsigned long deadline) { | 141 void set_deadline(unsigned long deadline) { |
132 deadline_ = deadline; | 142 deadline_ = deadline; |
133 } | 143 } |
134 | 144 |
135 protected: | 145 protected: |
136 virtual vpx_codec_iface_t* CodecInterface() const = 0; | 146 virtual vpx_codec_iface_t* CodecInterface() const = 0; |
137 | 147 |
138 const char *EncoderError() { | 148 const char *EncoderError() { |
139 const char *detail = vpx_codec_error_detail(&encoder_); | 149 const char *detail = vpx_codec_error_detail(&encoder_); |
140 return detail ? detail : vpx_codec_error(&encoder_); | 150 return detail ? detail : vpx_codec_error(&encoder_); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 unsigned long deadline_; | 233 unsigned long deadline_; |
224 TwopassStatsStore stats_; | 234 TwopassStatsStore stats_; |
225 unsigned long init_flags_; | 235 unsigned long init_flags_; |
226 unsigned long frame_flags_; | 236 unsigned long frame_flags_; |
227 vpx_codec_pts_t last_pts_; | 237 vpx_codec_pts_t last_pts_; |
228 }; | 238 }; |
229 | 239 |
230 } // namespace libvpx_test | 240 } // namespace libvpx_test |
231 | 241 |
232 #endif // TEST_ENCODE_TEST_DRIVER_H_ | 242 #endif // TEST_ENCODE_TEST_DRIVER_H_ |
OLD | NEW |