mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-04 19:48:19 +00:00
avcodec/rangecoder: eliminate main branch from renorm_encoder()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
18922f4ae3
commit
b2da4c33e3
@ -61,17 +61,12 @@ void ff_build_rac_states(RangeCoder *c, int factor, int max_p);
|
|||||||
|
|
||||||
static inline void renorm_encoder(RangeCoder *c)
|
static inline void renorm_encoder(RangeCoder *c)
|
||||||
{
|
{
|
||||||
// FIXME: optimize
|
if (c->low - 0xFF01 >= 0x10000 - 0xFF01U) {
|
||||||
if (c->low <= 0xFF00) {
|
int mask = c->low - 0xFF01 >> 31;
|
||||||
*c->bytestream = c->outstanding_byte;
|
*c->bytestream = c->outstanding_byte + 1 + mask;
|
||||||
c->bytestream += c->outstanding_byte >= 0;
|
c->bytestream += c->outstanding_byte >= 0;
|
||||||
for (; c->outstanding_count; c->outstanding_count--)
|
for (; c->outstanding_count; c->outstanding_count--)
|
||||||
*c->bytestream++ = 0xFF;
|
*c->bytestream++ = mask;
|
||||||
c->outstanding_byte = c->low >> 8;
|
|
||||||
} else if (c->low >= 0x10000) {
|
|
||||||
*c->bytestream++ = c->outstanding_byte + 1;
|
|
||||||
for (; c->outstanding_count; c->outstanding_count--)
|
|
||||||
*c->bytestream++ = 0x00;
|
|
||||||
c->outstanding_byte = c->low >> 8;
|
c->outstanding_byte = c->low >> 8;
|
||||||
} else {
|
} else {
|
||||||
c->outstanding_count++;
|
c->outstanding_count++;
|
||||||
|
Loading…
Reference in New Issue
Block a user