diff --git a/av1/common/resize.h b/av1/common/resize.h index e54eff8dba78ac5b16299ee10bb0ec732e970f81..18a7712e1478995c439d92381a2947318265e384 100644 --- a/av1/common/resize.h +++ b/av1/common/resize.h @@ -100,14 +100,13 @@ static INLINE int av1_superres_unscaled(const AV1_COMMON *cm) { } #endif // CONFIG_HORZONLY_FRAME_SUPERRES -#if CONFIG_HORZONLY_FRAME_SUPERRES && CONFIG_LOOP_RESTORATION +#if CONFIG_HORZONLY_FRAME_SUPERRES #define UPSCALE_NORMATIVE_TAPS 8 - extern const int16_t av1_resize_filter_normative[1 << RS_SUBPEL_BITS] [UPSCALE_NORMATIVE_TAPS]; int32_t av1_get_upscale_convolve_step(int in_length, int out_length); -#endif // CONFIG_HORZONLY_FRAME_SUPERRES && CONFIG_LOOP_RESTORATION +#endif // CONFIG_HORZONLY_FRAME_SUPERRES #ifdef __cplusplus } // extern "C" diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c index 71a440db5c0d56a2d3e77a748333484cc2d4b7b5..8292fd8346a71ae42560e57393886f13f9143672 100644 --- a/av1/decoder/decodeframe.c +++ b/av1/decoder/decodeframe.c @@ -602,7 +602,6 @@ static void decode_partition(AV1Decoder *const pbi, MACROBLOCKD *const xd, int mi_row, int mi_col, aom_reader *r, BLOCK_SIZE bsize) { AV1_COMMON *const cm = &pbi->common; - const int num_planes = av1_num_planes(cm); const int num_8x8_wh = mi_size_wide[bsize]; const int hbs = num_8x8_wh >> 1; PARTITION_TYPE partition; @@ -617,6 +616,7 @@ static void decode_partition(AV1Decoder *const pbi, MACROBLOCKD *const xd, if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) return; #if CONFIG_LOOP_RESTORATION + const int num_planes = av1_num_planes(cm); for (int plane = 0; plane < num_planes; ++plane) { int rcol0, rcol1, rrow0, rrow1, tile_tl_idx; if (av1_loop_restoration_corners_in_sb(cm, plane, mi_row, mi_col, bsize, @@ -3567,11 +3567,13 @@ void av1_decode_tg_tiles_and_wrapup(AV1Decoder *pbi, const uint8_t *data, return; } +#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_save_boundary_lines(&pbi->cur_buf->buf, cm, 0); } +#endif // CONFIG_LOOP_RESTORATION if (!cm->skip_loop_filter && #if CONFIG_INTRABC diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c index 0ffea21f255145d43a652c00e5bd24910cfb2f24..edeebe2740f63ae92edd4e892e10107ab3024550 100644 --- a/av1/encoder/bitstream.c +++ b/av1/encoder/bitstream.c @@ -2028,7 +2028,6 @@ static void write_modes_sb(AV1_COMP *const cpi, const TileInfo *const tile, const TOKENEXTRA *const tok_end, int mi_row, int mi_col, BLOCK_SIZE bsize) { const AV1_COMMON *const cm = &cpi->common; - const int num_planes = av1_num_planes(cm); MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; const int hbs = mi_size_wide[bsize] / 2; #if CONFIG_EXT_PARTITION_TYPES @@ -2041,6 +2040,7 @@ static void write_modes_sb(AV1_COMP *const cpi, const TileInfo *const tile, if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) return; #if CONFIG_LOOP_RESTORATION + const int num_planes = av1_num_planes(cm); for (int plane = 0; plane < num_planes; ++plane) { int rcol0, rcol1, rrow0, rrow1, tile_tl_idx; if (av1_loop_restoration_corners_in_sb(cm, plane, mi_row, mi_col, bsize, @@ -4608,7 +4608,6 @@ static uint32_t write_tiles_in_tg_obus(AV1_COMP *const cpi, uint8_t *const dst, int insert_frame_header_obu_flag, uint8_t obu_extension_header) { AV1_COMMON *const cm = &cpi->common; - const int num_planes = av1_num_planes(cm); aom_writer mode_bc; int tile_row, tile_col; TOKENEXTRA *(*const tok_buffers)[MAX_TILE_COLS] = cpi->tile_tok; @@ -4807,6 +4806,7 @@ static uint32_t write_tiles_in_tg_obus(AV1_COMP *const cpi, uint8_t *const dst, cpi->td.mb.e_mbd.tile_ctx = &this_tile->tctx; mode_bc.allow_update_cdf = 1; #if CONFIG_LOOP_RESTORATION + const int num_planes = av1_num_planes(cm); av1_reset_loop_restoration(&cpi->td.mb.e_mbd, num_planes); #endif // CONFIG_LOOP_RESTORATION diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c index 3c33146fa304d661eeb1dad927a3ffc5109da130..0ed1d0f71e3784af6258d855e6c14016f6bc09bb 100644 --- a/av1/encoder/encoder.c +++ b/av1/encoder/encoder.c @@ -5227,8 +5227,10 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) { #endif // CONFIG_LOOPFILTER_LEVEL } +#if CONFIG_LOOP_RESTORATION if (!no_restoration) av1_loop_restoration_save_boundary_lines(cm->frame_to_show, cm, 0); +#endif // CONFIG_LOOP_RESTORATION if (no_cdef) { cm->cdef_bits = 0;