test/svc_datarate_test.cc
// Check basic rate targeting for 1 pass CBR SVC with 2 spatial layers and on
// the fly switching to 1 spatial layer with dynamic resize enabled.
// The resizer will resize the single layer down and back up again, as the
// bitrate goes back up.
Check basic rate targeting for 1 pass CBR SVC with 2 spatial layers and on
the fly switching to 1 spatial layer with dynamic resize enabled.
The resizer will resize the single layer down and back up again, as the
bitrate goes back up.
Check basic rate targeting for 1 pass CBR SVC with 2 spatial layers and on the fly switching to 1 spatial layer with dynamic resize enabled . The resizer will resize the single layer down and back up again as the bitrate goes back up .
TEST_P(DatarateOnePassCbrSvcSingleBR, OnePassCbrSvc2SL_SingleLayerResize) {
  SetSvcConfig(2, 1);
  cfg_.rc_buf_initial_sz = 500;
  cfg_.rc_buf_optimal_sz = 500;
  cfg_.rc_buf_sz = 1000;
  cfg_.rc_min_quantizer = 0;
  cfg_.rc_max_quantizer = 63;
  cfg_.g_threads = 1;
  cfg_.temporal_layering_mode = 0;
  cfg_.rc_dropframe_thresh = 30;
  cfg_.kf_max_dist = 9999;
  cfg_.rc_resize_allowed = 1;
  ::libvpx_test::I420VideoSource video("desktop_office1.1280_720-020.yuv", 1280,
                                       720, 15, 1, 0, 300);
  top_sl_width_ = 1280;
  top_sl_height_ = 720;
  cfg_.rc_target_bitrate = 800;
  ResetModel();
  dynamic_drop_layer_ = true;
  single_layer_resize_ = true;
  base_speed_setting_ = speed_setting_;
  AssignLayerBitrates();
  ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
  EXPECT_GE(num_resize_down_, 1);
  EXPECT_GE(num_resize_up_, 1);
  CheckLayerRateTargeting(number_spatial_layers_ - 2, number_temporal_layers_,
                          0.78, 1.15);
#if CONFIG_VP9_DECODER
  EXPECT_EQ(GetNonRefFrames(), GetMismatchFrames());
#endif
}
TEST_P ( DatarateOnePassCbrSvcSingleBR , OnePassCbrSvc2SL_SingleLayerResize ) { SetSvcConfig ( 2 , 1 ) ; cfg_ . rc_buf_initial_sz = 500 ; cfg_ . rc_buf_optimal_sz = 500 ; cfg_ . rc_buf_sz = 1000 ; cfg_ . rc_min_quantizer = 0 ; cfg_ . rc_max_quantizer = 63 ; cfg_ . g_threads = 1 ; cfg_ . temporal_layering_mode = 0 ; cfg_ . rc_dropframe_thresh = 30 ; cfg_ . kf_max_dist = 9999 ; cfg_ . rc_resize_allowed = 1 ; :: libvpx_test :: I420VideoSource video ( " " , 1280 , 720 , 15 , 1 , 0 , 300 ) ; top_sl_width_ = 1280 ; top_sl_height_ = 720 ; cfg_ . rc_target_bitrate = 800 ; ResetModel ( ) ; dynamic_drop_layer_ = true ; single_layer_resize_ = true ; base_speed_setting_ = speed_setting_ ; AssignLayerBitrates ( ) ; ASSERT_NO_FATAL_FAILURE ( RunLoop ( & video ) ) ; EXPECT_GE ( num_resize_down_ , 1 ) ; EXPECT_GE ( num_resize_up_ , 1 ) ; CheckLayerRateTargeting ( number_spatial_layers_ - 2 , number_temporal_layers_ , 0.78 , 1.15 ) ; #if CONFIG_VP9_DECODER EXPECT_EQ ( GetNonRefFrames ( ) , GetMismatchFrames ( ) ) ; #endif }
Check basic rate targeting for 1 pass CBR SVC with 2 spatial layers and on
the fly switching to 1 spatial layer with dynamic resize enabled.
Check basic rate targeting for 1 pass CBR SVC with 2 spatial layers and on the fly switching to 1 spatial layer with dynamic resize enabled .
// Expect at least one resize down and at least one resize back up. // Don't check rate targeting on two top spatial layer since they will be // skipped for part of the sequence. // The non-reference frames are expected to be mismatched frames as the // encoder will avoid loopfilter on these frames.