Compiler warning fixes related to NEW_TX_PARTITION
- When CONFIG_NEW_TX_PARTITION is on: remove unused variables like
`block` etc. Clang 14 was generating a warning for this.
- When CONFIG_NEW_TX_PARTITION is off: remove a duplicate function
definition. Clang and GCC were both warning about this.
diff --git a/av1/common/blockd.h b/av1/common/blockd.h
index 092c8d5..ae8568a 100644
--- a/av1/common/blockd.h
+++ b/av1/common/blockd.h
@@ -2849,6 +2849,7 @@
while (tx_size != ctx_size) {
depth++;
ctx_size = sub_tx_size_map[ctx_size];
+ assert(depth <= MAX_TX_DEPTH);
}
return depth;
}
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index d9c62cb..24669d3 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -360,10 +360,16 @@
dcb->cb_offset[plane] / (TX_SIZE_W_MIN * TX_SIZE_H_MIN);
}
-static AOM_INLINE void decode_reconstruct_tx(
- AV1_COMMON *cm, ThreadData *const td, aom_reader *r,
- MB_MODE_INFO *const mbmi, int plane, BLOCK_SIZE plane_bsize, int blk_row,
- int blk_col, int block, TX_SIZE tx_size, int *eob_total) {
+static AOM_INLINE void decode_reconstruct_tx(AV1_COMMON *cm,
+ ThreadData *const td,
+ aom_reader *r,
+ MB_MODE_INFO *const mbmi,
+ int plane, BLOCK_SIZE plane_bsize,
+ int blk_row, int blk_col,
+#if !CONFIG_NEW_TX_PARTITION
+ int block,
+#endif // !CONFIG_NEW_TX_PARTITION
+ TX_SIZE tx_size, int *eob_total) {
DecoderCodingBlock *const dcb = &td->dcb;
MACROBLOCKD *const xd = &dcb->xd;
#if CONFIG_CROSS_CHROMA_TX
@@ -437,7 +443,6 @@
const TX_SIZE sub_tx = sub_txs[cur_partition];
bsw = tx_size_wide_unit[sub_tx];
bsh = tx_size_high_unit[sub_tx];
- const int sub_step = bsw * bsh;
const int offsetr = blk_row + row;
const int offsetc = blk_col + col;
if (offsetr >= max_blocks_high || offsetc >= max_blocks_wide) continue;
@@ -449,7 +454,6 @@
eob_info *eob_data = dcb->eob_data[plane] + dcb->txb_offset[plane];
*eob_total += eob_data->eob;
set_cb_buffer_offsets(dcb, sub_tx, plane);
- block += sub_step;
cur_partition++;
}
}
@@ -1495,9 +1499,11 @@
get_vartx_max_txsize(xd, plane_bsize, plane);
const int bh_var_tx = tx_size_high_unit[max_tx_size];
const int bw_var_tx = tx_size_wide_unit[max_tx_size];
+#if !CONFIG_NEW_TX_PARTITION
int block = 0;
int step =
tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size];
+#endif // !CONFIG_NEW_TX_PARTITION
const int plane_unit_height =
get_plane_tx_unit_height(xd, plane_bsize, plane, row, ss_y);
const int plane_unit_width =
@@ -1508,9 +1514,14 @@
for (int blk_col = col >> ss_x; blk_col < plane_unit_width;
blk_col += bw_var_tx) {
decode_reconstruct_tx(cm, td, r, mbmi, plane, plane_bsize,
- blk_row, blk_col, block, max_tx_size,
- &eobtotal);
+ blk_row, blk_col,
+#if !CONFIG_NEW_TX_PARTITION
+ block,
+#endif // !CONFIG_NEW_TX_PARTITION
+ max_tx_size, &eobtotal);
+#if !CONFIG_NEW_TX_PARTITION
block += step;
+#endif // !CONFIG_NEW_TX_PARTITION
}
}
}
diff --git a/av1/encoder/block.h b/av1/encoder/block.h
index c9f7d49..a2a7024 100644
--- a/av1/encoder/block.h
+++ b/av1/encoder/block.h
@@ -1669,19 +1669,6 @@
!xd->lossless[mbmi->segment_id];
}
-#if !CONFIG_NEW_TX_PARTITION
-static INLINE int tx_size_to_depth(TX_SIZE tx_size, BLOCK_SIZE bsize) {
- TX_SIZE ctx_size = max_txsize_rect_lookup[bsize];
- int depth = 0;
- while (tx_size != ctx_size) {
- depth++;
- ctx_size = sub_tx_size_map[ctx_size];
- assert(depth <= MAX_TX_DEPTH);
- }
- return depth;
-}
-#endif
-
static INLINE void set_blk_skip(uint8_t txb_skip[], int plane, int blk_idx,
int skip) {
if (skip)