Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: source/libvpx/test/y4m_video_source.h

Issue 375983002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/test/y4m_test.cc ('k') | source/libvpx/tools_common.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_Y4M_VIDEO_SOURCE_H_ 10 #ifndef TEST_Y4M_VIDEO_SOURCE_H_
(...skipping 20 matching lines...) Expand all
31 framerate_numerator_(0), 31 framerate_numerator_(0),
32 framerate_denominator_(0), 32 framerate_denominator_(0),
33 y4m_() { 33 y4m_() {
34 } 34 }
35 35
36 virtual ~Y4mVideoSource() { 36 virtual ~Y4mVideoSource() {
37 vpx_img_free(img_.get()); 37 vpx_img_free(img_.get());
38 CloseSource(); 38 CloseSource();
39 } 39 }
40 40
41 virtual void Begin() { 41 virtual void OpenSource() {
42 CloseSource(); 42 CloseSource();
43 input_file_ = OpenTestDataFile(file_name_); 43 input_file_ = OpenTestDataFile(file_name_);
44 ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: " 44 ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: "
45 << file_name_; 45 << file_name_;
46 }
46 47
47 y4m_input_open(&y4m_, input_file_, NULL, 0, 0); 48 virtual void ReadSourceToStart() {
49 ASSERT_TRUE(input_file_ != NULL);
50 ASSERT_FALSE(y4m_input_open(&y4m_, input_file_, NULL, 0, 0));
48 framerate_numerator_ = y4m_.fps_n; 51 framerate_numerator_ = y4m_.fps_n;
49 framerate_denominator_ = y4m_.fps_d; 52 framerate_denominator_ = y4m_.fps_d;
50
51 frame_ = 0; 53 frame_ = 0;
52 for (unsigned int i = 0; i < start_; i++) { 54 for (unsigned int i = 0; i < start_; i++) {
53 Next(); 55 Next();
54 } 56 }
57 FillFrame();
58 }
55 59
56 FillFrame(); 60 virtual void Begin() {
61 OpenSource();
62 ReadSourceToStart();
57 } 63 }
58 64
59 virtual void Next() { 65 virtual void Next() {
60 ++frame_; 66 ++frame_;
61 FillFrame(); 67 FillFrame();
62 } 68 }
63 69
64 virtual vpx_image_t *img() const { 70 virtual vpx_image_t *img() const {
65 return (frame_ < limit_) ? img_.get() : NULL; 71 return (frame_ < limit_) ? img_.get() : NULL;
66 } 72 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 unsigned int limit_; 108 unsigned int limit_;
103 unsigned int frame_; 109 unsigned int frame_;
104 int framerate_numerator_; 110 int framerate_numerator_;
105 int framerate_denominator_; 111 int framerate_denominator_;
106 y4m_input y4m_; 112 y4m_input y4m_;
107 }; 113 };
108 114
109 } // namespace libvpx_test 115 } // namespace libvpx_test
110 116
111 #endif // TEST_Y4M_VIDEO_SOURCE_H_ 117 #endif // TEST_Y4M_VIDEO_SOURCE_H_
OLDNEW
« no previous file with comments | « source/libvpx/test/y4m_test.cc ('k') | source/libvpx/tools_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698