From f880f863dd9c0b1347ef185f5cc856f3ad045861 Mon Sep 17 00:00:00 2001 From: "kjellander@webrtc.org" Date: Tue, 10 Sep 2013 12:10:01 +0000 Subject: [PATCH] Convert printing in video quality tests to Chromium's perf format. Add support for --label flag to the frame_analyzer, that decides what label shall be used for the perf output. BUG=none TEST= Make sure to have zxing and ffmpeg in the PATH. Create a captured video (from running vie_auto_test custom call) webrtc/tools/compare_videos.py --ref_video=reference_video.yuv --test_video=captured_output.yuv --frame_analyzer=out/Release/frame_analyzer --label=TEST_VGA And then inspecting the output that is prefixed with RESULT. R=phoglund@webrtc.org Review URL: https://webrtc-codereview.appspot.com/2190005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4714 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/tools/compare_videos.py | 6 +- webrtc/tools/frame_analyzer/frame_analyzer.cc | 24 +++--- .../frame_analyzer/video_quality_analysis.cc | 45 ++++++++---- .../frame_analyzer/video_quality_analysis.h | 17 ++++- .../video_quality_analysis_unittest.cc | 73 +++++++++++++++++++ webrtc/tools/tools.gyp | 2 + 6 files changed, 135 insertions(+), 32 deletions(-) create mode 100644 webrtc/tools/frame_analyzer/video_quality_analysis_unittest.cc diff --git a/webrtc/tools/compare_videos.py b/webrtc/tools/compare_videos.py index 0e0a4f659..afdd6a467 100755 --- a/webrtc/tools/compare_videos.py +++ b/webrtc/tools/compare_videos.py @@ -24,10 +24,13 @@ def _ParseArgs(): usage = 'usage: %prog [options]' parser = optparse.OptionParser(usage=usage) + parser.add_option('--label', type='string', default="MY_TEST", + help=('Label of the test, used to identify different ' + 'tests. Default: %default')) parser.add_option('--ref_video', type='string', help='Reference video to compare with (YUV).') parser.add_option('--test_video', type='string', - help=('Test video to be comared with the reference ' + help=('Test video to be compared with the reference ' 'video (YUV).')) parser.add_option('--frame_analyzer', type='string', help='Path to the frame analyzer executable.') @@ -94,6 +97,7 @@ def main(): # Run frame analyzer to compare the videos and print output. cmd = [ options.frame_analyzer, + '--label=%s' % options.label, '--reference_file=%s' % options.ref_video, '--test_file=%s' % options.test_video, '--stats_file=%s' % options.stats_file, diff --git a/webrtc/tools/frame_analyzer/frame_analyzer.cc b/webrtc/tools/frame_analyzer/frame_analyzer.cc index d368379ed..aed956562 100644 --- a/webrtc/tools/frame_analyzer/frame_analyzer.cc +++ b/webrtc/tools/frame_analyzer/frame_analyzer.cc @@ -29,19 +29,15 @@ * where xxxx is the frame number in the test video and yyyy is the * corresponding frame number in the original video. * The video files should be 1420 YUV videos. - * The tool prints the result to the standard output in the following format: - * BSTATS - * ; ; .... - * ESTATS - * Unique_frames_count: - * Max_repeated: - * Max_skipped + * The tool prints the result to standard output in the Chromium perf format: + * RESULT :