Revert CLs affecting video quality toolchain.
Speculatively fixes Chromium test for cut: crbug.com/877968 Reverts CLs: https://webrtc-review.googlesource.com/c/src/+/94772 https://webrtc-review.googlesource.com/c/src/+/95648 https://webrtc-review.googlesource.com/c/src/+/94773 https://webrtc-review.googlesource.com/c/src/+/96000 https://webrtc-review.googlesource.com/c/src/+/95949 Revert "Add Y4mFileReader" This reverts commit 404be7f302358e6be16aadeba8bc8f8aba348c0f. Revert "Remove SequencedTaskChecker from Y4mFileReader" This reverts commit 1b5e5db842971340eb9128985ddbaf0225a9d0b1. Revert "Add tool for aliging video files" This reverts commit b2c0e8f60fad10e2786e5e131136a0da1299d883. Revert "Reland "Update video_quality_analysis to align videos instead of using barcodes"" This reverts commit 9bb55fc09b6bfa00cba7779c37ad6c39b4206f7a. Revert "Fix a bug in barcode_decoder.py" This reverts commit 5c2de6b3ce079cff52c411a2c02ce6553a38dc79. TBR=magjed@webrtc.org, phoglund@webrtc.org, phensman@webrtc.org Bug: chromium:877968, webrtc:9642 Change-Id: I784d0598fd0370eec38d758b9fa0b38e4b3423be Reviewed-on: https://webrtc-review.googlesource.com/96320 Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Commit-Queue: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24458}
This commit is contained in:
committed by
Commit Bot
parent
f9fc171568
commit
0673bc9204
@ -16,16 +16,19 @@
|
||||
#include <vector>
|
||||
|
||||
#include "rtc_tools/frame_analyzer/video_quality_analysis.h"
|
||||
#include "rtc_tools/frame_analyzer/video_temporal_aligner.h"
|
||||
#include "rtc_tools/simple_command_line_parser.h"
|
||||
#include "rtc_tools/y4m_file_reader.h"
|
||||
#include "test/testsupport/perf_test.h"
|
||||
|
||||
/*
|
||||
* A command line tool running PSNR and SSIM on a reference video and a test
|
||||
* video. The test video is a record of the reference video which can start at
|
||||
* an arbitrary point. It is possible that there will be repeated frames or
|
||||
* skipped frames as well. The video files should be 1420 Y4M videos.
|
||||
* skipped frames as well. In order to have a way to compare corresponding
|
||||
* frames from the two videos, two stats files should be provided. One for the
|
||||
* reference video and one for the test video. The stats file
|
||||
* is a text file assumed to be in the format:
|
||||
* frame_xxxx yyyy where xxxx is the frame number in and yyyy is the
|
||||
* corresponding barcode. The video files should be 1420 YUV videos.
|
||||
* The tool prints the result to standard output in the Chromium perf format:
|
||||
* RESULT <metric>:<label>= <values>
|
||||
*
|
||||
@ -33,7 +36,9 @@
|
||||
*
|
||||
* Usage:
|
||||
* frame_analyzer --label=<test_label> --reference_file=<name_of_file>
|
||||
* --test_file_ref=<name_of_file>
|
||||
* --test_file_ref=<name_of_file> --stats_file_test=<name_of_file>
|
||||
* --stats_file=<name_of_file> --width=<frame_width>
|
||||
* --height=<frame_height>
|
||||
*/
|
||||
int main(int argc, char* argv[]) {
|
||||
std::string program_name = argv[0];
|
||||
@ -41,13 +46,24 @@ int main(int argc, char* argv[]) {
|
||||
"Compares the output video with the initially sent video."
|
||||
"\nExample usage:\n" +
|
||||
program_name +
|
||||
" --reference_file=ref.y4m --test_file=test.y4m\n"
|
||||
" --reference_file=ref.yuv --test_file=test.yuv --width=320 "
|
||||
"--height=240\n"
|
||||
"Command line flags:\n"
|
||||
" - width(int): The width of the reference and test files. Default: -1\n"
|
||||
" - height(int): The height of the reference and test files. "
|
||||
" Default: -1\n"
|
||||
" - label(string): The label to use for the perf output."
|
||||
" Default: MY_TEST\n"
|
||||
" Default: ref.y4m\n"
|
||||
" - stats_file_ref(string): The path to the stats file that will be"
|
||||
" produced for the reference video file."
|
||||
" Default: stats_ref.txt\n"
|
||||
" - stats_file_test(string): The path to the stats file that will be"
|
||||
" produced for the test video file."
|
||||
" Default: stats_test.txt\n"
|
||||
" - reference_file(string): The reference YUV file to compare against."
|
||||
" Default: ref.yuv\n"
|
||||
" - test_file(string): The test YUV file to run the analysis for."
|
||||
" Default: test_file.y4m\n"
|
||||
" Default: test_file.yuv\n"
|
||||
" - chartjson_result_file: Where to store perf result in chartjson"
|
||||
" format. If not present, no perf result will be stored."
|
||||
" Default: None\n";
|
||||
@ -58,9 +74,13 @@ int main(int argc, char* argv[]) {
|
||||
parser.Init(argc, argv);
|
||||
parser.SetUsageMessage(usage);
|
||||
|
||||
parser.SetFlag("width", "-1");
|
||||
parser.SetFlag("height", "-1");
|
||||
parser.SetFlag("label", "MY_TEST");
|
||||
parser.SetFlag("reference_file", "ref.y4m");
|
||||
parser.SetFlag("test_file", "test.y4m");
|
||||
parser.SetFlag("stats_file_ref", "stats_ref.txt");
|
||||
parser.SetFlag("stats_file_test", "stats_test.txt");
|
||||
parser.SetFlag("reference_file", "ref.yuv");
|
||||
parser.SetFlag("test_file", "test.yuv");
|
||||
parser.SetFlag("chartjson_result_file", "");
|
||||
parser.SetFlag("help", "false");
|
||||
|
||||
@ -71,32 +91,24 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
parser.PrintEnteredFlags();
|
||||
|
||||
webrtc::test::ResultsContainer results;
|
||||
int width = strtol((parser.GetFlag("width")).c_str(), NULL, 10);
|
||||
int height = strtol((parser.GetFlag("height")).c_str(), NULL, 10);
|
||||
|
||||
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;
|
||||
if (width <= 0 || height <= 0) {
|
||||
fprintf(stderr, "Error: width or height cannot be <= 0!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
const std::vector<size_t> matching_indices =
|
||||
webrtc::test::FindMatchingFrameIndices(reference_video, test_video);
|
||||
webrtc::test::ResultsContainer results;
|
||||
|
||||
results.frames =
|
||||
webrtc::test::RunAnalysis(reference_video, test_video, matching_indices);
|
||||
|
||||
const std::vector<webrtc::test::Cluster> clusters =
|
||||
webrtc::test::CalculateFrameClusters(matching_indices);
|
||||
results.max_repeated_frames = webrtc::test::GetMaxRepeatedFrames(clusters);
|
||||
results.max_skipped_frames = webrtc::test::GetMaxSkippedFrames(clusters);
|
||||
results.total_skipped_frames =
|
||||
webrtc::test::GetTotalNumberOfSkippedFrames(clusters);
|
||||
results.decode_errors_ref = 0;
|
||||
results.decode_errors_test = 0;
|
||||
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);
|
||||
webrtc::test::GetMaxRepeatedAndSkippedFrames(
|
||||
parser.GetFlag("stats_file_ref"), parser.GetFlag("stats_file_test"),
|
||||
&results);
|
||||
|
||||
webrtc::test::PrintAnalysisResults(parser.GetFlag("label"), &results);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user