Commit 0a9148ea authored by Taoran Lu's avatar Taoran Lu
Browse files

change as suggested

parent 125b9c43
......@@ -448,7 +448,12 @@ void AreaBuf<Pel>::scaleSignal(const int scale, const bool dir, const ClpRng& cl
{
sign = src[x] >= 0 ? 1 : -1;
absval = sign * src[x];
dst[x] = (Pel)Clip3(-maxAbsclipBD, maxAbsclipBD, sign * ((absval * scale + (1 << (CSCALE_FP_PREC - 1))) >> CSCALE_FP_PREC));
int val = sign * ((absval * scale + (1 << (CSCALE_FP_PREC - 1))) >> CSCALE_FP_PREC);
if (sizeof(Pel) == 2) // avoid overflow when storing data
{
val = Clip3<int>(-32768, 32767, val);
}
dst[x] = (Pel)val;
}
dst += stride;
src += stride;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment