History

ape: Use unsigned integer maths

This involves a division that should be a shift.

Christophe Gisquet committed 14 years ago

Commit 706b9981 parent cbc7d601 file · +2 −2Browse files

Unified · Split

libavcodec/apedec.c+2−2
@@ -393,7 +393,7 @@ static inline int range_get_symbol(APEContext *ctx, · 392 unmodified lines
393}393}
394/** @} */ // group rangecoder394/** @} */ // group rangecoder
395 395
396static inline void update_rice(APERice *rice, int x)396static inline void update_rice(APERice *rice, unsigned int x)
397{397{
398 int lim = rice->k ? (1 << (rice->k + 4)) : 0;398 int lim = rice->k ? (1 << (rice->k + 4)) : 0;
399 rice->ksum += ((x + 1) / 2) - ((rice->ksum + 16) >> 5);399 rice->ksum += ((x + 1) / 2) - ((rice->ksum + 16) >> 5);
@@ -406,7 +406,7 @@ static inline void update_rice(APERice *rice, int x) · 6 unmodified lines
406 406
407static inline int ape_decode_value(APEContext *ctx, APERice *rice)407static inline int ape_decode_value(APEContext *ctx, APERice *rice)
408{408{
409 int x, overflow;409 unsigned int x, overflow;
410 410
411 if (ctx->fileversion < 3990) {411 if (ctx->fileversion < 3990) {
412 int tmpk;412 int tmpk;

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