History

avcodec/rangecoder: Avoid checking for the first byte on every renormalization

Michael Niedermayer committed 2 years ago

Commit 70fa8bd1 parent 83264991 file · +3 −4Browse files

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

Unified · Split

libavcodec/rangecoder.h+3−4
@@ -62,10 +62,9 @@ void ff_build_rac_states(RangeCoder *c, int factor, int max_p); · 61 unmodified lines
62static inline void renorm_encoder(RangeCoder *c)62static inline void renorm_encoder(RangeCoder *c)
63{63{
64 // FIXME: optimize64 // FIXME: optimize
65 if (c->outstanding_byte < 0) {65 if (c->low <= 0xFF00) {
66 c->outstanding_byte = c->low >> 8;66 *c->bytestream = c->outstanding_byte;
67 } else if (c->low <= 0xFF00) {67 c->bytestream += c->outstanding_byte >= 0;
68 *c->bytestream++ = c->outstanding_byte;
69 for (; c->outstanding_count; c->outstanding_count--)68 for (; c->outstanding_count; c->outstanding_count--)
70 *c->bytestream++ = 0xFF;69 *c->bytestream++ = 0xFF;
71 c->outstanding_byte = c->low >> 8;70 c->outstanding_byte = c->low >> 8;

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