Fix crash with vp9 denoiser on.
Crash occured on very first key frame, because denoiser temporal function was beng entered. Updated denoiser unittest to set cpu_used from first frame, and verified fix fixes the crash. Change-Id: I3be1124b52846fbbe7248d2c3d6136e086c80bc1
This commit is contained in:
parent
deaf661f45
commit
e38066a74d
@ -44,9 +44,8 @@ class DatarateTestLarge : public ::libvpx_test::EncoderTest,
|
||||
|
||||
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
|
||||
::libvpx_test::Encoder *encoder) {
|
||||
if (video->frame() == 1) {
|
||||
if (video->frame() == 0)
|
||||
encoder->Control(VP8E_SET_NOISE_SENSITIVITY, denoiser_on_);
|
||||
}
|
||||
|
||||
if (denoiser_offon_test_) {
|
||||
ASSERT_GT(denoiser_offon_period_, 0)
|
||||
@ -353,7 +352,7 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest,
|
||||
|
||||
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
|
||||
::libvpx_test::Encoder *encoder) {
|
||||
if (video->frame() == 1)
|
||||
if (video->frame() == 0)
|
||||
encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
|
||||
|
||||
if (denoiser_offon_test_) {
|
||||
@ -368,7 +367,7 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest,
|
||||
encoder->Control(VP9E_SET_NOISE_SENSITIVITY, denoiser_on_);
|
||||
|
||||
if (cfg_.ts_number_layers > 1) {
|
||||
if (video->frame() == 1) {
|
||||
if (video->frame() == 0) {
|
||||
encoder->Control(VP9E_SET_SVC, 1);
|
||||
}
|
||||
vpx_svc_layer_id_t layer_id = {0, 0};
|
||||
@ -376,9 +375,7 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest,
|
||||
frame_flags_ = SetFrameFlags(video->frame(), cfg_.ts_number_layers);
|
||||
layer_id.temporal_layer_id = SetLayerId(video->frame(),
|
||||
cfg_.ts_number_layers);
|
||||
if (video->frame() > 0) {
|
||||
encoder->Control(VP9E_SET_SVC_LAYER_ID, &layer_id);
|
||||
}
|
||||
encoder->Control(VP9E_SET_SVC_LAYER_ID, &layer_id);
|
||||
}
|
||||
const vpx_rational_t tb = video->timebase();
|
||||
timebase_ = static_cast<double>(tb.num) / tb.den;
|
||||
|
@ -1592,7 +1592,8 @@ static void encode_b_rt(VP9_COMP *cpi, ThreadData *td,
|
||||
update_state_rt(cpi, td, ctx, mi_row, mi_col, bsize);
|
||||
|
||||
#if CONFIG_VP9_TEMPORAL_DENOISING
|
||||
if (cpi->oxcf.noise_sensitivity > 0 && output_enabled) {
|
||||
if (cpi->oxcf.noise_sensitivity > 0 && output_enabled &&
|
||||
cpi->common.frame_type != KEY_FRAME) {
|
||||
vp9_denoiser_denoise(&cpi->denoiser, x, mi_row, mi_col,
|
||||
MAX(BLOCK_8X8, bsize), ctx);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user