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 |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 | 618 |
619 #endif // defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) | 619 #endif // defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) |
620 | 620 |
621 // Fails on iOS. See webrtc:4755. | 621 // Fails on iOS. See webrtc:4755. |
622 #if !defined(WEBRTC_IOS) | 622 #if !defined(WEBRTC_IOS) |
623 | 623 |
624 #if !defined(RTC_DISABLE_VP9) | 624 #if !defined(RTC_DISABLE_VP9) |
625 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. | 625 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. |
626 // One key frame (first frame only) in sequence. Setting |key_frame_interval| | 626 // One key frame (first frame only) in sequence. Setting |key_frame_interval| |
627 // to -1 below means no periodic key frames in test. | 627 // to -1 below means no periodic key frames in test. |
628 | 628 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { |
629 #if defined(THREAD_SANITIZER) || defined(UNDEFINED_SANITIZER) || \ | |
630 (defined(WEBRTC_ARCH_32_BITS) && defined(WEBRTC_LINUX)) | |
631 // Fails on TSan, UBSan and Linux 32-bit: https://bugs.webrtc.org/6781. | |
632 #define MAYBE_Process0PercentPacketLossVP9 DISABLED_Process0PercentPacketLossVP9 | |
633 #else | |
634 #define MAYBE_Process0PercentPacketLossVP9 Process0PercentPacketLossVP9 | |
635 #endif | |
636 TEST_F(VideoProcessorIntegrationTest, MAYBE_Process0PercentPacketLossVP9) { | |
637 // Bitrate and frame rate profile. | 629 // Bitrate and frame rate profile. |
638 RateProfile rate_profile; | 630 RateProfile rate_profile; |
639 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 631 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
640 rate_profile.frame_index_rate_update[1] = kNbrFramesShort + 1; | 632 rate_profile.frame_index_rate_update[1] = kNbrFramesShort + 1; |
641 rate_profile.num_frames = kNbrFramesShort; | 633 rate_profile.num_frames = kNbrFramesShort; |
642 // Codec/network settings. | 634 // Codec/network settings. |
643 CodecConfigPars process_settings; | 635 CodecConfigPars process_settings; |
644 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, | 636 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, |
645 false, true, false); | 637 false, true, false); |
646 // Metrics for expected quality. | 638 // Metrics for expected quality. |
(...skipping 25 matching lines...) Expand all Loading... |
672 RateControlMetrics rc_metrics[1]; | 664 RateControlMetrics rc_metrics[1]; |
673 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); | 665 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); |
674 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 666 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
675 rc_metrics); | 667 rc_metrics); |
676 } | 668 } |
677 | 669 |
678 // VP9: Run with no packet loss, with varying bitrate (3 rate updates): | 670 // VP9: Run with no packet loss, with varying bitrate (3 rate updates): |
679 // low to high to medium. Check that quality and encoder response to the new | 671 // low to high to medium. Check that quality and encoder response to the new |
680 // target rate/per-frame bandwidth (for each rate update) is within limits. | 672 // target rate/per-frame bandwidth (for each rate update) is within limits. |
681 // One key frame (first frame only) in sequence. | 673 // One key frame (first frame only) in sequence. |
682 #if defined(THREAD_SANITIZER) || defined(UNDEFINED_SANITIZER) || \ | 674 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { |
683 (defined(WEBRTC_ARCH_32_BITS) && defined(WEBRTC_LINUX)) | |
684 // Fails on TSan, UBSan and Linux 32-bit: https://bugs.webrtc.org/6781. | |
685 #define MAYBE_ProcessNoLossChangeBitRateVP9 \ | |
686 DISABLED_ProcessNoLossChangeBitRateVP9 | |
687 #else | |
688 #define MAYBE_ProcessNoLossChangeBitRateVP9 ProcessNoLossChangeBitRateVP9 | |
689 #endif | |
690 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP9) { | |
691 // Bitrate and frame rate profile. | 675 // Bitrate and frame rate profile. |
692 RateProfile rate_profile; | 676 RateProfile rate_profile; |
693 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); | 677 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); |
694 SetRateProfilePars(&rate_profile, 1, 700, 30, 100); | 678 SetRateProfilePars(&rate_profile, 1, 700, 30, 100); |
695 SetRateProfilePars(&rate_profile, 2, 500, 30, 200); | 679 SetRateProfilePars(&rate_profile, 2, 500, 30, 200); |
696 rate_profile.frame_index_rate_update[3] = kNbrFramesLong + 1; | 680 rate_profile.frame_index_rate_update[3] = kNbrFramesLong + 1; |
697 rate_profile.num_frames = kNbrFramesLong; | 681 rate_profile.num_frames = kNbrFramesLong; |
698 // Codec/network settings. | 682 // Codec/network settings. |
699 CodecConfigPars process_settings; | 683 CodecConfigPars process_settings; |
700 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, | 684 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, |
(...skipping 11 matching lines...) Expand all Loading... |
712 } | 696 } |
713 | 697 |
714 // VP9: Run with no packet loss, with an update (decrease) in frame rate. | 698 // VP9: Run with no packet loss, with an update (decrease) in frame rate. |
715 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. | 699 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. |
716 // At the low bitrate in this test, this means better rate control after the | 700 // At the low bitrate in this test, this means better rate control after the |
717 // update(s) to lower frame rate. So expect less frame drops, and max values | 701 // update(s) to lower frame rate. So expect less frame drops, and max values |
718 // for the rate control metrics can be lower. One key frame (first frame only). | 702 // for the rate control metrics can be lower. One key frame (first frame only). |
719 // Note: quality after update should be higher but we currently compute quality | 703 // Note: quality after update should be higher but we currently compute quality |
720 // metrics averaged over whole sequence run. | 704 // metrics averaged over whole sequence run. |
721 | 705 |
722 #if defined(WEBRTC_ANDROID) || defined(THREAD_SANITIZER) || \ | 706 #if defined(WEBRTC_ANDROID) |
723 defined(UNDEFINED_SANITIZER) || \ | |
724 (defined(WEBRTC_ARCH_32_BITS) && defined(WEBRTC_LINUX)) | |
725 // Flaky on Android: https://bugs.chromium.org/p/webrtc/issues/detail?id=6057. | 707 // Flaky on Android: https://bugs.chromium.org/p/webrtc/issues/detail?id=6057. |
726 // Fails on TSan, UBSan and Linux 32-bit: https://bugs.webrtc.org/6781. | |
727 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP9 \ | 708 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP9 \ |
728 DISABLED_ProcessNoLossChangeFrameRateFrameDropVP9 | 709 DISABLED_ProcessNoLossChangeFrameRateFrameDropVP9 |
729 #else | 710 #else |
730 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP9 \ | 711 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP9 \ |
731 ProcessNoLossChangeFrameRateFrameDropVP9 | 712 ProcessNoLossChangeFrameRateFrameDropVP9 |
732 #endif | 713 #endif |
733 TEST_F(VideoProcessorIntegrationTest, | 714 TEST_F(VideoProcessorIntegrationTest, |
734 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP9) { | 715 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP9) { |
735 config_.networking_config.packet_loss_probability = 0; | 716 config_.networking_config.packet_loss_probability = 0; |
736 // Bitrate and frame rate profile. | 717 // Bitrate and frame rate profile. |
(...skipping 13 matching lines...) Expand all Loading... |
750 // Metrics for rate control. | 731 // Metrics for rate control. |
751 RateControlMetrics rc_metrics[3]; | 732 RateControlMetrics rc_metrics[3]; |
752 SetRateControlMetrics(rc_metrics, 0, 38, 50, 75, 15, 45, 0, 1); | 733 SetRateControlMetrics(rc_metrics, 0, 38, 50, 75, 15, 45, 0, 1); |
753 SetRateControlMetrics(rc_metrics, 1, 10, 0, 40, 10, 30, 0, 0); | 734 SetRateControlMetrics(rc_metrics, 1, 10, 0, 40, 10, 30, 0, 0); |
754 SetRateControlMetrics(rc_metrics, 2, 5, 0, 30, 5, 20, 0, 0); | 735 SetRateControlMetrics(rc_metrics, 2, 5, 0, 30, 5, 20, 0, 0); |
755 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 736 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
756 rc_metrics); | 737 rc_metrics); |
757 } | 738 } |
758 | 739 |
759 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). | 740 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). |
760 #if defined(THREAD_SANITIZER) || defined(UNDEFINED_SANITIZER) || \ | 741 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { |
761 (defined(WEBRTC_ARCH_32_BITS) && defined(WEBRTC_LINUX)) | |
762 // Fails on TSan, UBSan and Linux 32-bit: https://bugs.webrtc.org/6781. | |
763 #define MAYBE_ProcessNoLossDenoiserOnVP9 DISABLED_ProcessNoLossDenoiserOnVP9 | |
764 #else | |
765 #define MAYBE_ProcessNoLossDenoiserOnVP9 ProcessNoLossDenoiserOnVP9 | |
766 #endif | |
767 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossDenoiserOnVP9) { | |
768 // Bitrate and frame rate profile. | 742 // Bitrate and frame rate profile. |
769 RateProfile rate_profile; | 743 RateProfile rate_profile; |
770 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 744 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
771 rate_profile.frame_index_rate_update[1] = kNbrFramesShort + 1; | 745 rate_profile.frame_index_rate_update[1] = kNbrFramesShort + 1; |
772 rate_profile.num_frames = kNbrFramesShort; | 746 rate_profile.num_frames = kNbrFramesShort; |
773 // Codec/network settings. | 747 // Codec/network settings. |
774 CodecConfigPars process_settings; | 748 CodecConfigPars process_settings; |
775 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, | 749 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, |
776 true, true, false); | 750 true, true, false); |
777 // Metrics for expected quality. | 751 // Metrics for expected quality. |
778 QualityMetrics quality_metrics; | 752 QualityMetrics quality_metrics; |
779 SetQualityMetrics(&quality_metrics, 36.8, 35.8, 0.92, 0.91); | 753 SetQualityMetrics(&quality_metrics, 36.8, 35.8, 0.92, 0.91); |
780 // Metrics for rate control. | 754 // Metrics for rate control. |
781 RateControlMetrics rc_metrics[1]; | 755 RateControlMetrics rc_metrics[1]; |
782 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); | 756 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); |
783 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 757 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
784 rc_metrics); | 758 rc_metrics); |
785 } | 759 } |
786 | 760 |
787 // Run with no packet loss, at low bitrate. | 761 // Run with no packet loss, at low bitrate. |
788 // spatial_resize is on, for this low bitrate expect one resize in sequence. | 762 // spatial_resize is on, for this low bitrate expect one resize in sequence. |
789 // Resize happens on delta frame. Expect only one key frame (first frame). | 763 // Resize happens on delta frame. Expect only one key frame (first frame). |
790 #if defined(THREAD_SANITIZER) || defined(UNDEFINED_SANITIZER) || \ | 764 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossSpatialResizeFrameDropVP9) { |
791 (defined(WEBRTC_ARCH_32_BITS) && defined(WEBRTC_LINUX)) | |
792 // Fails on TSan, UBSan and Linux 32-bit: https://bugs.webrtc.org/6781. | |
793 #define MAYBE_ProcessNoLossSpatialResizeFrameDropVP9 \ | |
794 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9 | |
795 #else | |
796 #define MAYBE_ProcessNoLossSpatialResizeFrameDropVP9 \ | |
797 ProcessNoLossSpatialResizeFrameDropVP9 | |
798 #endif | |
799 TEST_F(VideoProcessorIntegrationTest, | |
800 MAYBE_ProcessNoLossSpatialResizeFrameDropVP9) { | |
801 config_.networking_config.packet_loss_probability = 0; | 765 config_.networking_config.packet_loss_probability = 0; |
802 // Bitrate and frame rate profile. | 766 // Bitrate and frame rate profile. |
803 RateProfile rate_profile; | 767 RateProfile rate_profile; |
804 SetRateProfilePars(&rate_profile, 0, 50, 30, 0); | 768 SetRateProfilePars(&rate_profile, 0, 50, 30, 0); |
805 rate_profile.frame_index_rate_update[1] = kNbrFramesLong + 1; | 769 rate_profile.frame_index_rate_update[1] = kNbrFramesLong + 1; |
806 rate_profile.num_frames = kNbrFramesLong; | 770 rate_profile.num_frames = kNbrFramesLong; |
807 // Codec/network settings. | 771 // Codec/network settings. |
808 CodecConfigPars process_settings; | 772 CodecConfigPars process_settings; |
809 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, | 773 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, |
810 false, true, true); | 774 false, true, true); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 QualityMetrics quality_metrics; | 969 QualityMetrics quality_metrics; |
1006 SetQualityMetrics(&quality_metrics, 32.5, 30.0, 0.85, 0.80); | 970 SetQualityMetrics(&quality_metrics, 32.5, 30.0, 0.85, 0.80); |
1007 // Metrics for rate control. | 971 // Metrics for rate control. |
1008 RateControlMetrics rc_metrics[2]; | 972 RateControlMetrics rc_metrics[2]; |
1009 SetRateControlMetrics(rc_metrics, 0, 0, 20, 30, 10, 10, 0, 1); | 973 SetRateControlMetrics(rc_metrics, 0, 0, 20, 30, 10, 10, 0, 1); |
1010 SetRateControlMetrics(rc_metrics, 1, 0, 0, 30, 15, 10, 0, 0); | 974 SetRateControlMetrics(rc_metrics, 1, 0, 0, 30, 15, 10, 0, 0); |
1011 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 975 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
1012 rc_metrics); | 976 rc_metrics); |
1013 } | 977 } |
1014 } // namespace webrtc | 978 } // namespace webrtc |
OLD | NEW |