OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 #include <stdio.h> | 10 #include <stdio.h> |
11 #include <stdlib.h> | 11 #include <stdlib.h> |
12 #include <string.h> | 12 #include <string.h> |
13 #include <iostream> | 13 #include <iostream> |
14 #include <numeric> | 14 #include <numeric> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/tools/frame_analyzer/reference_less_video_analysis_lib.h" | 17 #include "webrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_lib.h" |
18 #include "webrtc/tools/frame_analyzer/video_quality_analysis.h" | 18 #include "webrtc/rtc_tools/frame_analyzer/video_quality_analysis.h" |
19 | 19 |
20 #define STATS_LINE_LENGTH 28 | 20 #define STATS_LINE_LENGTH 28 |
21 #define PSNR_FREEZE_THRESHOLD 47 | 21 #define PSNR_FREEZE_THRESHOLD 47 |
22 #define SSIM_FREEZE_THRESHOLD .999 | 22 #define SSIM_FREEZE_THRESHOLD .999 |
23 | 23 |
24 #if defined(_WIN32) || defined(_WIN64) | 24 #if defined(_WIN32) || defined(_WIN64) |
25 #define strtok_r strtok_s | 25 #define strtok_r strtok_s |
26 #endif | 26 #endif |
27 | 27 |
28 void get_height_width_fps(int *height, int *width, int *fps, | 28 void get_height_width_fps(int *height, int *width, int *fps, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 const std::vector<double>& ssim_per_frame) { | 83 const std::vector<double>& ssim_per_frame) { |
84 /* | 84 /* |
85 * Prints the different metrics mainly: | 85 * Prints the different metrics mainly: |
86 * 1) Identical frame number, PSNR and SSIM values. | 86 * 1) Identical frame number, PSNR and SSIM values. |
87 * 2) Length of continuous frozen frames. | 87 * 2) Length of continuous frozen frames. |
88 * 3) Max length of continuous freezed frames. | 88 * 3) Max length of continuous freezed frames. |
89 * 4) No of unique frames found. | 89 * 4) No of unique frames found. |
90 * 5) Total different identical frames found. | 90 * 5) Total different identical frames found. |
91 * | 91 * |
92 * Sample output: | 92 * Sample output: |
93 * Printing metrics for file: /src/webrtc/tools/test_3.y4m | 93 * Printing metrics for file: /src/webrtc/rtc_tools/test_3.y4m |
94 ============================= | 94 ============================= |
95 Total number of frames received: 74 | 95 Total number of frames received: 74 |
96 Total identical frames: 5 | 96 Total identical frames: 5 |
97 Number of unique frames: 69 | 97 Number of unique frames: 69 |
98 Printing Identical Frames: | 98 Printing Identical Frames: |
99 Frame Number: 29 PSNR: 48.000000 SSIM: 0.999618 | 99 Frame Number: 29 PSNR: 48.000000 SSIM: 0.999618 |
100 Frame Number: 30 PSNR: 48.000000 SSIM: 0.999898 | 100 Frame Number: 30 PSNR: 48.000000 SSIM: 0.999898 |
101 Frame Number: 60 PSNR: 48.000000 SSIM: 0.999564 | 101 Frame Number: 60 PSNR: 48.000000 SSIM: 0.999564 |
102 Frame Number: 64 PSNR: 48.000000 SSIM: 0.999651 | 102 Frame Number: 64 PSNR: 48.000000 SSIM: 0.999651 |
103 Frame Number: 69 PSNR: 48.000000 SSIM: 0.999684 | 103 Frame Number: 69 PSNR: 48.000000 SSIM: 0.999684 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 compute_metrics(video_file, &psnr_per_frame, &ssim_per_frame); | 193 compute_metrics(video_file, &psnr_per_frame, &ssim_per_frame); |
194 } else { | 194 } else { |
195 return -1; | 195 return -1; |
196 } | 196 } |
197 printf("=============================\n"); | 197 printf("=============================\n"); |
198 printf("Printing metrics for file: %s\n", video_file.c_str()); | 198 printf("Printing metrics for file: %s\n", video_file.c_str()); |
199 printf("=============================\n"); | 199 printf("=============================\n"); |
200 print_freezing_metrics(psnr_per_frame, ssim_per_frame); | 200 print_freezing_metrics(psnr_per_frame, ssim_per_frame); |
201 return 0; | 201 return 0; |
202 } | 202 } |
OLD | NEW |