summaryrefslogtreecommitdiff
path: root/libavcodec/prosumer.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-09-22 18:14:02 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-09-24 00:49:30 +0200
commit3c9ebcbc4dceef385e20e76704bf3c2e370b9368 (patch)
treef0151c5ca548c79fc24697992eebf63847117c9b /libavcodec/prosumer.c
parentfa1d3caef0cbe24d2e74e3410495344c5aee9776 (diff)
downloadffmpeg-3c9ebcbc4dceef385e20e76704bf3c2e370b9368.tar.gz
avcodec/prosumer: Only scan as many elements as matter in fill_elements()
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/prosumer.c')
-rw-r--r--libavcodec/prosumer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/prosumer.c b/libavcodec/prosumer.c
index 9e8a94d4db..b7e417aa0b 100644
--- a/libavcodec/prosumer.c
+++ b/libavcodec/prosumer.c
@@ -279,12 +279,12 @@ static const uint16_t table[] = {
0x0001
};
-static void fill_elements(uint32_t idx, uint32_t shift, int size, uint32_t *e0, uint32_t *e1)
+static void fill_elements(uint32_t idx, uint32_t shift, uint32_t *e0, uint32_t *e1)
{
uint32_t b, h = idx << (32 - shift);
for (int j = 0; j < 2; j++) {
- for (int i = 0; i < size; i++) {
+ for (int i = 0; i < 43; i++) {
b = 4 * TB(i);
if (shift >= b && ((h & (0xFFF00000u << (12 - b))) >> 20) == table[2 * i + 1]) {
if (table[2 * i] >> 8 == 0x80u) {
@@ -322,7 +322,7 @@ static void fill_lut(uint32_t *lut)
uint32_t f = 0xFFFFFFFFu;
c &= 0xFFFFFFu;
if ((c & 0xFF00u) != 0x8000u)
- fill_elements(j, d, 365, &c, &f);
+ fill_elements(j, d, &c, &f);
lut[2 * a + 2 * j] = c;
lut[2 * a + 2 * j + 1] = f;
}