OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 config_.hw_encoder = false; | 46 config_.hw_encoder = false; |
47 config_.hw_decoder = false; | 47 config_.hw_decoder = false; |
48 } | 48 } |
49 }; | 49 }; |
50 | 50 |
51 // H264: Run with no packet loss and fixed bitrate. Quality should be very high. | 51 // H264: Run with no packet loss and fixed bitrate. Quality should be very high. |
52 // Note(hbos): The PacketManipulatorImpl code used to simulate packet loss in | 52 // Note(hbos): The PacketManipulatorImpl code used to simulate packet loss in |
53 // these unittests appears to drop "packets" in a way that is not compatible | 53 // these unittests appears to drop "packets" in a way that is not compatible |
54 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have | 54 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have |
55 // not been added. | 55 // not been added. |
56 TEST_F(VideoProcessorIntegrationTestOpenH264, Process0PercentPacketLossH264) { | 56 TEST_F(VideoProcessorIntegrationTestOpenH264, Process0PercentPacketLoss) { |
57 SetCodecSettings(&config_, kVideoCodecH264, 1, false, false, true, false, | 57 SetCodecSettings(&config_, kVideoCodecH264, 1, false, false, true, false, |
58 kResilienceOn, kCifWidth, kCifHeight); | 58 kResilienceOn, kCifWidth, kCifHeight); |
59 | 59 |
60 RateProfile rate_profile; | 60 RateProfile rate_profile; |
61 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 61 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
62 rate_profile.frame_index_rate_update[1] = kNumFrames + 1; | 62 rate_profile.frame_index_rate_update[1] = kNumFrames + 1; |
63 rate_profile.num_frames = kNumFrames; | 63 rate_profile.num_frames = kNumFrames; |
64 | 64 |
65 std::vector<RateControlThresholds> rc_thresholds; | 65 std::vector<RateControlThresholds> rc_thresholds; |
66 AddRateControlThresholds(2, 60, 20, 10, 20, 0, 1, &rc_thresholds); | 66 AddRateControlThresholds(2, 60, 20, 10, 20, 0, 1, &rc_thresholds); |
67 | 67 |
68 QualityThresholds quality_thresholds(35.0, 25.0, 0.93, 0.70); | 68 QualityThresholds quality_thresholds(35.0, 25.0, 0.93, 0.70); |
69 | 69 |
70 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 70 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
71 kNoVisualizationParams); | 71 nullptr, kNoVisualizationParams); |
| 72 } |
| 73 |
| 74 // H264: Enable SingleNalUnit packetization mode. Encoder should split |
| 75 // large frames into multiple slices and limit length of NAL units. |
| 76 TEST_F(VideoProcessorIntegrationTestOpenH264, ProcessNoLossSingleNalUnit) { |
| 77 config_.packetization_mode = H264PacketizationMode::SingleNalUnit; |
| 78 config_.networking_config.max_payload_size_in_bytes = 500; |
| 79 SetCodecSettings(&config_, kVideoCodecH264, 1, false, false, true, false, |
| 80 kResilienceOn, kCifWidth, kCifHeight); |
| 81 |
| 82 RateProfile rate_profile; |
| 83 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 84 rate_profile.frame_index_rate_update[1] = kNumFrames + 1; |
| 85 rate_profile.num_frames = kNumFrames; |
| 86 |
| 87 std::vector<RateControlThresholds> rc_thresholds; |
| 88 AddRateControlThresholds(2, 60, 30, 10, 20, 0, 1, &rc_thresholds); |
| 89 |
| 90 QualityThresholds quality_thresholds(35.0, 25.0, 0.93, 0.70); |
| 91 |
| 92 BitstreamThresholds bs_thresholds( |
| 93 config_.networking_config.max_payload_size_in_bytes); |
| 94 |
| 95 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 96 &bs_thresholds, kNoVisualizationParams); |
72 } | 97 } |
73 | 98 |
74 #endif // defined(WEBRTC_USE_H264) | 99 #endif // defined(WEBRTC_USE_H264) |
75 | 100 |
76 } // namespace test | 101 } // namespace test |
77 } // namespace webrtc | 102 } // namespace webrtc |
OLD | NEW |