OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // problem with the decoding there would be 'Barcode error' instead of yyyy. | 55 // problem with the decoding there would be 'Barcode error' instead of yyyy. |
56 void RunAnalysis(const char* reference_file_name, const char* test_file_name, | 56 void RunAnalysis(const char* reference_file_name, const char* test_file_name, |
57 const char* stats_file_name, int width, int height, | 57 const char* stats_file_name, int width, int height, |
58 ResultsContainer* results); | 58 ResultsContainer* results); |
59 | 59 |
60 // Compute PSNR or SSIM for an I420 frame (all planes). When we are calculating | 60 // Compute PSNR or SSIM for an I420 frame (all planes). When we are calculating |
61 // PSNR values, the max return value (in the case where the test and reference | 61 // PSNR values, the max return value (in the case where the test and reference |
62 // frames are exactly the same) will be 48. In the case of SSIM the max return | 62 // frames are exactly the same) will be 48. In the case of SSIM the max return |
63 // value will be 1. | 63 // value will be 1. |
64 double CalculateMetrics(VideoAnalysisMetricsType video_metrics_type, | 64 double CalculateMetrics(VideoAnalysisMetricsType video_metrics_type, |
65 const uint8* ref_frame, const uint8* test_frame, | 65 const uint8_t* ref_frame, |
66 int width, int height); | 66 const uint8_t* test_frame, |
| 67 int width, |
| 68 int height); |
67 | 69 |
68 // Prints the result from the analysis in Chromium performance | 70 // Prints the result from the analysis in Chromium performance |
69 // numbers compatible format to stdout. If the results object contains no frames | 71 // numbers compatible format to stdout. If the results object contains no frames |
70 // no output will be written. | 72 // no output will be written. |
71 void PrintAnalysisResults(const std::string& label, ResultsContainer* results); | 73 void PrintAnalysisResults(const std::string& label, ResultsContainer* results); |
72 | 74 |
73 // Similar to the above, but will print to the specified file handle. | 75 // Similar to the above, but will print to the specified file handle. |
74 void PrintAnalysisResults(FILE* output, const std::string& label, | 76 void PrintAnalysisResults(FILE* output, const std::string& label, |
75 ResultsContainer* results); | 77 ResultsContainer* results); |
76 | 78 |
(...skipping 17 matching lines...) Expand all Loading... |
94 int ExtractFrameSequenceNumber(std::string line); | 96 int ExtractFrameSequenceNumber(std::string line); |
95 | 97 |
96 // Checks if there is 'Barcode error' for the given line. | 98 // Checks if there is 'Barcode error' for the given line. |
97 bool IsThereBarcodeError(std::string line); | 99 bool IsThereBarcodeError(std::string line); |
98 | 100 |
99 // Extract the frame number in the reference video. I.e. if line is | 101 // Extract the frame number in the reference video. I.e. if line is |
100 // frame_0023 0284, we will get 284. | 102 // frame_0023 0284, we will get 284. |
101 int ExtractDecodedFrameNumber(std::string line); | 103 int ExtractDecodedFrameNumber(std::string line); |
102 | 104 |
103 // Extracts an I420 frame at position frame_number from the raw YUV file. | 105 // Extracts an I420 frame at position frame_number from the raw YUV file. |
104 bool ExtractFrameFromYuvFile(const char* i420_file_name, int width, int height, | 106 bool ExtractFrameFromYuvFile(const char* i420_file_name, |
105 int frame_number, uint8* result_frame); | 107 int width, |
| 108 int height, |
| 109 int frame_number, |
| 110 uint8_t* result_frame); |
106 | 111 |
107 // Extracts an I420 frame at position frame_number from the Y4M file. The first | 112 // Extracts an I420 frame at position frame_number from the Y4M file. The first |
108 // frame has corresponded |frame_number| 0. | 113 // frame has corresponded |frame_number| 0. |
109 bool ExtractFrameFromY4mFile(const char* i420_file_name, int width, int height, | 114 bool ExtractFrameFromY4mFile(const char* i420_file_name, |
110 int frame_number, uint8* result_frame); | 115 int width, |
111 | 116 int height, |
| 117 int frame_number, |
| 118 uint8_t* result_frame); |
112 | 119 |
113 } // namespace test | 120 } // namespace test |
114 } // namespace webrtc | 121 } // namespace webrtc |
115 | 122 |
116 #endif // WEBRTC_TOOLS_FRAME_ANALYZER_VIDEO_QUALITY_ANALYSIS_H_ | 123 #endif // WEBRTC_TOOLS_FRAME_ANALYZER_VIDEO_QUALITY_ANALYSIS_H_ |
OLD | NEW |