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

Side by Side Diff: webrtc/modules/video_processing/test/video_processing_unittest.cc

Issue 2397943003: Revert of Delete webrtc::VideoFrame::CopyFrame. (Closed)
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 VideoFrame* out_frame = NULL; 243 VideoFrame* out_frame = NULL;
244 vpm->SetInputFrameResampleMode(kBox); 244 vpm->SetInputFrameResampleMode(kBox);
245 PreprocessFrameAndVerify(source_frame, target_width, target_height, vpm, 245 PreprocessFrameAndVerify(source_frame, target_width, target_height, vpm,
246 out_frame); 246 out_frame);
247 if (out_frame == NULL) 247 if (out_frame == NULL)
248 return; 248 return;
249 WriteProcessedFrameForVisualInspection(source_frame, *out_frame); 249 WriteProcessedFrameForVisualInspection(source_frame, *out_frame);
250 250
251 // Scale |resampled_source_frame| back to the source scale. 251 // Scale |resampled_source_frame| back to the source scale.
252 VideoFrame resampled_source_frame; 252 VideoFrame resampled_source_frame;
253 resampled_source_frame.ShallowCopy(*out_frame); 253 resampled_source_frame.CopyFrame(*out_frame);
254 // Compute PSNR against the cropped source frame and check expectation. 254 // Compute PSNR against the cropped source frame and check expectation.
255 PreprocessFrameAndVerify(resampled_source_frame, 255 PreprocessFrameAndVerify(resampled_source_frame, cropped_source.width(),
256 cropped_source.width(),
257 cropped_source.height(), vpm, out_frame); 256 cropped_source.height(), vpm, out_frame);
258 WriteProcessedFrameForVisualInspection(resampled_source_frame, *out_frame); 257 WriteProcessedFrameForVisualInspection(resampled_source_frame, *out_frame);
259 258
260 // Compute PSNR against the cropped source frame and check expectation. 259 // Compute PSNR against the cropped source frame and check expectation.
261 double psnr = 260 double psnr =
262 I420PSNR(cropped_source, *out_frame->video_frame_buffer()); 261 I420PSNR(cropped_source, *out_frame->video_frame_buffer());
263 EXPECT_GT(psnr, expected_psnr); 262 EXPECT_GT(psnr, expected_psnr);
264 printf( 263 printf(
265 "PSNR: %f. PSNR is between source of size %d %d, and a modified " 264 "PSNR: %f. PSNR is between source of size %d %d, and a modified "
266 "source which is scaled down/up to: %d %d, and back to source size \n", 265 "source which is scaled down/up to: %d %d, and back to source size \n",
(...skipping 14 matching lines...) Expand all
281 std::cout << "Watch " << filename.str() << " and verify that it is okay." 280 std::cout << "Watch " << filename.str() << " and verify that it is okay."
282 << std::endl; 281 << std::endl;
283 FILE* stand_alone_file = fopen(filename.str().c_str(), "wb"); 282 FILE* stand_alone_file = fopen(filename.str().c_str(), "wb");
284 if (PrintVideoFrame(processed, stand_alone_file) < 0) 283 if (PrintVideoFrame(processed, stand_alone_file) < 0)
285 std::cerr << "Failed to write: " << filename.str() << std::endl; 284 std::cerr << "Failed to write: " << filename.str() << std::endl;
286 if (stand_alone_file) 285 if (stand_alone_file)
287 fclose(stand_alone_file); 286 fclose(stand_alone_file);
288 } 287 }
289 288
290 } // namespace webrtc 289 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc ('k') | webrtc/video/video_quality_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698