| 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 |
| 11 #include "webrtc/tools/frame_analyzer/video_quality_analysis.h" | 11 #include "webrtc/tools/frame_analyzer/video_quality_analysis.h" |
| 12 | 12 |
| 13 #include <assert.h> | 13 #include <assert.h> |
| 14 #include <stdio.h> | 14 #include <stdio.h> |
| 15 #include <stdlib.h> | 15 #include <stdlib.h> |
| 16 | 16 |
| 17 #include <string> | 17 #include <string> |
| 18 | 18 |
| 19 #define STATS_LINE_LENGTH 32 | 19 #define STATS_LINE_LENGTH 32 |
| 20 #define Y4M_FILE_HEADER_MAX_SIZE 200 | 20 #define Y4M_FILE_HEADER_MAX_SIZE 200 |
| 21 #define Y4M_FRAME_DELIMITER "FRAME" | 21 #define Y4M_FRAME_DELIMITER "FRAME" |
| 22 #define Y4M_FRAME_HEADER_SIZE 6 | 22 #define Y4M_FRAME_HEADER_SIZE 6 |
| 23 | 23 |
| 24 namespace webrtc { | 24 namespace webrtc { |
| 25 namespace test { | 25 namespace test { |
| 26 | 26 |
| 27 using std::string; | 27 using std::string; |
| 28 | 28 |
| 29 ResultsContainer::ResultsContainer() {} |
| 30 ResultsContainer::~ResultsContainer() {} |
| 31 |
| 29 int GetI420FrameSize(int width, int height) { | 32 int GetI420FrameSize(int width, int height) { |
| 30 int half_width = (width + 1) >> 1; | 33 int half_width = (width + 1) >> 1; |
| 31 int half_height = (height + 1) >> 1; | 34 int half_height = (height + 1) >> 1; |
| 32 | 35 |
| 33 int y_plane = width * height; // I420 Y plane. | 36 int y_plane = width * height; // I420 Y plane. |
| 34 int u_plane = half_width * half_height; // I420 U plane. | 37 int u_plane = half_width * half_height; // I420 U plane. |
| 35 int v_plane = half_width * half_height; // I420 V plane. | 38 int v_plane = half_width * half_height; // I420 V plane. |
| 36 | 39 |
| 37 return y_plane + u_plane + v_plane; | 40 return y_plane + u_plane + v_plane; |
| 38 } | 41 } |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 for (iter = results->frames.begin(); iter != results->frames.end() - 1; | 358 for (iter = results->frames.begin(); iter != results->frames.end() - 1; |
| 356 ++iter) { | 359 ++iter) { |
| 357 fprintf(output, "%f,", iter->ssim_value); | 360 fprintf(output, "%f,", iter->ssim_value); |
| 358 } | 361 } |
| 359 fprintf(output, "%f] score\n", iter->ssim_value); | 362 fprintf(output, "%f] score\n", iter->ssim_value); |
| 360 } | 363 } |
| 361 } | 364 } |
| 362 | 365 |
| 363 } // namespace test | 366 } // namespace test |
| 364 } // namespace webrtc | 367 } // namespace webrtc |
| OLD | NEW |