Remove unneeded clamping of y to max_y

Change-Id: If02f0e789757e156737ea3cf8ffb822b7e8a938a
This commit is contained in:
Wan-Teh Chang 2026-07-23 18:42:06 -07:00
parent b56492e2df
commit c5ed3eef61
3 changed files with 12 additions and 24 deletions

View File

@ -1133,11 +1133,11 @@ static int ScalePlaneBilinearDown(int src_width,
}
}
#endif
if (y > max_y) {
y = max_y;
}
for (j = 0; j < dst_height; ++j) {
if (y > max_y) {
y = max_y;
}
int yi = y >> 16;
const uint8_t* src = src_ptr + yi * src_stride;
if (filtering == kFilterLinear) {
@ -1149,9 +1149,6 @@ static int ScalePlaneBilinearDown(int src_width,
}
dst_ptr += dst_stride;
y += dy;
if (y > max_y) {
y = max_y;
}
}
free_aligned_buffer_64(row);
return 0;
@ -1224,11 +1221,11 @@ static int ScalePlaneBilinearDown_16(int src_width,
ScaleFilterCols = ScaleFilterCols_16_SSSE3;
}
#endif
if (y > max_y) {
y = max_y;
}
for (j = 0; j < dst_height; ++j) {
if (y > max_y) {
y = max_y;
}
int yi = y >> 16;
const uint16_t* src = src_ptr + yi * src_stride;
if (filtering == kFilterLinear) {
@ -1240,9 +1237,6 @@ static int ScalePlaneBilinearDown_16(int src_width,
}
dst_ptr += dst_stride;
y += dy;
if (y > max_y) {
y = max_y;
}
}
free_aligned_buffer_64(row);
return 0;

View File

@ -400,10 +400,10 @@ static int ScaleARGBBilinearDown(int src_width,
return 1;
const int max_y = (src_height - 1) << 16;
if (y > max_y) {
y = max_y;
}
for (j = 0; j < dst_height; ++j) {
if (y > max_y) {
y = max_y;
}
int yi = y >> 16;
const uint8_t* src = src_argb + yi * src_stride;
if (filtering == kFilterLinear) {
@ -415,9 +415,6 @@ static int ScaleARGBBilinearDown(int src_width,
}
dst_argb += dst_stride;
y += dy;
if (y > max_y) {
y = max_y;
}
}
free_aligned_buffer_64(row);
}

View File

@ -418,10 +418,10 @@ static int ScaleUVBilinearDown(int src_width,
align_buffer_64(row, clip_src_width * 2);
if (!row)
return 1;
if (y > max_y) {
y = max_y;
}
for (j = 0; j < dst_height; ++j) {
if (y > max_y) {
y = max_y;
}
int yi = y >> 16;
const uint8_t* src = src_uv + yi * src_stride;
if (filtering == kFilterLinear) {
@ -433,9 +433,6 @@ static int ScaleUVBilinearDown(int src_width,
}
dst_uv += dst_stride;
y += dy;
if (y > max_y) {
y = max_y;
}
}
free_aligned_buffer_64(row);
}