OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Utility functions for video testing. | 5 // Utility functions for video testing. |
6 | 6 |
7 #include "media/base/video_frame.h" | 7 #include "media/base/video_frame.h" |
8 #include "media/cast/cast_config.h" | |
9 | 8 |
10 namespace media { | 9 namespace media { |
11 namespace cast { | 10 namespace cast { |
12 | 11 |
13 // Compute and return PSNR between two frames. | 12 // Compute and return PSNR between two frames. |
14 double I420PSNR(const I420VideoFrame& frame1, const I420VideoFrame& frame2); | 13 double I420PSNR(const scoped_refptr<media::VideoFrame>& frame1, |
15 | 14 const scoped_refptr<media::VideoFrame>& frame2); |
16 // Temporary function to handle the transition | |
17 // from I420VideoFrame->media::VideoFrame. | |
18 double I420PSNR(const VideoFrame& frame1, const I420VideoFrame& frame2); | |
19 | 15 |
20 // Populate a video frame with values starting with the given start value. | 16 // Populate a video frame with values starting with the given start value. |
21 // Width, height and stride should be set in advance. | 17 // Width, height and stride should be set in advance. |
22 // Memory is allocated within the function. | 18 // Memory is allocated within the function. |
23 void PopulateVideoFrame(VideoFrame* frame, int start_value); | 19 void PopulateVideoFrame(VideoFrame* frame, int start_value); |
24 void PopulateVideoFrame(I420VideoFrame* frame, int start_value); | |
25 | 20 |
26 // Populate a video frame from a file. | 21 // Populate a video frame from a file. |
27 // Returns true if frame was populated, false if not (EOF). | 22 // Returns true if frame was populated, false if not (EOF). |
28 bool PopulateVideoFrameFromFile(VideoFrame* frame, FILE* video_file); | 23 bool PopulateVideoFrameFromFile(VideoFrame* frame, FILE* video_file); |
29 | 24 |
30 } // namespace cast | 25 } // namespace cast |
31 } // namespace media | 26 } // namespace media |
OLD | NEW |