1 // Copyright 2014 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.
5 // Utility functions for video testing.
7 #include "media/base/video_frame.h"
12 // Compute and return PSNR between two frames.
13 double I420PSNR(const scoped_refptr
<media::VideoFrame
>& frame1
,
14 const scoped_refptr
<media::VideoFrame
>& frame2
);
16 // Compute and return SSIM between two frames.
17 double I420SSIM(const scoped_refptr
<media::VideoFrame
>& frame1
,
18 const scoped_refptr
<media::VideoFrame
>& frame2
);
20 // Populate a video |frame| with a plaid pattern, cycling from the given
22 // Width, height and stride should be set in advance.
23 // Memory is allocated within the function.
24 void PopulateVideoFrame(VideoFrame
* frame
, int start_value
);
26 // Populate a video frame with noise.
27 void PopulateVideoFrameWithNoise(VideoFrame
* frame
);
29 // Populate a video frame from a file.
30 // Returns true if frame was populated, false if not (EOF).
31 bool PopulateVideoFrameFromFile(VideoFrame
* frame
, FILE* video_file
);