summaryrefslogtreecommitdiff
path: root/libavcodec/cook.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-21 15:46:38 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-21 15:50:03 +0100
commit114a2eb272077b68bc8e0f2ee8fd6fc85a8e07c2 (patch)
treed11ce3dc892c86e032185994f596cd7edbdf5f44 /libavcodec/cook.c
parentd301a13427d970671258593ef14dc87f8e24555a (diff)
downloadffmpeg-114a2eb272077b68bc8e0f2ee8fd6fc85a8e07c2.tar.gz
avcodec: Use av_clip_uintp2() where possible
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cook.c')
-rw-r--r--libavcodec/cook.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index 3d3bb94640..02ac0e0b7d 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -418,7 +418,7 @@ static void categorize(COOKContext *q, COOKSubpacket *p, const int *quant_index_
num_bits = 0;
index = 0;
for (j = p->total_subbands; j > 0; j--) {
- exp_idx = av_clip((i - quant_index_table[index] + bias) / 2, 0, 7);
+ exp_idx = av_clip_uintp2((i - quant_index_table[index] + bias) / 2, 3);
index++;
num_bits += expbits_tab[exp_idx];
}
@@ -429,7 +429,7 @@ static void categorize(COOKContext *q, COOKSubpacket *p, const int *quant_index_
/* Calculate total number of bits. */
num_bits = 0;
for (i = 0; i < p->total_subbands; i++) {
- exp_idx = av_clip((bias - quant_index_table[i]) / 2, 0, 7);
+ exp_idx = av_clip_uintp2((bias - quant_index_table[i]) / 2, 3);
num_bits += expbits_tab[exp_idx];
exp_index1[i] = exp_idx;
exp_index2[i] = exp_idx;