aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/prosumer.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-09-22 18:13:58 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-09-24 00:49:30 +0200
commitf24701b073ca5381ad1ca5d7c1ccec30c3104cf6 (patch)
treeaf09b51c3b0500ff5b8a1ac7e9a4b037b70c6b52 /libavcodec/prosumer.c
parent674727291b340f7ee8af0e2df2293e7ba4e249ba (diff)
downloadffmpeg-f24701b073ca5381ad1ca5d7c1ccec30c3104cf6.tar.gz
avcodec/prosumer: clean up loop end code 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.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/libavcodec/prosumer.c b/libavcodec/prosumer.c
index e6959bfb6c..cf2a4afbf6 100644
--- a/libavcodec/prosumer.c
+++ b/libavcodec/prosumer.c
@@ -280,36 +280,31 @@ static const uint32_t table[] = {
static void fill_elements(uint32_t idx, uint32_t shift, int size, uint32_t *e0, uint32_t *e1)
{
- uint32_t a = 1, b, g = 1, h = idx << (32 - shift);
+ uint32_t b, h = idx << (32 - shift);
for (int i = 0; i < size; i++) {
- if (!a || !g)
- break;
b = 4 * (table[2 * i + 1] & 0xF);
if (shift >= b && (h & (0xFFF00000u << (12 - b))) == (table[2 * i + 1] & 0xFFFF0000u)) {
if (table[2 * i] >> 8 == 0x80u) {
- g = 0;
+ return;
} else {
- a = 0;
*e1 = table[2 * i];
*e0 = (*e0 & 0xFFFFFFu) | (((12 + b - shift) & 0xFFFFFFFCu | 0x40u) << 22);
shift -= b;
h <<= b;
+ break;
}
}
}
- a = 1;
for (int i = 0; i < size; i++) {
- if (!a || !g)
- break;
b = 4 * (table[2 * i + 1] & 0xF);
if (shift >= b && (h & (0xFFF00000u << (12 - b))) == (table[2 * i + 1] & 0xFFFF0000u)) {
- if ((table[2 * i] >> 8) == 0x80u) {
- g = 0;
+ if (table[2 * i] >> 8 == 0x80u) {
+ return;
} else {
- a = 0;
*e1 |= table[2 * i] << 16;
*e0 = (*e0 & 0xFFFFFFu) | (((12 + b - shift) & 0xFFFFFFFCu | 0x80u) << 22);
+ break;
}
}
}