Commit 76405206 authored by Rupert Swarbrick's avatar Rupert Swarbrick Committed by Debargha Mukherjee

Move loop restoration reset into a helper function

This seems a little cleaner than having the loop open coded in four
places.

Change-Id: I2ce7be2745ba3575f618d9e261ab767d10f551f7
parent b394bfec
......@@ -160,6 +160,15 @@ void av1_reset_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col,
}
}
#if CONFIG_LOOP_RESTORATION
void av1_reset_loop_restoration(MACROBLOCKD *xd) {
for (int p = 0; p < MAX_MB_PLANE; ++p) {
set_default_wiener(xd->wiener_info + p);
set_default_sgrproj(xd->sgrproj_info + p);
}
}
#endif // CONFIG_LOOP_RESTORATION
void av1_setup_block_planes(MACROBLOCKD *xd, int ss_x, int ss_y) {
int i;
......
......@@ -1233,6 +1233,10 @@ static INLINE TX_SIZE av1_get_tx_size(int plane, const MACROBLOCKD *xd) {
void av1_reset_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col,
BLOCK_SIZE bsize);
#if CONFIG_LOOP_RESTORATION
void av1_reset_loop_restoration(MACROBLOCKD *xd);
#endif // CONFIG_LOOP_RESTORATION
typedef void (*foreach_transformed_block_visitor)(int plane, int block,
int blk_row, int blk_col,
BLOCK_SIZE plane_bsize,
......
......@@ -2303,10 +2303,7 @@ static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data,
av1_zero_above_context(cm, tile_info.mi_col_start, tile_info.mi_col_end);
#endif
#if CONFIG_LOOP_RESTORATION
for (int p = 0; p < MAX_MB_PLANE; ++p) {
set_default_wiener(td->xd.wiener_info + p);
set_default_sgrproj(td->xd.sgrproj_info + p);
}
av1_reset_loop_restoration(&td->xd);
#endif // CONFIG_LOOP_RESTORATION
#if CONFIG_LOOPFILTERING_ACROSS_TILES
......
......@@ -3123,10 +3123,7 @@ static uint32_t write_tiles(AV1_COMP *const cpi, uint8_t *const dst,
#endif
mode_bc.allow_update_cdf = !cm->large_scale_tile;
#if CONFIG_LOOP_RESTORATION
for (int p = 0; p < MAX_MB_PLANE; ++p) {
set_default_wiener(cpi->td.mb.e_mbd.wiener_info + p);
set_default_sgrproj(cpi->td.mb.e_mbd.sgrproj_info + p);
}
av1_reset_loop_restoration(&cpi->td.mb.e_mbd);
#endif // CONFIG_LOOP_RESTORATION
aom_start_encode(&mode_bc, buf->data + data_offset);
......@@ -3310,10 +3307,7 @@ static uint32_t write_tiles(AV1_COMP *const cpi, uint8_t *const dst,
#endif // CONFIG_ANS
mode_bc.allow_update_cdf = 1;
#if CONFIG_LOOP_RESTORATION
for (int p = 0; p < MAX_MB_PLANE; ++p) {
set_default_wiener(cpi->td.mb.e_mbd.wiener_info + p);
set_default_sgrproj(cpi->td.mb.e_mbd.sgrproj_info + p);
}
av1_reset_loop_restoration(&cpi->td.mb.e_mbd);
#endif // CONFIG_LOOP_RESTORATION
aom_start_encode(&mode_bc, dst + total_size);
......@@ -4884,10 +4878,7 @@ static uint32_t write_tiles_in_tg_obus(AV1_COMP *const cpi, uint8_t *const dst,
#endif // CONFIG_ANS
mode_bc.allow_update_cdf = 1;
#if CONFIG_LOOP_RESTORATION
for (int p = 0; p < MAX_MB_PLANE; ++p) {
set_default_wiener(cpi->td.mb.e_mbd.wiener_info + p);
set_default_sgrproj(cpi->td.mb.e_mbd.sgrproj_info + p);
}
av1_reset_loop_restoration(&cpi->td.mb.e_mbd);
#endif // CONFIG_LOOP_RESTORATION
aom_start_encode(&mode_bc, dst + total_size);
......
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