loopfilter: simplify loop increment Reported by Monty Montgomery Change-Id: Ic1547839ab8b9cce3041312a16a9570544e2759c
diff --git a/av1/common/av1_loopfilter.c b/av1/common/av1_loopfilter.c index 0ed09b5..c12684a 100644 --- a/av1/common/av1_loopfilter.c +++ b/av1/common/av1_loopfilter.c
@@ -346,7 +346,6 @@ const MACROBLOCKD *const xd, const int plane, const MACROBLOCKD_PLANE *const plane_ptr, const uint32_t mi_row, const uint32_t mi_col) { - const int row_step = MI_SIZE >> MI_SIZE_LOG2; const uint32_t scale_horz = plane_ptr->subsampling_x; const uint32_t scale_vert = plane_ptr->subsampling_y; uint8_t *const dst_ptr = plane_ptr->dst.buf; @@ -355,7 +354,7 @@ const int x_range = (MAX_MIB_SIZE >> scale_horz); const int use_highbitdepth = cm->seq_params.use_highbitdepth; const aom_bit_depth_t bit_depth = cm->seq_params.bit_depth; - for (int y = 0; y < y_range; y += row_step) { + for (int y = 0; y < y_range; y++) { uint8_t *p = dst_ptr + y * MI_SIZE * dst_stride; for (int x = 0; x < x_range;) { // inner loop always filter vertical edges in a MI block. If MI size @@ -433,7 +432,6 @@ const MACROBLOCKD *const xd, const int plane, const MACROBLOCKD_PLANE *const plane_ptr, const uint32_t mi_row, const uint32_t mi_col) { - const int col_step = MI_SIZE >> MI_SIZE_LOG2; const uint32_t scale_horz = plane_ptr->subsampling_x; const uint32_t scale_vert = plane_ptr->subsampling_y; uint8_t *const dst_ptr = plane_ptr->dst.buf; @@ -442,7 +440,7 @@ const int x_range = (MAX_MIB_SIZE >> scale_horz); const int use_highbitdepth = cm->seq_params.use_highbitdepth; const aom_bit_depth_t bit_depth = cm->seq_params.bit_depth; - for (int x = 0; x < x_range; x += col_step) { + for (int x = 0; x < x_range; x++) { uint8_t *p = dst_ptr + x * MI_SIZE; for (int y = 0; y < y_range;) { // inner loop always filter vertical edges in a MI block. If MI size @@ -524,14 +522,13 @@ const MACROBLOCKD_PLANE *const plane_ptr, const uint32_t mi_row, const uint32_t mi_col) { - const int row_step = MI_SIZE >> MI_SIZE_LOG2; const uint32_t scale_horz = plane_ptr->subsampling_x; const uint32_t scale_vert = plane_ptr->subsampling_y; uint8_t *const dst_ptr = plane_ptr->dst.buf; const int dst_stride = plane_ptr->dst.stride; const int y_range = cm->mi_rows >> scale_vert; const int x_range = cm->mi_cols >> scale_horz; - for (int y = 0; y < y_range; y += row_step) { + for (int y = 0; y < y_range; y++) { uint8_t *p = dst_ptr + y * MI_SIZE * dst_stride; for (int x = 0; x < x_range;) { // inner loop always filter vertical edges in a MI block. If MI size @@ -567,14 +564,13 @@ const MACROBLOCKD_PLANE *const plane_ptr, const uint32_t mi_row, const uint32_t mi_col) { - const int col_step = MI_SIZE >> MI_SIZE_LOG2; const uint32_t scale_horz = plane_ptr->subsampling_x; const uint32_t scale_vert = plane_ptr->subsampling_y; uint8_t *const dst_ptr = plane_ptr->dst.buf; const int dst_stride = plane_ptr->dst.stride; const int y_range = cm->mi_rows >> scale_vert; const int x_range = cm->mi_cols >> scale_horz; - for (int x = 0; x < x_range; x += col_step) { + for (int x = 0; x < x_range; x++) { uint8_t *p = dst_ptr + x * MI_SIZE; for (int y = 0; y < y_range;) { // inner loop always filter vertical edges in a MI block. If MI size
diff --git a/av1/common/loopfiltermask.c b/av1/common/loopfiltermask.c index 41d5186..0b68679 100644 --- a/av1/common/loopfiltermask.c +++ b/av1/common/loopfiltermask.c
@@ -777,14 +777,13 @@ int plane) { const int subsampling_x = plane_ptr->subsampling_x; const int subsampling_y = plane_ptr->subsampling_y; - const int row_step = (MI_SIZE >> MI_SIZE_LOG2); const int is_uv = plane > 0; TX_SIZE tx_size = TX_16X16, prev_tx_size = TX_16X16; uint8_t level, prev_level = 1; uint64_t skip, prev_skip = 0; uint64_t is_coding_block_border; - for (int r = 0; (r << MI_SIZE_LOG2) < plane_ptr->dst.height; r += row_step) { + for (int r = 0; (r << MI_SIZE_LOG2) < plane_ptr->dst.height; r++) { const int mi_row = r << subsampling_y; const int row = mi_row % MI_SIZE_64X64; const int row_uv = row | subsampling_y; @@ -856,14 +855,13 @@ int plane) { const int subsampling_x = plane_ptr->subsampling_x; const int subsampling_y = plane_ptr->subsampling_y; - const int col_step = (MI_SIZE >> MI_SIZE_LOG2); const int is_uv = plane > 0; TX_SIZE tx_size = TX_16X16, prev_tx_size = TX_16X16; uint8_t level, prev_level = 1; uint64_t skip, prev_skip = 0; uint64_t is_coding_block_border; - for (int c = 0; (c << MI_SIZE_LOG2) < plane_ptr->dst.width; c += col_step) { + for (int c = 0; (c << MI_SIZE_LOG2) < plane_ptr->dst.width; c++) { const int mi_col = c << subsampling_x; const int col = mi_col % MI_SIZE_64X64; const int col_uv = col | subsampling_x;