mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
lavu/riscv: fix off-by-one in bit-magnitude clip
This commit is contained in:
parent
a2c6bf2314
commit
6df3ad9687
@ -61,8 +61,8 @@ static av_always_inline av_const int32_t av_clipl_int32_rvi(int64_t a)
|
||||
#define av_clip_intp2 av_clip_intp2_rvi
|
||||
static av_always_inline av_const int av_clip_intp2_rvi(int a, int p)
|
||||
{
|
||||
const int shift = 32 - p;
|
||||
int b = (a << shift) >> shift;
|
||||
const int shift = 31 - p;
|
||||
int b = ((int)(((unsigned)a) << shift)) >> shift;
|
||||
|
||||
if (a != b)
|
||||
b = (a >> 31) ^ ((1 << p) - 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user