Add Y4mFileReader

Encapsulate logic for reading .y4m video files in a single class. We
currently have spread out logic for opening .y4m files with partial
parsing. This CL consolidates this logic into a single class with a well
defined interface.

Change-Id: Id61673b3c95a0053b30e95b4cf382e1c6b05fc30
Bug: webrtc:9642
Reviewed-on: https://webrtc-review.googlesource.com/94772
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24398}
This commit is contained in:
Magnus Jedvert
2018-08-22 19:23:34 +02:00
committed by Commit Bot
parent 63af828a1b
commit 404be7f302
13 changed files with 543 additions and 382 deletions

View File

@ -17,6 +17,7 @@
#include "rtc_tools/frame_analyzer/video_quality_analysis.h"
#include "rtc_tools/simple_command_line_parser.h"
#include "rtc_tools/y4m_file_reader.h"
#include "test/testsupport/perf_test.h"
/*
@ -101,11 +102,19 @@ int main(int argc, char* argv[]) {
webrtc::test::ResultsContainer results;
webrtc::test::RunAnalysis(parser.GetFlag("reference_file").c_str(),
parser.GetFlag("test_file").c_str(),
parser.GetFlag("stats_file_ref").c_str(),
parser.GetFlag("stats_file_test").c_str(), width,
height, &results);
rtc::scoped_refptr<webrtc::test::Y4mFile> reference_video =
webrtc::test::Y4mFile::Open(parser.GetFlag("reference_file"));
rtc::scoped_refptr<webrtc::test::Y4mFile> test_video =
webrtc::test::Y4mFile::Open(parser.GetFlag("test_file"));
if (!reference_video || !test_video) {
fprintf(stderr, "Error opening video files\n");
return 0;
}
webrtc::test::RunAnalysis(
reference_video, test_video, parser.GetFlag("stats_file_ref").c_str(),
parser.GetFlag("stats_file_test").c_str(), width, height, &results);
webrtc::test::GetMaxRepeatedAndSkippedFrames(
parser.GetFlag("stats_file_ref"), parser.GetFlag("stats_file_test"),
&results);