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

Side by Side Diff: webrtc/video/video_quality_test.cc

Issue 2286633002: Delete IsZeroSize method. (Closed)
Patch Set: Created 4 years, 3 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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>
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 test_label_.c_str(), dropped_frames_before_first_encode_); 599 test_label_.c_str(), dropped_frames_before_first_encode_);
600 printf("RESULT dropped_frames_before_rendering: %s = %d frames\n", 600 printf("RESULT dropped_frames_before_rendering: %s = %d frames\n",
601 test_label_.c_str(), dropped_frames_before_rendering_); 601 test_label_.c_str(), dropped_frames_before_rendering_);
602 602
603 EXPECT_GT(psnr_.Mean(), avg_psnr_threshold_); 603 EXPECT_GT(psnr_.Mean(), avg_psnr_threshold_);
604 EXPECT_GT(ssim_.Mean(), avg_ssim_threshold_); 604 EXPECT_GT(ssim_.Mean(), avg_ssim_threshold_);
605 } 605 }
606 606
607 void PerformFrameComparison(const FrameComparison& comparison) { 607 void PerformFrameComparison(const FrameComparison& comparison) {
608 // Perform expensive psnr and ssim calculations while not holding lock. 608 // Perform expensive psnr and ssim calculations while not holding lock.
609 double psnr = -1.0; 609 double psnr = I420PSNR(&comparison.reference, &comparison.render);
610 double ssim = -1.0; 610 double ssim = I420SSIM(&comparison.reference, &comparison.render);
611 if (!comparison.reference.IsZeroSize()) {
stefan-webrtc 2016/09/05 14:45:25 I'm pretty sure this was needed when I added this
612 psnr = I420PSNR(&comparison.reference, &comparison.render);
613 ssim = I420SSIM(&comparison.reference, &comparison.render);
614 }
615 611
616 int64_t input_time_ms = comparison.reference.ntp_time_ms(); 612 int64_t input_time_ms = comparison.reference.ntp_time_ms();
617 613
618 rtc::CritScope crit(&comparison_lock_); 614 rtc::CritScope crit(&comparison_lock_);
619 if (graph_data_output_file_) { 615 if (graph_data_output_file_) {
620 samples_.push_back( 616 samples_.push_back(
621 Sample(comparison.dropped, input_time_ms, comparison.send_time_ms, 617 Sample(comparison.dropped, input_time_ms, comparison.send_time_ms,
622 comparison.recv_time_ms, comparison.render_time_ms, 618 comparison.recv_time_ms, comparison.render_time_ms,
623 comparison.encoded_frame_size, psnr, ssim)); 619 comparison.encoded_frame_size, psnr, ssim));
624 } 620 }
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 call->DestroyAudioSendStream(audio_send_stream_); 1297 call->DestroyAudioSendStream(audio_send_stream_);
1302 call->DestroyAudioReceiveStream(audio_receive_stream); 1298 call->DestroyAudioReceiveStream(audio_receive_stream);
1303 } 1299 }
1304 1300
1305 transport.StopSending(); 1301 transport.StopSending();
1306 if (params_.audio) 1302 if (params_.audio)
1307 DestroyVoiceEngine(&voe); 1303 DestroyVoiceEngine(&voe);
1308 } 1304 }
1309 1305
1310 } // namespace webrtc 1306 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698