1 --- webrtc-20121218svn2718/src/tools/frame_analyzer/video_quality_analysis.h.orig 2012-08-27 16:57:19.000000000 +0200
2 +++ webrtc-20121218svn2718/src/tools/frame_analyzer/video_quality_analysis.h 2021-06-28 22:10:14.646395156 +0200
4 // frames are exactly the same) will be 48. In the case of SSIM the max return
6 double CalculateMetrics(VideoAnalysisMetricsType video_metrics_type,
7 - const uint8* ref_frame, const uint8* test_frame,
8 + const uint8_t* ref_frame, const uint8_t* test_frame,
9 int width, int height);
11 // Function to print the result from the analysis.
14 // Gets the next frame from an open I420 file.
15 bool GetNextI420Frame(FILE* input_file, int width, int height,
16 - uint8* result_frame);
17 + uint8_t* result_frame);
19 // Extracts an I420 frame at position frame_number from the file.
20 bool ExtractFrameFromI420(const char* i420_file_name, int width, int height,
21 - int frame_number, uint8* result_frame);
22 + int frame_number, uint8_t* result_frame);
26 --- webrtc-20121218svn2718/src/tools/frame_analyzer/video_quality_analysis.cc.orig 2012-08-27 16:57:19.000000000 +0200
27 +++ webrtc-20121218svn2718/src/tools/frame_analyzer/video_quality_analysis.cc 2021-06-28 22:10:57.132831653 +0200
31 bool GetNextI420Frame(FILE* input_file, int width, int height,
32 - uint8* result_frame) {
33 + uint8_t* result_frame) {
34 int frame_size = GetI420FrameSize(width, height);
40 bool ExtractFrameFromI420(const char* i420_file_name, int width, int height,
41 - int frame_number, uint8* result_frame) {
42 + int frame_number, uint8_t* result_frame) {
43 int frame_size = GetI420FrameSize(width, height);
44 int offset = frame_number * frame_size; // Calculate offset for the frame.
49 double CalculateMetrics(VideoAnalysisMetricsType video_metrics_type,
50 - const uint8* ref_frame, const uint8* test_frame,
51 + const uint8_t* ref_frame, const uint8_t* test_frame,
52 int width, int height) {
53 if (!ref_frame || !test_frame)
57 int half_width = (width + 1) >> 1;
58 int half_height = (height + 1) >> 1;
59 - const uint8* src_y_a = ref_frame;
60 - const uint8* src_u_a = src_y_a + width * height;
61 - const uint8* src_v_a = src_u_a + half_width * half_height;
62 - const uint8* src_y_b = test_frame;
63 - const uint8* src_u_b = src_y_b + width * height;
64 - const uint8* src_v_b = src_u_b + half_width * half_height;
65 + const uint8_t* src_y_a = ref_frame;
66 + const uint8_t* src_u_a = src_y_a + width * height;
67 + const uint8_t* src_v_a = src_u_a + half_width * half_height;
68 + const uint8_t* src_y_b = test_frame;
69 + const uint8_t* src_u_b = src_y_b + width * height;
70 + const uint8_t* src_v_b = src_u_b + half_width * half_height;
73 int stride_uv = half_width;
75 char line[STATS_LINE_LENGTH];
77 // Allocate buffers for test and reference frames.
78 - uint8* test_frame = new uint8[size];
79 - uint8* reference_frame = new uint8[size];
80 + uint8_t* test_frame = new uint8_t[size];
81 + uint8_t* reference_frame = new uint8_t[size];
82 int previous_frame_number = -1;
84 // While there are entries in the stats file.
85 --- webrtc-20121218svn2718/src/tools/psnr_ssim_analyzer/psnr_ssim_analyzer.cc.orig 2012-08-27 16:57:19.000000000 +0200
86 +++ webrtc-20121218svn2718/src/tools/psnr_ssim_analyzer/psnr_ssim_analyzer.cc 2021-06-29 05:46:46.874665370 +0200
88 int size = webrtc::test::GetI420FrameSize(width, height);
90 // Allocate buffers for test and reference frames.
91 - uint8* test_frame = new uint8[size];
92 - uint8* ref_frame = new uint8[size];
93 + uint8_t* test_frame = new uint8_t[size];
94 + uint8_t* ref_frame = new uint8_t[size];
96 int frame_counter = 0;
98 --- webrtc-20121218svn2718/src/tools/converter/converter.h.orig 2012-08-22 10:12:00.000000000 +0200
99 +++ webrtc-20121218svn2718/src/tools/converter/converter.h 2021-06-29 05:53:42.735745790 +0200
102 // Writes the Y, U and V (in this order) planes to the file, thus adding a
103 // raw YUV frame to the file.
104 - bool AddYUVToFile(uint8* y_plane, int y_plane_size,
105 - uint8* u_plane, int u_plane_size,
106 - uint8* v_plane, int v_plane_size,
107 + bool AddYUVToFile(uint8_t* y_plane, int y_plane_size,
108 + uint8_t* u_plane, int u_plane_size,
109 + uint8_t* v_plane, int v_plane_size,
112 // Adds the Y, U or V plane to the file.
113 - bool AddYUVPlaneToFile(uint8* yuv_plane, int yuv_plane_size, FILE* file);
114 + bool AddYUVPlaneToFile(uint8_t* yuv_plane, int yuv_plane_size, FILE* file);
116 // Reads a RGBA frame from input_file_name with input_frame_size size in bytes
118 --- webrtc-20121218svn2718/src/tools/converter/converter.cc.orig 2012-08-22 10:12:00.000000000 +0200
119 +++ webrtc-20121218svn2718/src/tools/converter/converter.cc 2021-06-29 05:56:59.084682076 +0200
123 int input_frame_size = InputFrameSize();
124 - uint8* rgba_buffer = new uint8[input_frame_size];
125 + uint8_t* rgba_buffer = new uint8_t[input_frame_size];
126 int y_plane_size = YPlaneSize();
127 - uint8* dst_y = new uint8[y_plane_size];
128 + uint8_t* dst_y = new uint8_t[y_plane_size];
129 int u_plane_size = UPlaneSize();
130 - uint8* dst_u = new uint8[u_plane_size];
131 + uint8_t* dst_u = new uint8_t[u_plane_size];
132 int v_plane_size = VPlaneSize();
133 - uint8* dst_v = new uint8[v_plane_size];
134 + uint8_t* dst_v = new uint8_t[v_plane_size];
136 int counter = 0; // Counter to form frame names.
137 bool success = false; // Is conversion successful.
142 -bool Converter::AddYUVToFile(uint8* y_plane, int y_plane_size,
143 - uint8* u_plane, int u_plane_size,
144 - uint8* v_plane, int v_plane_size,
145 +bool Converter::AddYUVToFile(uint8_t* y_plane, int y_plane_size,
146 + uint8_t* u_plane, int u_plane_size,
147 + uint8_t* v_plane, int v_plane_size,
149 bool success = AddYUVPlaneToFile(y_plane, y_plane_size, output_file) &&
150 AddYUVPlaneToFile(u_plane, u_plane_size, output_file) &&
155 -bool Converter::AddYUVPlaneToFile(uint8* yuv_plane, int yuv_plane_size,
156 +bool Converter::AddYUVPlaneToFile(uint8_t* yuv_plane, int yuv_plane_size,
158 size_t bytes_written = fwrite(yuv_plane, 1, yuv_plane_size, file);