shithub: libvpx

Download patch

ref: 87999b1c2e5d9d843f1fa54d566ba9aaf253d499
parent: 6cceed09cf5480394621bb93fd1faf1e51092650
parent: e38066a74df096a92f8a14734a632ae360bcb144
author: Marco <[email protected]>
date: Fri Mar 13 10:31:39 EDT 2015

Merge "Fix crash with vp9 denoiser on."

--- a/test/datarate_test.cc
+++ b/test/datarate_test.cc
@@ -44,9 +44,8 @@
 
   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 @@
 
   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 @@
     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 @@
       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;
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1592,7 +1592,8 @@
   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);
   }