Revert "Update video_quality_analysis to align videos instead of using barcodes"
This reverts commit d65e143801a7aaa9affdb939ea836aec1955cdcc. Reason for revert: Breaks perf bots. frame_analyzer is a prebuilt binary, so it won't automatically pick up changes in the .cc file. Original change's description: > Update video_quality_analysis to align videos instead of using barcodes > > This CL is a follow-up to the previous CL > https://webrtc-review.googlesource.com/c/src/+/94773 that added generic > logic for aligning videos. This will allow us to easily extend > video_quality_analysis with new sophisticated video quality metrics. > Also, we can use any kind of video that does not necessarily need to > contain bar codes. Removing the need to decode barcodes also leads to a > big speedup for the tests. > > Bug: webrtc:9642 > Change-Id: I74b0d630b3e1ed44781ad024115ded3143e28f50 > Reviewed-on: https://webrtc-review.googlesource.com/94845 > Reviewed-by: Paulina Hensman <phensman@webrtc.org> > Reviewed-by: Patrik Höglund <phoglund@webrtc.org> > Commit-Queue: Magnus Jedvert <magjed@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#24423} TBR=phoglund@webrtc.org,magjed@webrtc.org,phensman@webrtc.org Change-Id: Ia590b465687b861fe37ed1b14756d4607ca90da1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9642 Reviewed-on: https://webrtc-review.googlesource.com/95946 Reviewed-by: Magnus Jedvert <magjed@webrtc.org> Commit-Queue: Magnus Jedvert <magjed@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24428}
This commit is contained in:
committed by
Commit Bot
parent
a1cceca02c
commit
3e169ac18c
@ -47,12 +47,25 @@ struct ResultsContainer {
|
||||
// A function to run the PSNR and SSIM analysis on the test file. The test file
|
||||
// comprises the frames that were captured during the quality measurement test.
|
||||
// There may be missing or duplicate frames. Also the frames start at a random
|
||||
// position in the original video. We also need to provide a map from test frame
|
||||
// indices to reference frame indices.
|
||||
std::vector<AnalysisResult> RunAnalysis(
|
||||
const rtc::scoped_refptr<webrtc::test::Video>& reference_video,
|
||||
const rtc::scoped_refptr<webrtc::test::Video>& test_video,
|
||||
const std::vector<size_t>& test_frame_indices);
|
||||
// position in the original video. We should provide a statistics file along
|
||||
// with the test video. The stats file contains the connection between the
|
||||
// actual frames in the test file and their bar code number. There is one file
|
||||
// for the reference video and one for the test video. The stats file should
|
||||
// be in the form 'frame_xxxx yyyy', where xxxx is the consecutive
|
||||
// number of the frame in the test video, and yyyy is the barcode number.
|
||||
// The stats file could be produced by
|
||||
// tools/barcode_tools/barcode_decoder.py. This script decodes the barcodes
|
||||
// integrated in every video and generates the stats file. If three was some
|
||||
// problem with the decoding there would be 'Barcode error' instead of yyyy.
|
||||
// The stat files are used to compare the right frames with each other and
|
||||
// to calculate statistics.
|
||||
void RunAnalysis(const rtc::scoped_refptr<webrtc::test::Video>& reference_video,
|
||||
const rtc::scoped_refptr<webrtc::test::Video>& test_video,
|
||||
const char* stats_file_reference_name,
|
||||
const char* stats_file_test_name,
|
||||
int width,
|
||||
int height,
|
||||
ResultsContainer* results);
|
||||
|
||||
// Compute PSNR for an I420 buffer (all planes). The max return value (in the
|
||||
// case where the test and reference frames are exactly the same) will be 48.
|
||||
@ -74,28 +87,45 @@ void PrintAnalysisResults(FILE* output,
|
||||
const std::string& label,
|
||||
ResultsContainer* results);
|
||||
|
||||
struct Cluster {
|
||||
// Corresponding reference frame index for this cluster.
|
||||
size_t index;
|
||||
// The number of sequential frames that mapped to the same reference frame
|
||||
// index.
|
||||
int number_of_repeated_frames;
|
||||
};
|
||||
// The barcode number that means that the barcode could not be decoded.
|
||||
const int DECODE_ERROR = -1;
|
||||
|
||||
// Clusters sequentially repeated frames. For example, the sequence {100, 102,
|
||||
// 102, 103} will be mapped to {{100, 1}, {102, 2}, {103, 1}}.
|
||||
std::vector<Cluster> CalculateFrameClusters(const std::vector<size_t>& indices);
|
||||
// Clusters the frames in the file. First in the pair is the frame number and
|
||||
// second is the number of frames in that cluster. So if first frame in video
|
||||
// has number 100 and it is repeated 3 after each other, then the first entry
|
||||
// in the returned vector has first set to 100 and second set to 3.
|
||||
// Decode errors between two frames with same barcode, then it interprets
|
||||
// the frame with the decode error as having the same id as the two frames
|
||||
// around it. Eg. [400, DECODE_ERROR, DECODE_ERROR, 400] is becomes an entry
|
||||
// in return vector with first==400 and second==4. In other cases with decode
|
||||
// errors like [400, DECODE_ERROR, 401] becomes three entries, each with
|
||||
// second==1 and the middle has first==DECODE_ERROR.
|
||||
std::vector<std::pair<int, int> > CalculateFrameClusters(
|
||||
FILE* file,
|
||||
int* num_decode_errors);
|
||||
|
||||
// Get number of max sequentially repeated frames in the test video. This number
|
||||
// will be one if we only store unique frames in the test video.
|
||||
int GetMaxRepeatedFrames(const std::vector<Cluster>& clusters);
|
||||
// Calculates max repeated and skipped frames and prints them to stdout in a
|
||||
// format that is compatible with Chromium performance numbers.
|
||||
void GetMaxRepeatedAndSkippedFrames(const std::string& stats_file_ref_name,
|
||||
const std::string& stats_file_test_name,
|
||||
ResultsContainer* results);
|
||||
|
||||
// Get the longest sequence of skipped reference frames. This corresponds to the
|
||||
// longest freeze in the test video.
|
||||
int GetMaxSkippedFrames(const std::vector<Cluster>& clusters);
|
||||
// Gets the next line from an open stats file.
|
||||
bool GetNextStatsLine(FILE* stats_file, char* line);
|
||||
|
||||
// Get total number of skipped frames in the test video.
|
||||
int GetTotalNumberOfSkippedFrames(const std::vector<Cluster>& clusters);
|
||||
// Calculates the size of a I420 frame if given the width and height.
|
||||
int GetI420FrameSize(int width, int height);
|
||||
|
||||
// Extract the sequence of the frame in the video. I.e. if line is
|
||||
// frame_0023 0284, we will get 23.
|
||||
int ExtractFrameSequenceNumber(std::string line);
|
||||
|
||||
// Checks if there is 'Barcode error' for the given line.
|
||||
bool IsThereBarcodeError(std::string line);
|
||||
|
||||
// Extract the frame number in the reference video. I.e. if line is
|
||||
// frame_0023 0284, we will get 284.
|
||||
int ExtractDecodedFrameNumber(std::string line);
|
||||
|
||||
} // namespace test
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user