Commits on Source (2)
-
Multiply two vec2 directly instead of multiplying their components separately.
893aa567 -
The input picture may contain padding, for two reasons: 1. the rectangle defined by the picture_t offset and visible width and height may not cover the whole picture size; 2. if the OpenGL API does not support NPOT textures, textures are created with power-of-two dimensions. As a consequence, for sampling, the coordinates (between 0 and 1 in both dimensions) must be transformed to take the padding into account. These transformations were computed and performed per-plane. Therefore, there were _n_ "TexCoordsMaps" matrices for a picture with _n_ planes. However, these transformations are necessarily the same for all planes: 1. the picture_t offset/sizes are defined for the whole picture (then scaled appropriately for each plane); 2. since the ratio between different planes of the same pictures is always a power of two (e.g. in YUV 4:2:0, the size of U and V planes are half the size of the Y plane in both dimensions), this property holds even if we align the dimensions of each plane texture to the next power-of-two. Therefore, use a single transformation matrix.
499b7ef7