| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // not been added. | 42 // not been added. |
| 43 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { | 43 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { |
| 44 // Bit rate and frame rate profile. | 44 // Bit rate and frame rate profile. |
| 45 RateProfile rate_profile; | 45 RateProfile rate_profile; |
| 46 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 46 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 47 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 47 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 48 rate_profile.num_frames = kNumFramesShort; | 48 rate_profile.num_frames = kNumFramesShort; |
| 49 // Codec/network settings. | 49 // Codec/network settings. |
| 50 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 50 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 51 kVerboseLogging, kBatchMode); | 51 kVerboseLogging, kBatchMode); |
| 52 SetCodecSettings(&config_, &codec_settings_, kVideoCodecH264, 1, false, false, | 52 SetCodecSettings(&config_, kVideoCodecH264, 1, false, false, true, false, |
| 53 true, false, kResilienceOn, kCifWidth, kCifHeight); | 53 kResilienceOn, kCifWidth, kCifHeight); |
| 54 // Thresholds for expected quality. | 54 // Thresholds for expected quality. |
| 55 QualityThresholds quality_thresholds(35.0, 25.0, 0.93, 0.70); | 55 QualityThresholds quality_thresholds(35.0, 25.0, 0.93, 0.70); |
| 56 // Thresholds for rate control. | 56 // Thresholds for rate control. |
| 57 RateControlThresholds rc_thresholds[1]; | 57 RateControlThresholds rc_thresholds[1]; |
| 58 SetRateControlThresholds(rc_thresholds, 0, 2, 60, 20, 10, 20, 0, 1); | 58 SetRateControlThresholds(rc_thresholds, 0, 2, 60, 20, 10, 20, 0, 1); |
| 59 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 59 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 60 nullptr /* visualization_params */); | 60 nullptr /* visualization_params */); |
| 61 } | 61 } |
| 62 | 62 |
| 63 #endif // defined(WEBRTC_USE_H264) | 63 #endif // defined(WEBRTC_USE_H264) |
| 64 | 64 |
| 65 // Fails on iOS. See webrtc:4755. | 65 // Fails on iOS. See webrtc:4755. |
| 66 #if !defined(WEBRTC_IOS) | 66 #if !defined(WEBRTC_IOS) |
| 67 | 67 |
| 68 #if !defined(RTC_DISABLE_VP9) | 68 #if !defined(RTC_DISABLE_VP9) |
| 69 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. | 69 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. |
| 70 // One key frame (first frame only) in sequence. Setting |key_frame_interval| | 70 // One key frame (first frame only) in sequence. Setting |key_frame_interval| |
| 71 // to -1 below means no periodic key frames in test. | 71 // to -1 below means no periodic key frames in test. |
| 72 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { | 72 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { |
| 73 // Bit rate and frame rate profile. | 73 // Bit rate and frame rate profile. |
| 74 RateProfile rate_profile; | 74 RateProfile rate_profile; |
| 75 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 75 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 76 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 76 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 77 rate_profile.num_frames = kNumFramesShort; | 77 rate_profile.num_frames = kNumFramesShort; |
| 78 // Codec/network settings. | 78 // Codec/network settings. |
| 79 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 79 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 80 kVerboseLogging, kBatchMode); | 80 kVerboseLogging, kBatchMode); |
| 81 SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP9, 1, false, false, | 81 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
| 82 true, false, kResilienceOn, kCifWidth, kCifHeight); | 82 kResilienceOn, kCifWidth, kCifHeight); |
| 83 // Thresholds for expected quality. | 83 // Thresholds for expected quality. |
| 84 QualityThresholds quality_thresholds(37.0, 36.0, 0.93, 0.92); | 84 QualityThresholds quality_thresholds(37.0, 36.0, 0.93, 0.92); |
| 85 // Thresholds for rate control. | 85 // Thresholds for rate control. |
| 86 RateControlThresholds rc_thresholds[1]; | 86 RateControlThresholds rc_thresholds[1]; |
| 87 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1); | 87 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1); |
| 88 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 88 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 89 nullptr /* visualization_params */); | 89 nullptr /* visualization_params */); |
| 90 } | 90 } |
| 91 | 91 |
| 92 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit | 92 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit |
| 93 // lower. One key frame (first frame only) in sequence. | 93 // lower. One key frame (first frame only) in sequence. |
| 94 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { | 94 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { |
| 95 // Bit rate and frame rate profile. | 95 // Bit rate and frame rate profile. |
| 96 RateProfile rate_profile; | 96 RateProfile rate_profile; |
| 97 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 97 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 98 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 98 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 99 rate_profile.num_frames = kNumFramesShort; | 99 rate_profile.num_frames = kNumFramesShort; |
| 100 // Codec/network settings. | 100 // Codec/network settings. |
| 101 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.05f, -1, kForemanCif, | 101 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.05f, -1, kForemanCif, |
| 102 kVerboseLogging, kBatchMode); | 102 kVerboseLogging, kBatchMode); |
| 103 SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP9, 1, false, false, | 103 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
| 104 true, false, kResilienceOn, kCifWidth, kCifHeight); | 104 kResilienceOn, kCifWidth, kCifHeight); |
| 105 // Thresholds for expected quality. | 105 // Thresholds for expected quality. |
| 106 QualityThresholds quality_thresholds(17.0, 14.0, 0.45, 0.36); | 106 QualityThresholds quality_thresholds(17.0, 14.0, 0.45, 0.36); |
| 107 // Thresholds for rate control. | 107 // Thresholds for rate control. |
| 108 RateControlThresholds rc_thresholds[1]; | 108 RateControlThresholds rc_thresholds[1]; |
| 109 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1); | 109 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1); |
| 110 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 110 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 111 nullptr /* visualization_params */); | 111 nullptr /* visualization_params */); |
| 112 } | 112 } |
| 113 | 113 |
| 114 // VP9: Run with no packet loss, with varying bitrate (3 rate updates): | 114 // VP9: Run with no packet loss, with varying bitrate (3 rate updates): |
| 115 // low to high to medium. Check that quality and encoder response to the new | 115 // low to high to medium. Check that quality and encoder response to the new |
| 116 // target rate/per-frame bandwidth (for each rate update) is within limits. | 116 // target rate/per-frame bandwidth (for each rate update) is within limits. |
| 117 // One key frame (first frame only) in sequence. | 117 // One key frame (first frame only) in sequence. |
| 118 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { | 118 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { |
| 119 // Bit rate and frame rate profile. | 119 // Bit rate and frame rate profile. |
| 120 RateProfile rate_profile; | 120 RateProfile rate_profile; |
| 121 SetRateProfile(&rate_profile, 0, 200, 30, 0); | 121 SetRateProfile(&rate_profile, 0, 200, 30, 0); |
| 122 SetRateProfile(&rate_profile, 1, 700, 30, 100); | 122 SetRateProfile(&rate_profile, 1, 700, 30, 100); |
| 123 SetRateProfile(&rate_profile, 2, 500, 30, 200); | 123 SetRateProfile(&rate_profile, 2, 500, 30, 200); |
| 124 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 124 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
| 125 rate_profile.num_frames = kNumFramesLong; | 125 rate_profile.num_frames = kNumFramesLong; |
| 126 // Codec/network settings. | 126 // Codec/network settings. |
| 127 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 127 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 128 kVerboseLogging, kBatchMode); | 128 kVerboseLogging, kBatchMode); |
| 129 SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP9, 1, false, false, | 129 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
| 130 true, false, kResilienceOn, kCifWidth, kCifHeight); | 130 kResilienceOn, kCifWidth, kCifHeight); |
| 131 // Thresholds for expected quality. | 131 // Thresholds for expected quality. |
| 132 QualityThresholds quality_thresholds(35.5, 30.0, 0.90, 0.85); | 132 QualityThresholds quality_thresholds(35.5, 30.0, 0.90, 0.85); |
| 133 // Thresholds for rate control. | 133 // Thresholds for rate control. |
| 134 RateControlThresholds rc_thresholds[3]; | 134 RateControlThresholds rc_thresholds[3]; |
| 135 SetRateControlThresholds(rc_thresholds, 0, 0, 30, 20, 20, 35, 0, 1); | 135 SetRateControlThresholds(rc_thresholds, 0, 0, 30, 20, 20, 35, 0, 1); |
| 136 SetRateControlThresholds(rc_thresholds, 1, 2, 0, 20, 20, 60, 0, 0); | 136 SetRateControlThresholds(rc_thresholds, 1, 2, 0, 20, 20, 60, 0, 0); |
| 137 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 25, 20, 40, 0, 0); | 137 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 25, 20, 40, 0, 0); |
| 138 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 138 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 139 nullptr /* visualization_params */); | 139 nullptr /* visualization_params */); |
| 140 } | 140 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 152 // Bit rate and frame rate profile. | 152 // Bit rate and frame rate profile. |
| 153 RateProfile rate_profile; | 153 RateProfile rate_profile; |
| 154 SetRateProfile(&rate_profile, 0, 100, 24, 0); | 154 SetRateProfile(&rate_profile, 0, 100, 24, 0); |
| 155 SetRateProfile(&rate_profile, 1, 100, 15, 100); | 155 SetRateProfile(&rate_profile, 1, 100, 15, 100); |
| 156 SetRateProfile(&rate_profile, 2, 100, 10, 200); | 156 SetRateProfile(&rate_profile, 2, 100, 10, 200); |
| 157 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 157 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
| 158 rate_profile.num_frames = kNumFramesLong; | 158 rate_profile.num_frames = kNumFramesLong; |
| 159 // Codec/network settings. | 159 // Codec/network settings. |
| 160 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 160 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 161 kVerboseLogging, kBatchMode); | 161 kVerboseLogging, kBatchMode); |
| 162 SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP9, 1, false, false, | 162 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
| 163 true, false, kResilienceOn, kCifWidth, kCifHeight); | 163 kResilienceOn, kCifWidth, kCifHeight); |
| 164 // Thresholds for expected quality. | 164 // Thresholds for expected quality. |
| 165 QualityThresholds quality_thresholds(31.5, 18.0, 0.80, 0.43); | 165 QualityThresholds quality_thresholds(31.5, 18.0, 0.80, 0.43); |
| 166 // Thresholds for rate control. | 166 // Thresholds for rate control. |
| 167 RateControlThresholds rc_thresholds[3]; | 167 RateControlThresholds rc_thresholds[3]; |
| 168 SetRateControlThresholds(rc_thresholds, 0, 45, 50, 95, 15, 45, 0, 1); | 168 SetRateControlThresholds(rc_thresholds, 0, 45, 50, 95, 15, 45, 0, 1); |
| 169 SetRateControlThresholds(rc_thresholds, 1, 20, 0, 50, 10, 30, 0, 0); | 169 SetRateControlThresholds(rc_thresholds, 1, 20, 0, 50, 10, 30, 0, 0); |
| 170 SetRateControlThresholds(rc_thresholds, 2, 5, 0, 30, 5, 25, 0, 0); | 170 SetRateControlThresholds(rc_thresholds, 2, 5, 0, 30, 5, 25, 0, 0); |
| 171 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 171 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 172 nullptr /* visualization_params */); | 172 nullptr /* visualization_params */); |
| 173 } | 173 } |
| 174 | 174 |
| 175 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). | 175 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). |
| 176 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { | 176 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { |
| 177 // Bit rate and frame rate profile. | 177 // Bit rate and frame rate profile. |
| 178 RateProfile rate_profile; | 178 RateProfile rate_profile; |
| 179 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 179 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 180 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 180 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 181 rate_profile.num_frames = kNumFramesShort; | 181 rate_profile.num_frames = kNumFramesShort; |
| 182 // Codec/network settings. | 182 // Codec/network settings. |
| 183 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 183 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 184 kVerboseLogging, kBatchMode); | 184 kVerboseLogging, kBatchMode); |
| 185 SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP9, 1, false, true, | 185 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, true, true, false, |
| 186 true, false, kResilienceOn, kCifWidth, kCifHeight); | 186 kResilienceOn, kCifWidth, kCifHeight); |
| 187 // Thresholds for expected quality. | 187 // Thresholds for expected quality. |
| 188 QualityThresholds quality_thresholds(36.8, 35.8, 0.92, 0.91); | 188 QualityThresholds quality_thresholds(36.8, 35.8, 0.92, 0.91); |
| 189 // Thresholds for rate control. | 189 // Thresholds for rate control. |
| 190 RateControlThresholds rc_thresholds[1]; | 190 RateControlThresholds rc_thresholds[1]; |
| 191 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1); | 191 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1); |
| 192 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 192 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 193 nullptr /* visualization_params */); | 193 nullptr /* visualization_params */); |
| 194 } | 194 } |
| 195 | 195 |
| 196 // Run with no packet loss, at low bitrate. | 196 // Run with no packet loss, at low bitrate. |
| 197 // spatial_resize is on, for this low bitrate expect one resize in sequence. | 197 // spatial_resize is on, for this low bitrate expect one resize in sequence. |
| 198 // Resize happens on delta frame. Expect only one key frame (first frame). | 198 // Resize happens on delta frame. Expect only one key frame (first frame). |
| 199 TEST_F(VideoProcessorIntegrationTest, | 199 TEST_F(VideoProcessorIntegrationTest, |
| 200 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { | 200 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { |
| 201 config_.networking_config.packet_loss_probability = 0; | 201 config_.networking_config.packet_loss_probability = 0; |
| 202 // Bit rate and frame rate profile. | 202 // Bit rate and frame rate profile. |
| 203 RateProfile rate_profile; | 203 RateProfile rate_profile; |
| 204 SetRateProfile(&rate_profile, 0, 50, 30, 0); | 204 SetRateProfile(&rate_profile, 0, 50, 30, 0); |
| 205 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; | 205 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; |
| 206 rate_profile.num_frames = kNumFramesLong; | 206 rate_profile.num_frames = kNumFramesLong; |
| 207 // Codec/network settings. | 207 // Codec/network settings. |
| 208 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 208 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 209 kVerboseLogging, kBatchMode); | 209 kVerboseLogging, kBatchMode); |
| 210 SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP9, 1, false, false, | 210 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, true, |
| 211 true, true, kResilienceOn, kCifWidth, kCifHeight); | 211 kResilienceOn, kCifWidth, kCifHeight); |
| 212 // Thresholds for expected quality. | 212 // Thresholds for expected quality. |
| 213 QualityThresholds quality_thresholds(24.0, 13.0, 0.65, 0.37); | 213 QualityThresholds quality_thresholds(24.0, 13.0, 0.65, 0.37); |
| 214 // Thresholds for rate control. | 214 // Thresholds for rate control. |
| 215 RateControlThresholds rc_thresholds[1]; | 215 RateControlThresholds rc_thresholds[1]; |
| 216 SetRateControlThresholds(rc_thresholds, 0, 228, 70, 160, 15, 80, 1, 1); | 216 SetRateControlThresholds(rc_thresholds, 0, 228, 70, 160, 15, 80, 1, 1); |
| 217 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 217 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 218 nullptr /* visualization_params */); | 218 nullptr /* visualization_params */); |
| 219 } | 219 } |
| 220 | 220 |
| 221 // TODO(marpan): Add temporal layer test for VP9, once changes are in | 221 // TODO(marpan): Add temporal layer test for VP9, once changes are in |
| 222 // vp9 wrapper for this. | 222 // vp9 wrapper for this. |
| 223 | 223 |
| 224 #endif // !defined(RTC_DISABLE_VP9) | 224 #endif // !defined(RTC_DISABLE_VP9) |
| 225 | 225 |
| 226 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high. | 226 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high. |
| 227 // One key frame (first frame only) in sequence. Setting |key_frame_interval| | 227 // One key frame (first frame only) in sequence. Setting |key_frame_interval| |
| 228 // to -1 below means no periodic key frames in test. | 228 // to -1 below means no periodic key frames in test. |
| 229 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { | 229 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { |
| 230 // Bit rate and frame rate profile. | 230 // Bit rate and frame rate profile. |
| 231 RateProfile rate_profile; | 231 RateProfile rate_profile; |
| 232 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 232 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 233 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 233 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 234 rate_profile.num_frames = kNumFramesShort; | 234 rate_profile.num_frames = kNumFramesShort; |
| 235 // Codec/network settings. | 235 // Codec/network settings. |
| 236 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 236 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 237 kVerboseLogging, kBatchMode); | 237 kVerboseLogging, kBatchMode); |
| 238 SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP8, 1, false, true, | 238 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 239 true, false, kResilienceOn, kCifWidth, kCifHeight); | 239 kResilienceOn, kCifWidth, kCifHeight); |
| 240 // Thresholds for expected quality. | 240 // Thresholds for expected quality. |
| 241 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89); | 241 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89); |
| 242 // Thresholds for rate control. | 242 // Thresholds for rate control. |
| 243 RateControlThresholds rc_thresholds[1]; | 243 RateControlThresholds rc_thresholds[1]; |
| 244 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); | 244 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); |
| 245 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 245 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 246 nullptr /* visualization_params */); | 246 nullptr /* visualization_params */); |
| 247 } | 247 } |
| 248 | 248 |
| 249 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit | 249 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit |
| 250 // lower. One key frame (first frame only) in sequence. | 250 // lower. One key frame (first frame only) in sequence. |
| 251 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { | 251 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { |
| 252 // Bit rate and frame rate profile. | 252 // Bit rate and frame rate profile. |
| 253 RateProfile rate_profile; | 253 RateProfile rate_profile; |
| 254 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 254 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 255 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 255 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 256 rate_profile.num_frames = kNumFramesShort; | 256 rate_profile.num_frames = kNumFramesShort; |
| 257 // Codec/network settings. | 257 // Codec/network settings. |
| 258 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.05f, -1, kForemanCif, | 258 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.05f, -1, kForemanCif, |
| 259 kVerboseLogging, kBatchMode); | 259 kVerboseLogging, kBatchMode); |
| 260 SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP8, 1, false, true, | 260 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 261 true, false, kResilienceOn, kCifWidth, kCifHeight); | 261 kResilienceOn, kCifWidth, kCifHeight); |
| 262 // Thresholds for expected quality. | 262 // Thresholds for expected quality. |
| 263 QualityThresholds quality_thresholds(20.0, 16.0, 0.60, 0.40); | 263 QualityThresholds quality_thresholds(20.0, 16.0, 0.60, 0.40); |
| 264 // Thresholds for rate control. | 264 // Thresholds for rate control. |
| 265 RateControlThresholds rc_thresholds[1]; | 265 RateControlThresholds rc_thresholds[1]; |
| 266 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); | 266 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); |
| 267 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 267 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 268 nullptr /* visualization_params */); | 268 nullptr /* visualization_params */); |
| 269 } | 269 } |
| 270 | 270 |
| 271 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. | 271 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. |
| 272 // One key frame (first frame only) in sequence. | 272 // One key frame (first frame only) in sequence. |
| 273 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { | 273 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { |
| 274 // Bit rate and frame rate profile. | 274 // Bit rate and frame rate profile. |
| 275 RateProfile rate_profile; | 275 RateProfile rate_profile; |
| 276 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 276 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 277 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 277 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 278 rate_profile.num_frames = kNumFramesShort; | 278 rate_profile.num_frames = kNumFramesShort; |
| 279 // Codec/network settings. | 279 // Codec/network settings. |
| 280 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.1f, -1, kForemanCif, | 280 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.1f, -1, kForemanCif, |
| 281 kVerboseLogging, kBatchMode); | 281 kVerboseLogging, kBatchMode); |
| 282 SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP8, 1, false, true, | 282 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 283 true, false, kResilienceOn, kCifWidth, kCifHeight); | 283 kResilienceOn, kCifWidth, kCifHeight); |
| 284 // Thresholds for expected quality. | 284 // Thresholds for expected quality. |
| 285 QualityThresholds quality_thresholds(19.0, 16.0, 0.50, 0.35); | 285 QualityThresholds quality_thresholds(19.0, 16.0, 0.50, 0.35); |
| 286 // Thresholds for rate control. | 286 // Thresholds for rate control. |
| 287 RateControlThresholds rc_thresholds[1]; | 287 RateControlThresholds rc_thresholds[1]; |
| 288 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); | 288 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); |
| 289 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 289 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 290 nullptr /* visualization_params */); | 290 nullptr /* visualization_params */); |
| 291 } | 291 } |
| 292 | 292 |
| 293 // This test is identical to VideoProcessorIntegrationTest.ProcessZeroPacketLoss | 293 // This test is identical to VideoProcessorIntegrationTest.ProcessZeroPacketLoss |
| 294 // except that |batch_mode| is turned on. The main point of this test is to see | 294 // except that |batch_mode| is turned on. The main point of this test is to see |
| 295 // that the reported stats are not wildly varying between batch mode and the | 295 // that the reported stats are not wildly varying between batch mode and the |
| 296 // regular online mode. | 296 // regular online mode. |
| 297 TEST_F(VideoProcessorIntegrationTest, ProcessInBatchMode) { | 297 TEST_F(VideoProcessorIntegrationTest, ProcessInBatchMode) { |
| 298 // Bit rate and frame rate profile. | 298 // Bit rate and frame rate profile. |
| 299 RateProfile rate_profile; | 299 RateProfile rate_profile; |
| 300 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 300 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 301 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 301 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 302 rate_profile.num_frames = kNumFramesShort; | 302 rate_profile.num_frames = kNumFramesShort; |
| 303 // Codec/network settings. | 303 // Codec/network settings. |
| 304 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 304 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 305 kVerboseLogging, true /* batch_mode */); | 305 kVerboseLogging, true /* batch_mode */); |
| 306 SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP8, 1, false, true, | 306 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 307 true, false, kResilienceOn, kCifWidth, kCifHeight); | 307 kResilienceOn, kCifWidth, kCifHeight); |
| 308 // Thresholds for expected quality. | 308 // Thresholds for expected quality. |
| 309 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89); | 309 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89); |
| 310 // Thresholds for rate control. | 310 // Thresholds for rate control. |
| 311 RateControlThresholds rc_thresholds[1]; | 311 RateControlThresholds rc_thresholds[1]; |
| 312 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); | 312 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); |
| 313 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 313 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 314 nullptr /* visualization_params */); | 314 nullptr /* visualization_params */); |
| 315 } | 315 } |
| 316 | 316 |
| 317 #endif // !defined(WEBRTC_IOS) | 317 #endif // !defined(WEBRTC_IOS) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 340 // Bit rate and frame rate profile. | 340 // Bit rate and frame rate profile. |
| 341 RateProfile rate_profile; | 341 RateProfile rate_profile; |
| 342 SetRateProfile(&rate_profile, 0, 200, 30, 0); | 342 SetRateProfile(&rate_profile, 0, 200, 30, 0); |
| 343 SetRateProfile(&rate_profile, 1, 800, 30, 100); | 343 SetRateProfile(&rate_profile, 1, 800, 30, 100); |
| 344 SetRateProfile(&rate_profile, 2, 500, 30, 200); | 344 SetRateProfile(&rate_profile, 2, 500, 30, 200); |
| 345 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 345 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
| 346 rate_profile.num_frames = kNumFramesLong; | 346 rate_profile.num_frames = kNumFramesLong; |
| 347 // Codec/network settings. | 347 // Codec/network settings. |
| 348 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 348 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 349 kVerboseLogging, kBatchMode); | 349 kVerboseLogging, kBatchMode); |
| 350 SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP8, 1, false, true, | 350 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 351 true, false, kResilienceOn, kCifWidth, kCifHeight); | 351 kResilienceOn, kCifWidth, kCifHeight); |
| 352 // Thresholds for expected quality. | 352 // Thresholds for expected quality. |
| 353 QualityThresholds quality_thresholds(34.0, 32.0, 0.85, 0.80); | 353 QualityThresholds quality_thresholds(34.0, 32.0, 0.85, 0.80); |
| 354 // Thresholds for rate control. | 354 // Thresholds for rate control. |
| 355 RateControlThresholds rc_thresholds[3]; | 355 RateControlThresholds rc_thresholds[3]; |
| 356 SetRateControlThresholds(rc_thresholds, 0, 0, 45, 20, 10, 15, 0, 1); | 356 SetRateControlThresholds(rc_thresholds, 0, 0, 45, 20, 10, 15, 0, 1); |
| 357 SetRateControlThresholds(rc_thresholds, 1, 0, 0, 25, 20, 10, 0, 0); | 357 SetRateControlThresholds(rc_thresholds, 1, 0, 0, 25, 20, 10, 0, 0); |
| 358 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 25, 15, 10, 0, 0); | 358 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 25, 15, 10, 0, 0); |
| 359 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 359 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 360 nullptr /* visualization_params */); | 360 nullptr /* visualization_params */); |
| 361 } | 361 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 381 // Bit rate and frame rate profile. | 381 // Bit rate and frame rate profile. |
| 382 RateProfile rate_profile; | 382 RateProfile rate_profile; |
| 383 SetRateProfile(&rate_profile, 0, 80, 24, 0); | 383 SetRateProfile(&rate_profile, 0, 80, 24, 0); |
| 384 SetRateProfile(&rate_profile, 1, 80, 15, 100); | 384 SetRateProfile(&rate_profile, 1, 80, 15, 100); |
| 385 SetRateProfile(&rate_profile, 2, 80, 10, 200); | 385 SetRateProfile(&rate_profile, 2, 80, 10, 200); |
| 386 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 386 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
| 387 rate_profile.num_frames = kNumFramesLong; | 387 rate_profile.num_frames = kNumFramesLong; |
| 388 // Codec/network settings. | 388 // Codec/network settings. |
| 389 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 389 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 390 kVerboseLogging, kBatchMode); | 390 kVerboseLogging, kBatchMode); |
| 391 SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP8, 1, false, true, | 391 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 392 true, false, kResilienceOn, kCifWidth, kCifHeight); | 392 kResilienceOn, kCifWidth, kCifHeight); |
| 393 // Thresholds for expected quality. | 393 // Thresholds for expected quality. |
| 394 QualityThresholds quality_thresholds(31.0, 22.0, 0.80, 0.65); | 394 QualityThresholds quality_thresholds(31.0, 22.0, 0.80, 0.65); |
| 395 // Thresholds for rate control. | 395 // Thresholds for rate control. |
| 396 RateControlThresholds rc_thresholds[3]; | 396 RateControlThresholds rc_thresholds[3]; |
| 397 SetRateControlThresholds(rc_thresholds, 0, 40, 20, 75, 15, 60, 0, 1); | 397 SetRateControlThresholds(rc_thresholds, 0, 40, 20, 75, 15, 60, 0, 1); |
| 398 SetRateControlThresholds(rc_thresholds, 1, 10, 0, 25, 10, 35, 0, 0); | 398 SetRateControlThresholds(rc_thresholds, 1, 10, 0, 25, 10, 35, 0, 0); |
| 399 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 20, 10, 15, 0, 0); | 399 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 20, 10, 15, 0, 0); |
| 400 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 400 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 401 nullptr /* visualization_params */); | 401 nullptr /* visualization_params */); |
| 402 } | 402 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 417 config_.networking_config.packet_loss_probability = 0; | 417 config_.networking_config.packet_loss_probability = 0; |
| 418 // Bit rate and frame rate profile. | 418 // Bit rate and frame rate profile. |
| 419 RateProfile rate_profile; | 419 RateProfile rate_profile; |
| 420 SetRateProfile(&rate_profile, 0, 200, 30, 0); | 420 SetRateProfile(&rate_profile, 0, 200, 30, 0); |
| 421 SetRateProfile(&rate_profile, 1, 400, 30, 150); | 421 SetRateProfile(&rate_profile, 1, 400, 30, 150); |
| 422 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; | 422 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; |
| 423 rate_profile.num_frames = kNumFramesLong; | 423 rate_profile.num_frames = kNumFramesLong; |
| 424 // Codec/network settings. | 424 // Codec/network settings. |
| 425 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 425 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 426 kVerboseLogging, kBatchMode); | 426 kVerboseLogging, kBatchMode); |
| 427 SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP8, 3, false, true, | 427 SetCodecSettings(&config_, kVideoCodecVP8, 3, false, true, true, false, |
| 428 true, false, kResilienceOn, kCifWidth, kCifHeight); | 428 kResilienceOn, kCifWidth, kCifHeight); |
| 429 // Thresholds for expected quality. | 429 // Thresholds for expected quality. |
| 430 QualityThresholds quality_thresholds(32.5, 30.0, 0.85, 0.80); | 430 QualityThresholds quality_thresholds(32.5, 30.0, 0.85, 0.80); |
| 431 // Thresholds for rate control. | 431 // Thresholds for rate control. |
| 432 RateControlThresholds rc_thresholds[2]; | 432 RateControlThresholds rc_thresholds[2]; |
| 433 SetRateControlThresholds(rc_thresholds, 0, 0, 20, 30, 10, 10, 0, 1); | 433 SetRateControlThresholds(rc_thresholds, 0, 0, 20, 30, 10, 10, 0, 1); |
| 434 SetRateControlThresholds(rc_thresholds, 1, 0, 0, 30, 15, 10, 0, 0); | 434 SetRateControlThresholds(rc_thresholds, 1, 0, 0, 30, 15, 10, 0, 0); |
| 435 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 435 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 436 nullptr /* visualization_params */); | 436 nullptr /* visualization_params */); |
| 437 } | 437 } |
| 438 } // namespace test | 438 } // namespace test |
| 439 } // namespace webrtc | 439 } // namespace webrtc |
| OLD | NEW |