get_min_tx_size: disable -Warray-bounds

this warning is covered by an assert and other runtime detection.
expanding the array, adding a conditional or converting the type to int
are less desirable.

BUG=aomedia:578

Change-Id: Idb6a1dec5f17db85a0e9c1d0ee372e701f4e1aa4
This commit is contained in:
James Zern 2017-06-19 18:07:37 -07:00
Родитель fe06cb72ce
Коммит 5d61b60907
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -947,10 +947,20 @@ static INLINE void av1_zero_left_context(MACROBLOCKD *const xd) {
}
#if CONFIG_VAR_TX
// Disable array-bounds checks as the TX_SIZE enum contains values larger than
// TX_SIZES_ALL (TX_INVALID) which make extending the array as a workaround
// infeasible. The assert is enough for static analysis and this or other tools
// asan, valgrind would catch oob access at runtime.
#if defined(__GNUC__) && __GNUC__ >= 4
#pragma GCC diagnostic ignored "-Warray-bounds"
#endif
static INLINE TX_SIZE get_min_tx_size(TX_SIZE tx_size) {
assert(tx_size < TX_SIZES_ALL);
return txsize_sqr_map[tx_size];
}
#if defined(__GNUC__) && __GNUC__ >= 4
#pragma GCC diagnostic warning "-Warray-bounds"
#endif
static INLINE void set_txfm_ctx(TXFM_CONTEXT *txfm_ctx, uint8_t txs, int len) {
int i;