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