ref: 000c8414b510dcaeb1ab7a52bec78c4a6b97cafd
parent: bc10eab41bbb4431ff59e5b7b9fd017a9c36a579
author: Scott LaVarnway <slavarnway@google.com>
date: Fri Dec 7 07:19:52 EST 2012
Moved denoiser frame copy/updates out of loopfilter thread The loopfilter thread from the previous frame can be running while starting the current frame. cpi->Source will change during this time causing the wrong data to be copied. The refresh_x_frame flags also change, which will cause incorrect updates of the denoised buffers. Change-Id: I7d982b4fcb40a0610801332aa85f3b792c64e4c3
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -3131,49 +3131,7 @@
cpi->current_ref_frames[LAST_FRAME] = cm->current_video_frame;
#endif
}
-}
-void vp8_loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm)
-{
- const FRAME_TYPE frame_type = cm->frame_type;
-
- if (cm->no_lpf)
- {
- cm->filter_level = 0;
- }
- else
- {
- struct vpx_usec_timer timer;
-
- vp8_clear_system_state();
-
- vpx_usec_timer_start(&timer);
- if (cpi->sf.auto_filter == 0)
- vp8cx_pick_filter_level_fast(cpi->Source, cpi);
-
- else
- vp8cx_pick_filter_level(cpi->Source, cpi);
-
- if (cm->filter_level > 0)
- {
- vp8cx_set_alt_lf_level(cpi, cm->filter_level);
- }
-
- vpx_usec_timer_mark(&timer);
- cpi->time_pick_lpf += vpx_usec_timer_elapsed(&timer);
- }
-
-#if CONFIG_MULTITHREAD
- if (cpi->b_multi_threaded)
- sem_post(&cpi->h_event_end_lpf); /* signal that we have set filter_level */
-#endif
-
- if (cm->filter_level > 0)
- {
- vp8_loop_filter_frame(cm, &cpi->mb.e_mbd, frame_type);
- }
-
- vp8_yv12_extend_frame_borders(cm->frame_to_show);
#if CONFIG_TEMPORAL_DENOISING
if (cpi->oxcf.noise_sensitivity)
{
@@ -3223,6 +3181,50 @@
}
#endif
+
+}
+
+void vp8_loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm)
+{
+ const FRAME_TYPE frame_type = cm->frame_type;
+
+ if (cm->no_lpf)
+ {
+ cm->filter_level = 0;
+ }
+ else
+ {
+ struct vpx_usec_timer timer;
+
+ vp8_clear_system_state();
+
+ vpx_usec_timer_start(&timer);
+ if (cpi->sf.auto_filter == 0)
+ vp8cx_pick_filter_level_fast(cpi->Source, cpi);
+
+ else
+ vp8cx_pick_filter_level(cpi->Source, cpi);
+
+ if (cm->filter_level > 0)
+ {
+ vp8cx_set_alt_lf_level(cpi, cm->filter_level);
+ }
+
+ vpx_usec_timer_mark(&timer);
+ cpi->time_pick_lpf += vpx_usec_timer_elapsed(&timer);
+ }
+
+#if CONFIG_MULTITHREAD
+ if (cpi->b_multi_threaded)
+ sem_post(&cpi->h_event_end_lpf); /* signal that we have set filter_level */
+#endif
+
+ if (cm->filter_level > 0)
+ {
+ vp8_loop_filter_frame(cm, &cpi->mb.e_mbd, frame_type);
+ }
+
+ vp8_yv12_extend_frame_borders(cm->frame_to_show);
}
--
⑨