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_ |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); | 133 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); |
134 } | 134 } |
135 | 135 |
136 #if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER | 136 #if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER |
137 void Control(int ctrl_id, vpx_active_map_t *arg) { | 137 void Control(int ctrl_id, vpx_active_map_t *arg) { |
138 const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg); | 138 const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg); |
139 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); | 139 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); |
140 } | 140 } |
141 #endif | 141 #endif |
142 | 142 |
| 143 void Config(const vpx_codec_enc_cfg_t *cfg) { |
| 144 const vpx_codec_err_t res = vpx_codec_enc_config_set(&encoder_, cfg); |
| 145 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); |
| 146 cfg_ = *cfg; |
| 147 } |
| 148 |
143 void set_deadline(unsigned long deadline) { | 149 void set_deadline(unsigned long deadline) { |
144 deadline_ = deadline; | 150 deadline_ = deadline; |
145 } | 151 } |
146 | 152 |
147 protected: | 153 protected: |
148 virtual vpx_codec_iface_t* CodecInterface() const = 0; | 154 virtual vpx_codec_iface_t* CodecInterface() const = 0; |
149 | 155 |
150 const char *EncoderError() { | 156 const char *EncoderError() { |
151 const char *detail = vpx_codec_error_detail(&encoder_); | 157 const char *detail = vpx_codec_error_detail(&encoder_); |
152 return detail ? detail : vpx_codec_error(&encoder_); | 158 return detail ? detail : vpx_codec_error(&encoder_); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 unsigned long deadline_; | 256 unsigned long deadline_; |
251 TwopassStatsStore stats_; | 257 TwopassStatsStore stats_; |
252 unsigned long init_flags_; | 258 unsigned long init_flags_; |
253 unsigned long frame_flags_; | 259 unsigned long frame_flags_; |
254 vpx_codec_pts_t last_pts_; | 260 vpx_codec_pts_t last_pts_; |
255 }; | 261 }; |
256 | 262 |
257 } // namespace libvpx_test | 263 } // namespace libvpx_test |
258 | 264 |
259 #endif // TEST_ENCODE_TEST_DRIVER_H_ | 265 #endif // TEST_ENCODE_TEST_DRIVER_H_ |
OLD | NEW |