Commit 00c54330 authored by Debargha Mukherjee's avatar Debargha Mukherjee

Remove unnecessary filtering and buffer copies

Removes redundant deblocking filtering operations and buffer copies,
during search for the restoration filters.
Also, makes the order of cdef and loop-restoration consistent.

BUG=AOMEDIA:373

Change-Id: I571e331f9dfadfd2c1494f279e50510ec212ea29
parent 8b77d04e
......@@ -4986,13 +4986,6 @@ void av1_decode_frame(AV1Decoder *pbi, const uint8_t *data,
} else {
*p_data_end = decode_tiles(pbi, data + first_partition_size, data_end);
}
#if CONFIG_LOOP_RESTORATION
if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[2].frame_restoration_type != RESTORE_NONE) {
av1_loop_restoration_frame(new_fb, cm, cm->rst_info, 7, 0, NULL);
}
#endif // CONFIG_LOOP_RESTORATION
#if CONFIG_CDEF
if (cm->dering_level && !cm->skip_loop_filter) {
......@@ -5017,7 +5010,15 @@ void av1_decode_frame(AV1Decoder *pbi, const uint8_t *data,
}
}
if (cm->clpf_blocks) aom_free(cm->clpf_blocks);
#endif
#endif // CONFIG_CDEF
#if CONFIG_LOOP_RESTORATION
if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[2].frame_restoration_type != RESTORE_NONE) {
av1_loop_restoration_frame(new_fb, cm, cm->rst_info, 7, 0, NULL);
}
#endif // CONFIG_LOOP_RESTORATION
if (!xd->corrupted) {
if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) {
......
......@@ -3462,11 +3462,7 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
aom_usec_timer_start(&timer);
#if CONFIG_LOOP_RESTORATION
av1_pick_filter_restoration(cpi->Source, cpi, cpi->sf.lpf_pick);
#else
av1_pick_filter_level(cpi->Source, cpi, cpi->sf.lpf_pick);
#endif // CONFIG_LOOP_RESTORATION
aom_usec_timer_mark(&timer);
cpi->time_pick_lpf += aom_usec_timer_elapsed(&timer);
......@@ -3540,6 +3536,7 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
}
#endif
#if CONFIG_LOOP_RESTORATION
av1_pick_filter_restoration(cpi->Source, cpi, cpi->sf.lpf_pick);
if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[2].frame_restoration_type != RESTORE_NONE) {
......
......@@ -159,7 +159,6 @@ int av1_search_filter_level(const YV12_BUFFER_CONFIG *sd, AV1_COMP *cpi,
return filt_best;
}
#if !CONFIG_LOOP_RESTORATION
void av1_pick_filter_level(const YV12_BUFFER_CONFIG *sd, AV1_COMP *cpi,
LPF_PICK_METHOD method) {
AV1_COMMON *const cm = &cpi->common;
......@@ -210,4 +209,3 @@ void av1_pick_filter_level(const YV12_BUFFER_CONFIG *sd, AV1_COMP *cpi,
lf->filter_level = 0;
#endif // CONFIG_EXT_TILE
}
#endif // !CONFIG_LOOP_RESTORATION
This diff is collapsed.
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