Remove the Abs() function in source/scale_uv.cc

The Abs() function is used at two places in source/scale_uv.cc as
follows:
  src_width = Abs(src_width);

However, before we reach those two places, we have rejected
src_width <= 0 as invalid input. Therefore the two Abs(src_width) calls
have no effects.

Bug: None
Change-Id: I04c48ad5d1270b9b93abb18f2b41b90ec818d5ea
This commit is contained in:
Wan-Teh Chang 2026-10-07 15:21:20 -07:00
parent 1ddb18fb6b
commit 161e53757d

View File

@ -51,10 +51,6 @@ extern "C" {
#define HAS_SCALEPLANEVERTICAL 1
#endif
static __inline int Abs(int v) {
return v >= 0 ? v : -v;
}
#define MIN1(x) ((x) < 1 ? 1 : (x))
// ScaleUV, 1/2
@ -1154,7 +1150,6 @@ static int ScaleUV(const uint8_t* src,
}
ScaleSlope(src_width, src_height, dst_width, dst_height, filtering, &x, &y,
&dx, &dy);
src_width = Abs(src_width);
if (clip_x) {
int64_t clipf = (int64_t)(clip_x)*dx;
x += (clipf & 0xffff);
@ -1312,7 +1307,6 @@ int UVScale_16(const uint16_t* src_uv,
src_uv = src_uv + (src_height - 1) * (ptrdiff_t)src_stride_uv;
src_stride_uv = -src_stride_uv;
}
src_width = Abs(src_width);
#ifdef HAS_UVCOPY
if (!filtering && src_width == dst_width && (src_height % dst_height == 0)) {