Commit 35ee2345 authored by Yaowu Xu's avatar Yaowu Xu

Disable in-loop filtering for single_tile_decoding

BUG=aomedia:1014

Change-Id: I8846432861e9859a00f702407a82d4223c093fe2
parent c1077e9c
......@@ -1747,7 +1747,24 @@ static void read_tile_info(AV1Decoder *const pbi,
#else
const int no_loopfilter = !lf->filter_level;
#endif
cm->single_tile_decoding = no_loopfilter ? 1 : 0;
#if CONFIG_CDEF
const int no_cdef = cm->cdef_bits == 0 && cm->cdef_strengths[0] == 0 &&
cm->nb_cdef_strengths == 1;
#endif
#if CONFIG_LOOP_RESTORATION
const int no_restoration =
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;
#endif
cm->single_tile_decoding = no_loopfilter
#if CONFIG_CDEF
&& no_cdef
#endif
#if CONFIG_LOOP_RESTORATION
&& no_restoration
#endif
;
// Read the tile width/height
#if CONFIG_EXT_PARTITION
if (cm->sb_size == BLOCK_128X128) {
......
......@@ -4610,14 +4610,25 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
MACROBLOCKD *xd = &cpi->td.mb.e_mbd;
struct loopfilter *lf = &cm->lf;
int no_loopfilter = 0;
if (is_lossless_requested(&cpi->oxcf)) no_loopfilter = 1;
#if CONFIG_CDEF
int no_cdef = 0;
#endif
#if CONFIG_LOOP_RESTORATION
int no_restoration = 0;
#endif
if (is_lossless_requested(&cpi->oxcf)
#if CONFIG_EXT_TILE
// 0 loopfilter level is only necessary if individual tile
// decoding is required.
if (cm->single_tile_decoding) no_loopfilter = 1;
#endif // CONFIG_EXT_TILE
|| cm->single_tile_decoding
#endif
) {
no_loopfilter = 1;
#if CONFIG_CDEF
no_cdef = 1;
#endif
#if CONFIG_LOOP_RESTORATION
no_restoration = 1;
#endif
}
if (no_loopfilter) {
#if CONFIG_LOOPFILTER_LEVEL
......@@ -4675,11 +4686,12 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
#if CONFIG_FRAME_SUPERRES && CONFIG_HORZONLY_FRAME_SUPERRES
if (!av1_superres_unscaled(cm)) aom_extend_frame_borders(cm->frame_to_show);
#endif
av1_loop_restoration_save_boundary_lines(cm->frame_to_show, cm, 0);
if (!no_restoration)
av1_loop_restoration_save_boundary_lines(cm->frame_to_show, cm, 0);
#endif
#if CONFIG_CDEF
if (is_lossless_requested(&cpi->oxcf)) {
if (no_cdef) {
cm->cdef_bits = 0;
cm->cdef_strengths[0] = 0;
cm->nb_cdef_strengths = 1;
......@@ -4698,13 +4710,19 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
#endif // CONFIG_FRAME_SUPERRES
#if CONFIG_LOOP_RESTORATION
av1_loop_restoration_save_boundary_lines(cm->frame_to_show, cm, 1);
av1_pick_filter_restoration(cpi->source, cpi);
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_filter_frame(cm->frame_to_show, cm, cm->rst_info, 7,
NULL);
if (no_restoration) {
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;
} else {
av1_loop_restoration_save_boundary_lines(cm->frame_to_show, cm, 1);
av1_pick_filter_restoration(cpi->source, cpi);
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_filter_frame(cm->frame_to_show, cm, cm->rst_info, 7,
NULL);
}
}
#endif // CONFIG_LOOP_RESTORATION
// TODO(debargha): Fix mv search range on encoder side
......
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