Commit 000c8414 authored by Scott LaVarnway's avatar Scott LaVarnway
Browse files

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
parent bc10eab4
......@@ -3131,49 +3131,7 @@ static void update_reference_frames(VP8_COMP *cpi)
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)
{
......@@ -3226,6 +3184,50 @@ void vp8_loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm)
}
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);
}
static void encode_frame_to_data_rate
(
VP8_COMP *cpi,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment