History

avcodec/rangecoder: eliminate main branch from renorm_encoder()

Michael Niedermayer committed 2 years ago

Commit b2da4c31 parent 18922f41 file · +4 −9Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/rangecoder.h+4−9
@@ -61,17 +61,12 @@ void ff_build_rac_states(RangeCoder *c, int factor, int max_p); · 60 unmodified lines
61 61
62static inline void renorm_encoder(RangeCoder *c)62static inline void renorm_encoder(RangeCoder *c)
63{63{
64 // FIXME: optimize64 if (c->low - 0xFF01 >= 0x10000 - 0xFF01U) {
65 if (c->low <= 0xFF00) {65 int mask = c->low - 0xFF01 >> 31;
66 *c->bytestream = c->outstanding_byte;66 *c->bytestream = c->outstanding_byte + 1 + mask;
67 c->bytestream += c->outstanding_byte >= 0;67 c->bytestream += c->outstanding_byte >= 0;
68 for (; c->outstanding_count; c->outstanding_count--)68 for (; c->outstanding_count; c->outstanding_count--)
69 *c->bytestream++ = 0xFF;69 *c->bytestream++ = mask;
70 c->outstanding_byte = c->low >> 8;
71 } else if (c->low >= 0x10000) {
72 *c->bytestream++ = c->outstanding_byte + 1;
73 for (; c->outstanding_count; c->outstanding_count--)
74 *c->bytestream++ = 0x00;
75 c->outstanding_byte = c->low >> 8;70 c->outstanding_byte = c->low >> 8;
76 } else {71 } else {
77 c->outstanding_count++;72 c->outstanding_count++;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t