diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-10-15 22:39:58 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-10-16 21:41:19 +0200 |
commit | 81a360a5ed9e7dcc841e791c2779f09cbd99b5d3 (patch) | |
tree | 31901c761f0602fc655d09614e85daa2e52425c1 /libavcodec/ffv1_template.c | |
parent | 2542e9296c76524494a2d17a4423d756560b5273 (diff) | |
download | ffmpeg-81a360a5ed9e7dcc841e791c2779f09cbd99b5d3.tar.gz |
avcodec/ffv1: add a named constant for the quant table size
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/ffv1_template.c')
-rw-r--r-- | libavcodec/ffv1_template.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/ffv1_template.c b/libavcodec/ffv1_template.c index d15ad11021..abb90a12e4 100644 --- a/libavcodec/ffv1_template.c +++ b/libavcodec/ffv1_template.c @@ -29,7 +29,7 @@ static inline int RENAME(predict)(TYPE *src, TYPE *last) return mid_pred(L, L + T - LT, T); } -static inline int RENAME(get_context)(const int16_t quant_table[MAX_CONTEXT_INPUTS][256], +static inline int RENAME(get_context)(const int16_t quant_table[MAX_CONTEXT_INPUTS][MAX_QUANT_TABLE_SIZE], TYPE *src, TYPE *last, TYPE *last2) { const int LT = last[-1]; @@ -40,14 +40,14 @@ static inline int RENAME(get_context)(const int16_t quant_table[MAX_CONTEXT_INPU if (quant_table[3][127] || quant_table[4][127]) { const int TT = last2[0]; const int LL = src[-2]; - return quant_table[0][(L - LT) & 0xFF] + - quant_table[1][(LT - T) & 0xFF] + - quant_table[2][(T - RT) & 0xFF] + - quant_table[3][(LL - L) & 0xFF] + - quant_table[4][(TT - T) & 0xFF]; + return quant_table[0][(L - LT) & MAX_QUANT_TABLE_MASK] + + quant_table[1][(LT - T) & MAX_QUANT_TABLE_MASK] + + quant_table[2][(T - RT) & MAX_QUANT_TABLE_MASK] + + quant_table[3][(LL - L) & MAX_QUANT_TABLE_MASK] + + quant_table[4][(TT - T) & MAX_QUANT_TABLE_MASK]; } else - return quant_table[0][(L - LT) & 0xFF] + - quant_table[1][(LT - T) & 0xFF] + - quant_table[2][(T - RT) & 0xFF]; + return quant_table[0][(L - LT) & MAX_QUANT_TABLE_MASK] + + quant_table[1][(LT - T) & MAX_QUANT_TABLE_MASK] + + quant_table[2][(T - RT) & MAX_QUANT_TABLE_MASK]; } |