Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: webrtc/tools/frame_analyzer/video_quality_analysis.cc

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + revert basictypes.h (to be landed separately just in case of a revert due to unexpected us… Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/tools/frame_analyzer/video_quality_analysis.cc
diff --git a/webrtc/tools/frame_analyzer/video_quality_analysis.cc b/webrtc/tools/frame_analyzer/video_quality_analysis.cc
index 5c707bb6e3df1cd95b6479654c7c189e33b815a8..172baa72b80901ff29380a677c69768de69dbe03 100644
--- a/webrtc/tools/frame_analyzer/video_quality_analysis.cc
+++ b/webrtc/tools/frame_analyzer/video_quality_analysis.cc
@@ -90,8 +90,11 @@ bool GetNextStatsLine(FILE* stats_file, char* line) {
return true;
}
-bool ExtractFrameFromYuvFile(const char* i420_file_name, int width, int height,
- int frame_number, uint8* result_frame) {
+bool ExtractFrameFromYuvFile(const char* i420_file_name,
+ int width,
+ int height,
+ int frame_number,
+ uint8_t* result_frame) {
int frame_size = GetI420FrameSize(width, height);
int offset = frame_number * frame_size; // Calculate offset for the frame.
bool errors = false;
@@ -117,8 +120,11 @@ bool ExtractFrameFromYuvFile(const char* i420_file_name, int width, int height,
return !errors;
}
-bool ExtractFrameFromY4mFile(const char* y4m_file_name, int width, int height,
- int frame_number, uint8* result_frame) {
+bool ExtractFrameFromY4mFile(const char* y4m_file_name,
+ int width,
+ int height,
+ int frame_number,
+ uint8_t* result_frame) {
int frame_size = GetI420FrameSize(width, height);
int frame_offset = frame_number * frame_size;
bool errors = false;
@@ -170,20 +176,22 @@ bool ExtractFrameFromY4mFile(const char* y4m_file_name, int width, int height,
}
double CalculateMetrics(VideoAnalysisMetricsType video_metrics_type,
- const uint8* ref_frame, const uint8* test_frame,
- int width, int height) {
+ const uint8_t* ref_frame,
+ const uint8_t* test_frame,
+ int width,
+ int height) {
if (!ref_frame || !test_frame)
return -1;
else if (height < 0 || width < 0)
return -1;
int half_width = (width + 1) >> 1;
int half_height = (height + 1) >> 1;
- const uint8* src_y_a = ref_frame;
- const uint8* src_u_a = src_y_a + width * height;
- const uint8* src_v_a = src_u_a + half_width * half_height;
- const uint8* src_y_b = test_frame;
- const uint8* src_u_b = src_y_b + width * height;
- const uint8* src_v_b = src_u_b + half_width * half_height;
+ const uint8_t* src_y_a = ref_frame;
+ const uint8_t* src_u_a = src_y_a + width * height;
+ const uint8_t* src_v_a = src_u_a + half_width * half_height;
+ const uint8_t* src_y_b = test_frame;
+ const uint8_t* src_u_b = src_y_b + width * height;
+ const uint8_t* src_v_b = src_u_b + half_width * half_height;
int stride_y = width;
int stride_uv = half_width;
@@ -230,8 +238,8 @@ void RunAnalysis(const char* reference_file_name, const char* test_file_name,
char line[STATS_LINE_LENGTH];
// Allocate buffers for test and reference frames.
- uint8* test_frame = new uint8[size];
- uint8* reference_frame = new uint8[size];
+ uint8_t* test_frame = new uint8_t[size];
+ uint8_t* reference_frame = new uint8_t[size];
int previous_frame_number = -1;
// While there are entries in the stats file.
« no previous file with comments | « webrtc/tools/frame_analyzer/video_quality_analysis.h ('k') | webrtc/tools/psnr_ssim_analyzer/psnr_ssim_analyzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698