The reason this is happening is that the rotation matrix calculation is only valid for the 2D coordinate system where y axis is 90 degrees counterclockwise from x axis, but the coordinate system of chroma offset has its origin at top-left so it is the opposite, which results in the rotation going to the opposite way. Setting flip=true fixes the rotation direction, but results in a flipped y coordinate.
Fix this by reversing the rotation angle for chroma offset rotation matrix calculation. This also allows removing some duplicated code.
https://github.com/mpv-player/mpv/commit/82231fd74d173fb47845dd086d360bceb3e5fc17 mentioned that for the "rot" transform flip=true must be set, which "makes no sense at all".
The reason this is happening is that the rotation matrix calculation is only valid for the 2D coordinate system where y axis is 90 degrees counterclockwise from x axis, but the coordinate system of chroma offset has its origin at top-left so it is the opposite, which results in the rotation going to the opposite way. Setting flip=true fixes the rotation direction, but results in a flipped y coordinate.
Fix this by reversing the rotation angle for chroma offset rotation matrix calculation. This also allows removing some duplicated code.
Fixes: https://github.com/mpv-player/mpv/issues/15288