Jim Bankoski | 96b6b6b | 2012-06-23 11:20:41 -0700 | [diff] [blame] | 1 | /* |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved |
Jim Bankoski | 96b6b6b | 2012-06-23 11:20:41 -0700 | [diff] [blame] | 3 | * |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 4 | * This source code is subject to the terms of the BSD 2 Clause License and |
| 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
| 6 | * was not distributed with this source code in the LICENSE file, you can |
| 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open |
| 8 | * Media Patent License 1.0 was not distributed with this source code in the |
| 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
Jim Bankoski | 96b6b6b | 2012-06-23 11:20:41 -0700 | [diff] [blame] | 10 | */ |
| 11 | #ifndef TEST_I420_VIDEO_SOURCE_H_ |
| 12 | #define TEST_I420_VIDEO_SOURCE_H_ |
| 13 | #include <cstdio> |
| 14 | #include <cstdlib> |
Yaowu Xu | afffa3d | 2013-09-05 08:45:56 -0700 | [diff] [blame] | 15 | #include <string> |
Jim Bankoski | 96b6b6b | 2012-06-23 11:20:41 -0700 | [diff] [blame] | 16 | |
Deb Mukherjee | 50c59cd | 2014-10-15 16:40:12 -0700 | [diff] [blame] | 17 | #include "test/yuv_video_source.h" |
Jim Bankoski | 96b6b6b | 2012-06-23 11:20:41 -0700 | [diff] [blame] | 18 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 19 | namespace libaom_test { |
Jim Bankoski | 96b6b6b | 2012-06-23 11:20:41 -0700 | [diff] [blame] | 20 | |
| 21 | // This class extends VideoSource to allow parsing of raw yv12 |
| 22 | // so that we can do actual file encodes. |
Deb Mukherjee | 50c59cd | 2014-10-15 16:40:12 -0700 | [diff] [blame] | 23 | class I420VideoSource : public YUVVideoSource { |
Jim Bankoski | 96b6b6b | 2012-06-23 11:20:41 -0700 | [diff] [blame] | 24 | public: |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 25 | I420VideoSource(const std::string &file_name, unsigned int width, |
| 26 | unsigned int height, int rate_numerator, int rate_denominator, |
Jim Bankoski | 96b6b6b | 2012-06-23 11:20:41 -0700 | [diff] [blame] | 27 | unsigned int start, int limit) |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 28 | : YUVVideoSource(file_name, AOM_IMG_FMT_I420, width, height, |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 29 | rate_numerator, rate_denominator, start, limit) {} |
Jim Bankoski | 96b6b6b | 2012-06-23 11:20:41 -0700 | [diff] [blame] | 30 | }; |
| 31 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 32 | } // namespace libaom_test |
Jim Bankoski | 96b6b6b | 2012-06-23 11:20:41 -0700 | [diff] [blame] | 33 | |
| 34 | #endif // TEST_I420_VIDEO_SOURCE_H_ |