30.3.3. Filter Behavior at Edge Boundaries
When scaling pixels around the top, bottom, left or right edges (boundaries) of the image, the filter taps above, below, to the left of or to the right of the center pixel naturally attempt to sample pixels that do not exist as they are in off-screen locations. To avoid using undefined data in these taps, the scaler detects when any tap is off-screen and replaces the data in that tap with data from an on-screen pixel. The Edge behavior parameter allows you to choose between two methods for filling the off-screen taps:
- Replicate edge pixels. The IP replicates the pixel closest to the edge to fill all off-screen taps
- Mirror edge pixels. The pixels leading up to the image edge reflect into the off-screen area, just as if a mirror is at the edge of the image. The reflected pixel values fill any off-screen taps.
Edge mirroring for a filter with N taps requires a minimum input image size of N/2 pixels to successfully fill all off-screen taps. Input images smaller than this minimum create undefined outputs. Edge replication works for all image sizes, down to 1x1 pixel. You cannot swap between edge methods at runtime.
You can only select this parameter if you select Polyphase scaling. Nearest neighbor scaling has no filter and no off-screen taps. Bilinear scaling requires a 2 tap filter, but edge replication and edge mirroring give the same result when the number of taps is 2, so the parameter is not required.