| 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 28 matching lines...) Expand all  Loading... | 
|   39   // Codec/network settings. |   39   // Codec/network settings. | 
|   40   CodecConfigPars process_settings; |   40   CodecConfigPars process_settings; | 
|   41   SetCodecParameters(&process_settings, kVideoCodecH264, kHwCodec, |   41   SetCodecParameters(&process_settings, kVideoCodecH264, kHwCodec, | 
|   42                      kUseSingleCore, 0.0f, -1, 1, false, false, true, false); |   42                      kUseSingleCore, 0.0f, -1, 1, false, false, true, false); | 
|   43   // Metrics for expected quality. |   43   // Metrics for expected quality. | 
|   44   QualityMetrics quality_metrics; |   44   QualityMetrics quality_metrics; | 
|   45   SetQualityMetrics(&quality_metrics, 35.0, 25.0, 0.93, 0.70); |   45   SetQualityMetrics(&quality_metrics, 35.0, 25.0, 0.93, 0.70); | 
|   46   // Metrics for rate control. |   46   // Metrics for rate control. | 
|   47   RateControlMetrics rc_metrics[1]; |   47   RateControlMetrics rc_metrics[1]; | 
|   48   SetRateControlMetrics(rc_metrics, 0, 2, 60, 20, 10, 20, 0, 1); |   48   SetRateControlMetrics(rc_metrics, 0, 2, 60, 20, 10, 20, 0, 1); | 
|   49   ProcessFramesAndVerify(quality_metrics, |   49   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 
|   50                          rate_profile, |   50                          rc_metrics, nullptr /* visualization_params */); | 
|   51                          process_settings, |  | 
|   52                          rc_metrics); |  | 
|   53 } |   51 } | 
|   54  |   52  | 
|   55 #endif  // defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) |   53 #endif  // defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) | 
|   56  |   54  | 
|   57 // Fails on iOS. See webrtc:4755. |   55 // Fails on iOS. See webrtc:4755. | 
|   58 #if !defined(WEBRTC_IOS) |   56 #if !defined(WEBRTC_IOS) | 
|   59  |   57  | 
|   60 #if !defined(RTC_DISABLE_VP9) |   58 #if !defined(RTC_DISABLE_VP9) | 
|   61 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. |   59 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. | 
|   62 // One key frame (first frame only) in sequence. Setting |key_frame_interval| |   60 // One key frame (first frame only) in sequence. Setting |key_frame_interval| | 
|   63 // to -1 below means no periodic key frames in test. |   61 // to -1 below means no periodic key frames in test. | 
|   64 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { |   62 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { | 
|   65   // Bitrate and frame rate profile. |   63   // Bitrate and frame rate profile. | 
|   66   RateProfile rate_profile; |   64   RateProfile rate_profile; | 
|   67   SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |   65   SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 
|   68   rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |   66   rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 
|   69   rate_profile.num_frames = kNumFramesShort; |   67   rate_profile.num_frames = kNumFramesShort; | 
|   70   // Codec/network settings. |   68   // Codec/network settings. | 
|   71   CodecConfigPars process_settings; |   69   CodecConfigPars process_settings; | 
|   72   SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, |   70   SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, | 
|   73                      kUseSingleCore, 0.0f, -1, 1, false, false, true, false); |   71                      kUseSingleCore, 0.0f, -1, 1, false, false, true, false); | 
|   74   // Metrics for expected quality. |   72   // Metrics for expected quality. | 
|   75   QualityMetrics quality_metrics; |   73   QualityMetrics quality_metrics; | 
|   76   SetQualityMetrics(&quality_metrics, 37.0, 36.0, 0.93, 0.92); |   74   SetQualityMetrics(&quality_metrics, 37.0, 36.0, 0.93, 0.92); | 
|   77   // Metrics for rate control. |   75   // Metrics for rate control. | 
|   78   RateControlMetrics rc_metrics[1]; |   76   RateControlMetrics rc_metrics[1]; | 
|   79   SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); |   77   SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); | 
|   80   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |   78   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 
|   81                          rc_metrics); |   79                          rc_metrics, nullptr /* visualization_params */); | 
|   82 } |   80 } | 
|   83  |   81  | 
|   84 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit |   82 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit | 
|   85 // lower. One key frame (first frame only) in sequence. |   83 // lower. One key frame (first frame only) in sequence. | 
|   86 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { |   84 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { | 
|   87   // Bitrate and frame rate profile. |   85   // Bitrate and frame rate profile. | 
|   88   RateProfile rate_profile; |   86   RateProfile rate_profile; | 
|   89   SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |   87   SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 
|   90   rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |   88   rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 
|   91   rate_profile.num_frames = kNumFramesShort; |   89   rate_profile.num_frames = kNumFramesShort; | 
|   92   // Codec/network settings. |   90   // Codec/network settings. | 
|   93   CodecConfigPars process_settings; |   91   CodecConfigPars process_settings; | 
|   94   SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, |   92   SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, | 
|   95                      kUseSingleCore, 0.05f, -1, 1, false, false, true, false); |   93                      kUseSingleCore, 0.05f, -1, 1, false, false, true, false); | 
|   96   // Metrics for expected quality. |   94   // Metrics for expected quality. | 
|   97   QualityMetrics quality_metrics; |   95   QualityMetrics quality_metrics; | 
|   98   SetQualityMetrics(&quality_metrics, 17.0, 14.0, 0.45, 0.36); |   96   SetQualityMetrics(&quality_metrics, 17.0, 14.0, 0.45, 0.36); | 
|   99   // Metrics for rate control. |   97   // Metrics for rate control. | 
|  100   RateControlMetrics rc_metrics[1]; |   98   RateControlMetrics rc_metrics[1]; | 
|  101   SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); |   99   SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); | 
|  102   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |  100   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 
|  103                          rc_metrics); |  101                          rc_metrics, nullptr /* visualization_params */); | 
|  104 } |  102 } | 
|  105  |  103  | 
|  106 // VP9: Run with no packet loss, with varying bitrate (3 rate updates): |  104 // VP9: Run with no packet loss, with varying bitrate (3 rate updates): | 
|  107 // low to high to medium. Check that quality and encoder response to the new |  105 // low to high to medium. Check that quality and encoder response to the new | 
|  108 // target rate/per-frame bandwidth (for each rate update) is within limits. |  106 // target rate/per-frame bandwidth (for each rate update) is within limits. | 
|  109 // One key frame (first frame only) in sequence. |  107 // One key frame (first frame only) in sequence. | 
|  110 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { |  108 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { | 
|  111   // Bitrate and frame rate profile. |  109   // Bitrate and frame rate profile. | 
|  112   RateProfile rate_profile; |  110   RateProfile rate_profile; | 
|  113   SetRateProfilePars(&rate_profile, 0, 200, 30, 0); |  111   SetRateProfilePars(&rate_profile, 0, 200, 30, 0); | 
|  114   SetRateProfilePars(&rate_profile, 1, 700, 30, 100); |  112   SetRateProfilePars(&rate_profile, 1, 700, 30, 100); | 
|  115   SetRateProfilePars(&rate_profile, 2, 500, 30, 200); |  113   SetRateProfilePars(&rate_profile, 2, 500, 30, 200); | 
|  116   rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |  114   rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 
|  117   rate_profile.num_frames = kNumFramesLong; |  115   rate_profile.num_frames = kNumFramesLong; | 
|  118   // Codec/network settings. |  116   // Codec/network settings. | 
|  119   CodecConfigPars process_settings; |  117   CodecConfigPars process_settings; | 
|  120   SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, |  118   SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, | 
|  121                      kUseSingleCore, 0.0f, -1, 1, false, false, true, false); |  119                      kUseSingleCore, 0.0f, -1, 1, false, false, true, false); | 
|  122   // Metrics for expected quality. |  120   // Metrics for expected quality. | 
|  123   QualityMetrics quality_metrics; |  121   QualityMetrics quality_metrics; | 
|  124   SetQualityMetrics(&quality_metrics, 35.5, 30.0, 0.90, 0.85); |  122   SetQualityMetrics(&quality_metrics, 35.5, 30.0, 0.90, 0.85); | 
|  125   // Metrics for rate control. |  123   // Metrics for rate control. | 
|  126   RateControlMetrics rc_metrics[3]; |  124   RateControlMetrics rc_metrics[3]; | 
|  127   SetRateControlMetrics(rc_metrics, 0, 0, 30, 20, 20, 30, 0, 1); |  125   SetRateControlMetrics(rc_metrics, 0, 0, 30, 20, 20, 30, 0, 1); | 
|  128   SetRateControlMetrics(rc_metrics, 1, 2, 0, 20, 20, 60, 0, 0); |  126   SetRateControlMetrics(rc_metrics, 1, 2, 0, 20, 20, 60, 0, 0); | 
|  129   SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 20, 40, 0, 0); |  127   SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 20, 40, 0, 0); | 
|  130   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |  128   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 
|  131                          rc_metrics); |  129                          rc_metrics, nullptr /* visualization_params */); | 
|  132 } |  130 } | 
|  133  |  131  | 
|  134 // VP9: Run with no packet loss, with an update (decrease) in frame rate. |  132 // VP9: Run with no packet loss, with an update (decrease) in frame rate. | 
|  135 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. |  133 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. | 
|  136 // At the low bitrate in this test, this means better rate control after the |  134 // At the low bitrate in this test, this means better rate control after the | 
|  137 // update(s) to lower frame rate. So expect less frame drops, and max values |  135 // update(s) to lower frame rate. So expect less frame drops, and max values | 
|  138 // for the rate control metrics can be lower. One key frame (first frame only). |  136 // for the rate control metrics can be lower. One key frame (first frame only). | 
|  139 // Note: quality after update should be higher but we currently compute quality |  137 // Note: quality after update should be higher but we currently compute quality | 
|  140 // metrics averaged over whole sequence run. |  138 // metrics averaged over whole sequence run. | 
|  141 TEST_F(VideoProcessorIntegrationTest, |  139 TEST_F(VideoProcessorIntegrationTest, | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
|  154                      kUseSingleCore, 0.0f, -1, 1, false, false, true, false); |  152                      kUseSingleCore, 0.0f, -1, 1, false, false, true, false); | 
|  155   // Metrics for expected quality. |  153   // Metrics for expected quality. | 
|  156   QualityMetrics quality_metrics; |  154   QualityMetrics quality_metrics; | 
|  157   SetQualityMetrics(&quality_metrics, 31.5, 18.0, 0.80, 0.43); |  155   SetQualityMetrics(&quality_metrics, 31.5, 18.0, 0.80, 0.43); | 
|  158   // Metrics for rate control. |  156   // Metrics for rate control. | 
|  159   RateControlMetrics rc_metrics[3]; |  157   RateControlMetrics rc_metrics[3]; | 
|  160   SetRateControlMetrics(rc_metrics, 0, 38, 50, 75, 15, 45, 0, 1); |  158   SetRateControlMetrics(rc_metrics, 0, 38, 50, 75, 15, 45, 0, 1); | 
|  161   SetRateControlMetrics(rc_metrics, 1, 10, 0, 40, 10, 30, 0, 0); |  159   SetRateControlMetrics(rc_metrics, 1, 10, 0, 40, 10, 30, 0, 0); | 
|  162   SetRateControlMetrics(rc_metrics, 2, 5, 0, 30, 5, 20, 0, 0); |  160   SetRateControlMetrics(rc_metrics, 2, 5, 0, 30, 5, 20, 0, 0); | 
|  163   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |  161   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 
|  164                          rc_metrics); |  162                          rc_metrics, nullptr /* visualization_params */); | 
|  165 } |  163 } | 
|  166  |  164  | 
|  167 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). |  165 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). | 
|  168 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { |  166 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { | 
|  169   // Bitrate and frame rate profile. |  167   // Bitrate and frame rate profile. | 
|  170   RateProfile rate_profile; |  168   RateProfile rate_profile; | 
|  171   SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |  169   SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 
|  172   rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |  170   rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 
|  173   rate_profile.num_frames = kNumFramesShort; |  171   rate_profile.num_frames = kNumFramesShort; | 
|  174   // Codec/network settings. |  172   // Codec/network settings. | 
|  175   CodecConfigPars process_settings; |  173   CodecConfigPars process_settings; | 
|  176   SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, |  174   SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, | 
|  177                      kUseSingleCore, 0.0f, -1, 1, false, true, true, false); |  175                      kUseSingleCore, 0.0f, -1, 1, false, true, true, false); | 
|  178   // Metrics for expected quality. |  176   // Metrics for expected quality. | 
|  179   QualityMetrics quality_metrics; |  177   QualityMetrics quality_metrics; | 
|  180   SetQualityMetrics(&quality_metrics, 36.8, 35.8, 0.92, 0.91); |  178   SetQualityMetrics(&quality_metrics, 36.8, 35.8, 0.92, 0.91); | 
|  181   // Metrics for rate control. |  179   // Metrics for rate control. | 
|  182   RateControlMetrics rc_metrics[1]; |  180   RateControlMetrics rc_metrics[1]; | 
|  183   SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); |  181   SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); | 
|  184   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |  182   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 
|  185                          rc_metrics); |  183                          rc_metrics, nullptr /* visualization_params */); | 
|  186 } |  184 } | 
|  187  |  185  | 
|  188 // Run with no packet loss, at low bitrate. |  186 // Run with no packet loss, at low bitrate. | 
|  189 // spatial_resize is on, for this low bitrate expect one resize in sequence. |  187 // spatial_resize is on, for this low bitrate expect one resize in sequence. | 
|  190 // Resize happens on delta frame. Expect only one key frame (first frame). |  188 // Resize happens on delta frame. Expect only one key frame (first frame). | 
|  191 TEST_F(VideoProcessorIntegrationTest, |  189 TEST_F(VideoProcessorIntegrationTest, | 
|  192        DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { |  190        DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { | 
|  193   config_.networking_config.packet_loss_probability = 0; |  191   config_.networking_config.packet_loss_probability = 0; | 
|  194   // Bitrate and frame rate profile. |  192   // Bitrate and frame rate profile. | 
|  195   RateProfile rate_profile; |  193   RateProfile rate_profile; | 
|  196   SetRateProfilePars(&rate_profile, 0, 50, 30, 0); |  194   SetRateProfilePars(&rate_profile, 0, 50, 30, 0); | 
|  197   rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; |  195   rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; | 
|  198   rate_profile.num_frames = kNumFramesLong; |  196   rate_profile.num_frames = kNumFramesLong; | 
|  199   // Codec/network settings. |  197   // Codec/network settings. | 
|  200   CodecConfigPars process_settings; |  198   CodecConfigPars process_settings; | 
|  201   SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, |  199   SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, | 
|  202                      kUseSingleCore, 0.0f, -1, 1, false, false, true, true); |  200                      kUseSingleCore, 0.0f, -1, 1, false, false, true, true); | 
|  203   // Metrics for expected quality. |  201   // Metrics for expected quality. | 
|  204   QualityMetrics quality_metrics; |  202   QualityMetrics quality_metrics; | 
|  205   SetQualityMetrics(&quality_metrics, 24.0, 13.0, 0.65, 0.37); |  203   SetQualityMetrics(&quality_metrics, 24.0, 13.0, 0.65, 0.37); | 
|  206   // Metrics for rate control. |  204   // Metrics for rate control. | 
|  207   RateControlMetrics rc_metrics[1]; |  205   RateControlMetrics rc_metrics[1]; | 
|  208   SetRateControlMetrics(rc_metrics, 0, 228, 70, 160, 15, 80, 1, 1); |  206   SetRateControlMetrics(rc_metrics, 0, 228, 70, 160, 15, 80, 1, 1); | 
|  209   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |  207   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 
|  210                          rc_metrics); |  208                          rc_metrics, nullptr /* visualization_params */); | 
|  211 } |  209 } | 
|  212  |  210  | 
|  213 // TODO(marpan): Add temporal layer test for VP9, once changes are in |  211 // TODO(marpan): Add temporal layer test for VP9, once changes are in | 
|  214 // vp9 wrapper for this. |  212 // vp9 wrapper for this. | 
|  215  |  213  | 
|  216 #endif  // !defined(RTC_DISABLE_VP9) |  214 #endif  // !defined(RTC_DISABLE_VP9) | 
|  217  |  215  | 
|  218 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high. |  216 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high. | 
|  219 // One key frame (first frame only) in sequence. Setting |key_frame_interval| |  217 // One key frame (first frame only) in sequence. Setting |key_frame_interval| | 
|  220 // to -1 below means no periodic key frames in test. |  218 // to -1 below means no periodic key frames in test. | 
|  221 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { |  219 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { | 
|  222   // Bitrate and frame rate profile. |  220   // Bitrate and frame rate profile. | 
|  223   RateProfile rate_profile; |  221   RateProfile rate_profile; | 
|  224   SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |  222   SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 
|  225   rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |  223   rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 
|  226   rate_profile.num_frames = kNumFramesShort; |  224   rate_profile.num_frames = kNumFramesShort; | 
|  227   // Codec/network settings. |  225   // Codec/network settings. | 
|  228   CodecConfigPars process_settings; |  226   CodecConfigPars process_settings; | 
|  229   SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, |  227   SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, | 
|  230                      kUseSingleCore, 0.0f, -1, 1, false, true, true, false); |  228                      kUseSingleCore, 0.0f, -1, 1, false, true, true, false); | 
|  231   // Metrics for expected quality. |  229   // Metrics for expected quality. | 
|  232   QualityMetrics quality_metrics; |  230   QualityMetrics quality_metrics; | 
|  233   SetQualityMetrics(&quality_metrics, 34.95, 33.0, 0.90, 0.89); |  231   SetQualityMetrics(&quality_metrics, 34.95, 33.0, 0.90, 0.89); | 
|  234   // Metrics for rate control. |  232   // Metrics for rate control. | 
|  235   RateControlMetrics rc_metrics[1]; |  233   RateControlMetrics rc_metrics[1]; | 
|  236   SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); |  234   SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); | 
|  237   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |  235   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 
|  238                          rc_metrics); |  236                          rc_metrics, nullptr /* visualization_params */); | 
|  239 } |  237 } | 
|  240  |  238  | 
|  241 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit |  239 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit | 
|  242 // lower. One key frame (first frame only) in sequence. |  240 // lower. One key frame (first frame only) in sequence. | 
|  243 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { |  241 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { | 
|  244   // Bitrate and frame rate profile. |  242   // Bitrate and frame rate profile. | 
|  245   RateProfile rate_profile; |  243   RateProfile rate_profile; | 
|  246   SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |  244   SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 
|  247   rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |  245   rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 
|  248   rate_profile.num_frames = kNumFramesShort; |  246   rate_profile.num_frames = kNumFramesShort; | 
|  249   // Codec/network settings. |  247   // Codec/network settings. | 
|  250   CodecConfigPars process_settings; |  248   CodecConfigPars process_settings; | 
|  251   SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, |  249   SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, | 
|  252                      kUseSingleCore, 0.05f, -1, 1, false, true, true, false); |  250                      kUseSingleCore, 0.05f, -1, 1, false, true, true, false); | 
|  253   // Metrics for expected quality. |  251   // Metrics for expected quality. | 
|  254   QualityMetrics quality_metrics; |  252   QualityMetrics quality_metrics; | 
|  255   SetQualityMetrics(&quality_metrics, 20.0, 16.0, 0.60, 0.40); |  253   SetQualityMetrics(&quality_metrics, 20.0, 16.0, 0.60, 0.40); | 
|  256   // Metrics for rate control. |  254   // Metrics for rate control. | 
|  257   RateControlMetrics rc_metrics[1]; |  255   RateControlMetrics rc_metrics[1]; | 
|  258   SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); |  256   SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); | 
|  259   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |  257   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 
|  260                          rc_metrics); |  258                          rc_metrics, nullptr /* visualization_params */); | 
|  261 } |  259 } | 
|  262  |  260  | 
|  263 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. |  261 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. | 
|  264 // One key frame (first frame only) in sequence. |  262 // One key frame (first frame only) in sequence. | 
|  265 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { |  263 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { | 
|  266   // Bitrate and frame rate profile. |  264   // Bitrate and frame rate profile. | 
|  267   RateProfile rate_profile; |  265   RateProfile rate_profile; | 
|  268   SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |  266   SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 
|  269   rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |  267   rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 
|  270   rate_profile.num_frames = kNumFramesShort; |  268   rate_profile.num_frames = kNumFramesShort; | 
|  271   // Codec/network settings. |  269   // Codec/network settings. | 
|  272   CodecConfigPars process_settings; |  270   CodecConfigPars process_settings; | 
|  273   SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, |  271   SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, | 
|  274                      kUseSingleCore, 0.1f, -1, 1, false, true, true, false); |  272                      kUseSingleCore, 0.1f, -1, 1, false, true, true, false); | 
|  275   // Metrics for expected quality. |  273   // Metrics for expected quality. | 
|  276   QualityMetrics quality_metrics; |  274   QualityMetrics quality_metrics; | 
|  277   SetQualityMetrics(&quality_metrics, 19.0, 16.0, 0.50, 0.35); |  275   SetQualityMetrics(&quality_metrics, 19.0, 16.0, 0.50, 0.35); | 
|  278   // Metrics for rate control. |  276   // Metrics for rate control. | 
|  279   RateControlMetrics rc_metrics[1]; |  277   RateControlMetrics rc_metrics[1]; | 
|  280   SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); |  278   SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); | 
|  281   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |  279   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 
|  282                          rc_metrics); |  280                          rc_metrics, nullptr /* visualization_params */); | 
|  283 } |  281 } | 
|  284  |  282  | 
|  285 #endif  // !defined(WEBRTC_IOS) |  283 #endif  // !defined(WEBRTC_IOS) | 
|  286  |  284  | 
|  287 // The tests below are currently disabled for Android. For ARM, the encoder |  285 // The tests below are currently disabled for Android. For ARM, the encoder | 
|  288 // uses |cpu_speed| = 12, as opposed to default |cpu_speed| <= 6 for x86, |  286 // uses |cpu_speed| = 12, as opposed to default |cpu_speed| <= 6 for x86, | 
|  289 // which leads to significantly different quality. The quality and rate control |  287 // which leads to significantly different quality. The quality and rate control | 
|  290 // settings in the tests below are defined for encoder speed setting |  288 // settings in the tests below are defined for encoder speed setting | 
|  291 // |cpu_speed| <= ~6. A number of settings would need to be significantly |  289 // |cpu_speed| <= ~6. A number of settings would need to be significantly | 
|  292 // modified for the |cpu_speed| = 12 case. For now, keep the tests below |  290 // modified for the |cpu_speed| = 12 case. For now, keep the tests below | 
| (...skipping 25 matching lines...) Expand all  Loading... | 
|  318                      kUseSingleCore, 0.0f, -1, 1, false, true, true, false); |  316                      kUseSingleCore, 0.0f, -1, 1, false, true, true, false); | 
|  319   // Metrics for expected quality. |  317   // Metrics for expected quality. | 
|  320   QualityMetrics quality_metrics; |  318   QualityMetrics quality_metrics; | 
|  321   SetQualityMetrics(&quality_metrics, 34.0, 32.0, 0.85, 0.80); |  319   SetQualityMetrics(&quality_metrics, 34.0, 32.0, 0.85, 0.80); | 
|  322   // Metrics for rate control. |  320   // Metrics for rate control. | 
|  323   RateControlMetrics rc_metrics[3]; |  321   RateControlMetrics rc_metrics[3]; | 
|  324   SetRateControlMetrics(rc_metrics, 0, 0, 45, 20, 10, 15, 0, 1); |  322   SetRateControlMetrics(rc_metrics, 0, 0, 45, 20, 10, 15, 0, 1); | 
|  325   SetRateControlMetrics(rc_metrics, 1, 0, 0, 25, 20, 10, 0, 0); |  323   SetRateControlMetrics(rc_metrics, 1, 0, 0, 25, 20, 10, 0, 0); | 
|  326   SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 15, 10, 0, 0); |  324   SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 15, 10, 0, 0); | 
|  327   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |  325   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 
|  328                          rc_metrics); |  326                          rc_metrics, nullptr /* visualization_params */); | 
|  329 } |  327 } | 
|  330  |  328  | 
|  331 // VP8: Run with no packet loss, with an update (decrease) in frame rate. |  329 // VP8: Run with no packet loss, with an update (decrease) in frame rate. | 
|  332 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. |  330 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. | 
|  333 // At the bitrate in this test, this means better rate control after the |  331 // At the bitrate in this test, this means better rate control after the | 
|  334 // update(s) to lower frame rate. So expect less frame drops, and max values |  332 // update(s) to lower frame rate. So expect less frame drops, and max values | 
|  335 // for the rate control metrics can be lower. One key frame (first frame only). |  333 // for the rate control metrics can be lower. One key frame (first frame only). | 
|  336 // Note: quality after update should be higher but we currently compute quality |  334 // Note: quality after update should be higher but we currently compute quality | 
|  337 // metrics averaged over whole sequence run. |  335 // metrics averaged over whole sequence run. | 
|  338 // Too slow to finish before timeout on iOS. See webrtc:4755. |  336 // Too slow to finish before timeout on iOS. See webrtc:4755. | 
| (...skipping 20 matching lines...) Expand all  Loading... | 
|  359                      kUseSingleCore, 0.0f, -1, 1, false, true, true, false); |  357                      kUseSingleCore, 0.0f, -1, 1, false, true, true, false); | 
|  360   // Metrics for expected quality. |  358   // Metrics for expected quality. | 
|  361   QualityMetrics quality_metrics; |  359   QualityMetrics quality_metrics; | 
|  362   SetQualityMetrics(&quality_metrics, 31.0, 22.0, 0.80, 0.65); |  360   SetQualityMetrics(&quality_metrics, 31.0, 22.0, 0.80, 0.65); | 
|  363   // Metrics for rate control. |  361   // Metrics for rate control. | 
|  364   RateControlMetrics rc_metrics[3]; |  362   RateControlMetrics rc_metrics[3]; | 
|  365   SetRateControlMetrics(rc_metrics, 0, 40, 20, 75, 15, 60, 0, 1); |  363   SetRateControlMetrics(rc_metrics, 0, 40, 20, 75, 15, 60, 0, 1); | 
|  366   SetRateControlMetrics(rc_metrics, 1, 10, 0, 25, 10, 35, 0, 0); |  364   SetRateControlMetrics(rc_metrics, 1, 10, 0, 25, 10, 35, 0, 0); | 
|  367   SetRateControlMetrics(rc_metrics, 2, 0, 0, 20, 10, 15, 0, 0); |  365   SetRateControlMetrics(rc_metrics, 2, 0, 0, 20, 10, 15, 0, 0); | 
|  368   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |  366   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 
|  369                          rc_metrics); |  367                          rc_metrics, nullptr /* visualization_params */); | 
|  370 } |  368 } | 
|  371  |  369  | 
|  372 // VP8: Run with no packet loss, with 3 temporal layers, with a rate update in |  370 // VP8: Run with no packet loss, with 3 temporal layers, with a rate update in | 
|  373 // the middle of the sequence. The max values for the frame size mismatch and |  371 // the middle of the sequence. The max values for the frame size mismatch and | 
|  374 // encoding rate mismatch are applied to each layer. |  372 // encoding rate mismatch are applied to each layer. | 
|  375 // No dropped frames in this test, and internal spatial resizer is off. |  373 // No dropped frames in this test, and internal spatial resizer is off. | 
|  376 // One key frame (first frame only) in sequence, so no spatial resizing. |  374 // One key frame (first frame only) in sequence, so no spatial resizing. | 
|  377 // Too slow to finish before timeout on iOS. See webrtc:4755. |  375 // Too slow to finish before timeout on iOS. See webrtc:4755. | 
|  378 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |  376 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 
|  379 #define MAYBE_ProcessNoLossTemporalLayersVP8 \ |  377 #define MAYBE_ProcessNoLossTemporalLayersVP8 \ | 
| (...skipping 14 matching lines...) Expand all  Loading... | 
|  394   SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, |  392   SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, | 
|  395                      kUseSingleCore, 0.0f, -1, 3, false, true, true, false); |  393                      kUseSingleCore, 0.0f, -1, 3, false, true, true, false); | 
|  396   // Metrics for expected quality. |  394   // Metrics for expected quality. | 
|  397   QualityMetrics quality_metrics; |  395   QualityMetrics quality_metrics; | 
|  398   SetQualityMetrics(&quality_metrics, 32.5, 30.0, 0.85, 0.80); |  396   SetQualityMetrics(&quality_metrics, 32.5, 30.0, 0.85, 0.80); | 
|  399   // Metrics for rate control. |  397   // Metrics for rate control. | 
|  400   RateControlMetrics rc_metrics[2]; |  398   RateControlMetrics rc_metrics[2]; | 
|  401   SetRateControlMetrics(rc_metrics, 0, 0, 20, 30, 10, 10, 0, 1); |  399   SetRateControlMetrics(rc_metrics, 0, 0, 20, 30, 10, 10, 0, 1); | 
|  402   SetRateControlMetrics(rc_metrics, 1, 0, 0, 30, 15, 10, 0, 0); |  400   SetRateControlMetrics(rc_metrics, 1, 0, 0, 30, 15, 10, 0, 0); | 
|  403   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |  401   ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 
|  404                          rc_metrics); |  402                          rc_metrics, nullptr /* visualization_params */); | 
|  405 } |  403 } | 
|  406 }  // namespace test |  404 }  // namespace test | 
|  407 }  // namespace webrtc |  405 }  // namespace webrtc | 
| OLD | NEW |