The problem was caused by if the width of the processed block minus 1 is a multiple of the aligned number the instruction jle .bscale_scalar would skip the Optimized Loop Step, which will lead to an incorrect sampling when specifying steps more than 1. Move the Optimized Loop Step after .bscale_scalar to ensure the loop step is enabled.
Unified · Split
| @@ -524,9 +524,8 @@ cglobal horiz_slice, 4, 9, 9, ptr, width, height, steps, nu, bscale, x, y, step, · 523 unmodified lines | ||
| 524 | 524 | cmp xq, 0 |
| 525 | 525 | jg .loop_x_scalar |
| 526 | 526 | |
| 527 | − OPTIMIZED_LOOP_STEP | |
| 528 | − | |
| 529 | 527 | .bscale_scalar: |
| 528 | + OPTIMIZED_LOOP_STEP | |
| 530 | 529 | sub ptrq, 4 |
| 531 | 530 | sub localbufq, mmsize |
| 532 | 531 | mulps m3, m1 |