mismatch_psnr_ = 0.0;
mismatch_nframes_ = 0;
denoiser_on_ = 0;
+ tune_content_ = 0;
+ base_speed_setting_ = 5;
}
virtual void BeginPassHook(unsigned int /*pass*/) {}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
svc_params_.max_quantizers[i] = 63;
svc_params_.min_quantizers[i] = 0;
}
- svc_params_.speed_per_layer[0] = 5;
+ svc_params_.speed_per_layer[0] = base_speed_setting_;
for (i = 1; i < VPX_SS_MAX_LAYERS; ++i) {
svc_params_.speed_per_layer[i] = speed_setting_;
}
encoder->Control(VP9E_SET_TILE_COLUMNS, (cfg_.g_threads >> 1));
encoder->Control(VP9E_SET_ROW_MT, 1);
encoder->Control(VP8E_SET_STATIC_THRESHOLD, 1);
+ encoder->Control(VP9E_SET_TUNE_CONTENT, tune_content_);
}
const vpx_rational_t tb = video->timebase();
timebase_ = static_cast<double>(tb.num) / tb.den;
double mismatch_psnr_;
int mismatch_nframes_;
int denoiser_on_;
+ int tune_content_;
+ int base_speed_setting_;
};
static void assign_layer_bitrates(vpx_codec_enc_cfg_t *const enc_cfg,
const vpx_svc_extra_cfg_t *svc_params,
}
}
+// Check basic rate targeting for 1 pass CBR SVC: 2 spatial layers and 1temporal
+// layer, with screen content mode on and same speed setting for all layers.
+TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2patialLayersScreenContent1) {
+ 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_.rc_end_usage = VPX_CBR;
+ cfg_.g_lag_in_frames = 0;
+ cfg_.ss_number_layers = 2;
+ cfg_.ts_number_layers = 1;
+ cfg_.ts_rate_decimator[0] = 1;
+ cfg_.g_error_resilient = 1;
+ cfg_.g_threads = 1;
+ cfg_.temporal_layering_mode = 0;
+ svc_params_.scaling_factor_num[0] = 144;
+ svc_params_.scaling_factor_den[0] = 288;
+ svc_params_.scaling_factor_num[1] = 288;
+ svc_params_.scaling_factor_den[1] = 288;
+ cfg_.rc_dropframe_thresh = 0;
+ cfg_.kf_max_dist = 9999;
+ ::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 0, 300);
+ cfg_.rc_target_bitrate = 500;
+ ResetModel();
+ tune_content_ = 1;
+ base_speed_setting_ = speed_setting_;
+ assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
+ cfg_.ts_number_layers, cfg_.temporal_layering_mode);
+ ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
+ EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
+}
+
// Check basic rate targeting for 1 pass CBR SVC: 2 spatial layers and
// 3 temporal layers. Run CIF clip with 1 thread.
TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayers) {
uint8_t *dest) {
VP9_COMMON *const cm = &cpi->common;
int q = 0, bottom_index = 0, top_index = 0; // Dummy variables.
- int compute_source_sad = cpi->sf.use_source_sad;
+ int compute_source_sad = cpi->sf.use_source_sad ||
+ cpi->oxcf.content == VP9E_CONTENT_SCREEN ||
+ cpi->oxcf.rc_mode == VPX_VBR;
vpx_clear_system_state();
vp9_update_noise_estimate(cpi);
+ // Compute source_sad if the flag compute_source_sad is set, and
+ // only for 1 pass realtime speed >= 5 with show_frame = 1.
+ // TODO(jianj): Look into removing the condition on resize_state,
+ // and improving these conditions (i.e., better handle SVC case and combine
+ // them with condition above in compute_source_sad).
if (cpi->oxcf.pass == 0 && cpi->oxcf.mode == REALTIME &&
- cpi->oxcf.speed >= 5 && cpi->resize_state == ORIG &&
- (cpi->oxcf.content == VP9E_CONTENT_SCREEN ||
- cpi->oxcf.rc_mode == VPX_VBR || compute_source_sad) &&
+ cpi->oxcf.speed >= 5 && cpi->resize_state == ORIG && compute_source_sad &&
cm->show_frame)
vp9_avg_source_sad(cpi);