test/datarate_test.cc
TEST_P(DatarateTestVP9Large, BasicRateTargeting444) {
  ::libvpx_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 140);

  cfg_.g_profile = 1;
  cfg_.g_timebase = video.timebase();

  cfg_.rc_buf_initial_sz = 500;
  cfg_.rc_buf_optimal_sz = 500;
  cfg_.rc_buf_sz = 1000;
  cfg_.rc_dropframe_thresh = 1;
  cfg_.rc_min_quantizer = 0;
  cfg_.rc_max_quantizer = 63;
  cfg_.rc_end_usage = VPX_CBR;

  for (int i = 250; i < 900; i += 200) {
    cfg_.rc_target_bitrate = i;
    ResetModel();
    ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
    ASSERT_GE(static_cast<double>(cfg_.rc_target_bitrate),
              effective_datarate_[0] * 0.80)
        << " The datarate for the file exceeds the target by too much!";
    ASSERT_LE(static_cast<double>(cfg_.rc_target_bitrate),
              effective_datarate_[0] * 1.15)
        << " The datarate for the file missed the target!"
        << cfg_.rc_target_bitrate << " " << effective_datarate_;
  }
}
// Check basic rate targeting for CBR.
Check basic rate targeting for CBR.
Check basic rate targeting for CBR .
TEST_P(DatarateTestVP9Large, BasicRateTargeting444) {
  ::libvpx_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 140);
  cfg_.g_profile = 1;
  cfg_.g_timebase = video.timebase();
  cfg_.rc_buf_initial_sz = 500;
  cfg_.rc_buf_optimal_sz = 500;
  cfg_.rc_buf_sz = 1000;
  cfg_.rc_dropframe_thresh = 1;
  cfg_.rc_min_quantizer = 0;
  cfg_.rc_max_quantizer = 63;
  cfg_.rc_end_usage = VPX_CBR;
  for (int i = 250; i < 900; i += 200) {
    cfg_.rc_target_bitrate = i;
    ResetModel();
    ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
    ASSERT_GE(static_cast<double>(cfg_.rc_target_bitrate),
              effective_datarate_[0] * 0.80)
        << " The datarate for the file exceeds the target by too much!";
    ASSERT_LE(static_cast<double>(cfg_.rc_target_bitrate),
              effective_datarate_[0] * 1.15)
        << " The datarate for the file missed the target!"
        << cfg_.rc_target_bitrate << " " << effective_datarate_;
  }
}
TEST_P ( DatarateTestVP9Large , BasicRateTargeting444 ) { :: libvpx_test :: Y4mVideoSource video ( " " , 0 , 140 ) ; cfg_ . g_profile = 1 ; cfg_ . g_timebase = video . timebase ( ) ; cfg_ . rc_buf_initial_sz = 500 ; cfg_ . rc_buf_optimal_sz = 500 ; cfg_ . rc_buf_sz = 1000 ; cfg_ . rc_dropframe_thresh = 1 ; cfg_ . rc_min_quantizer = 0 ; cfg_ . rc_max_quantizer = 63 ; cfg_ . rc_end_usage = VPX_CBR ; for ( int i = 250 ; i < 900 ; i += 200 ) { cfg_ . rc_target_bitrate = i ; ResetModel ( ) ; ASSERT_NO_FATAL_FAILURE ( RunLoop ( & video ) ) ; ASSERT_GE ( static_cast < double > ( cfg_ . rc_target_bitrate ) , effective_datarate_ [ 0 ] * 0.80 ) << " " ; ASSERT_LE ( static_cast < double > ( cfg_ . rc_target_bitrate ) , effective_datarate_ [ 0 ] * 1.15 ) << " " << cfg_ . rc_target_bitrate << " " << effective_datarate_ ; } }
Check basic rate targeting for CBR.
Check basic rate targeting for CBR .