diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-06-25 22:39:57 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-06-25 22:39:57 +0400 |
commit | 8176bd1a4689ff08b0e85984563ad8288110f1a7 (patch) | |
tree | 98b15eb8f103753d155bda7261bd3a850bd45ddd /tests/tiny_psnr.c | |
parent | 57c4d4051e145586ccb35e66a7d1a793cc42b48f (diff) |
overflow fix
Originally committed as revision 3250 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'tests/tiny_psnr.c')
-rw-r--r-- | tests/tiny_psnr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/tiny_psnr.c b/tests/tiny_psnr.c index 84ad90ebce..572dd27558 100644 --- a/tests/tiny_psnr.c +++ b/tests/tiny_psnr.c @@ -68,9 +68,10 @@ static uint64_t log16(uint64_t a){ a<<=16; for(i=19;i>=0;i--){ - if(a<(exp16_table[i]<<16)) continue; + int64_t b= exp16_table[i]; + if(a<(b<<16)) continue; out |= 1<<i; - a = ((a<<16) + exp16_table[i]/2)/exp16_table[i]; + a = ((a/b)<<16) + (((a%b)<<16) + b/2)/b; } return out; } |