Upstream version 5.34.98.0
[platform/framework/web/crosswalk.git] / src / media / cast / test / video_utility.h
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
3 // found in the LICENSE file.
4
5 // Utility functions for video testing.
6
7 #include "media/base/video_frame.h"
8
9 namespace media {
10 namespace cast {
11
12 // Compute and return PSNR between two frames.
13 double I420PSNR(const scoped_refptr<media::VideoFrame>& frame1,
14                 const scoped_refptr<media::VideoFrame>& frame2);
15
16 // Populate a video frame with values starting with the given start value.
17 // Width, height and stride should be set in advance.
18 // Memory is allocated within the function.
19 void PopulateVideoFrame(VideoFrame* frame, int start_value);
20
21 // Populate a video frame from a file.
22 // Returns true if frame was populated, false if not (EOF).
23 bool PopulateVideoFrameFromFile(VideoFrame* frame, FILE* video_file);
24
25 }  // namespace cast
26 }  // namespace media