ID 683416
Date 2/12/2021
Public

## 20.2.1. Bilinear Algorithmic Description

The algorithmic operations of the bilinear method can be modeled using a frame-based method.

To find a value for an output pixel located at (i, j), we first calculate the corresponding location on the input:

The integer solutions to these equations provide the location of the top-left corner of the four input pixels to be summed.

The differences between ini , inj , and are a measure of the error in how far the top-left input pixel is from the real-valued position that we want to read from. Call these errors erri and errj . The precision of each error variable is determined by the number of fraction bits chosen by the user, Bfh and Bfv , respectively.

Their values can be calculated using the following equation:

The sum is then weighted proportionally to these errors.
Note: Because these values are measured from the top-left pixel, the weights for this pixel are one minus the error.

That is, in fixed-point precision: and

The sum is then: