Skip to content

v0.94 "The Invisible Face is There."

Compare
Choose a tag to compare
@AkarinVS AkarinVS released this 11 Jul 12:48
· 24 commits to master since this release

This release introduces absolute pixel access: now you can write arbitrary expression to compute the coordinate of the pixel you want to access, and the coordinate can even depend on pixel values!
Of course, such flexibility is not without performance cost, so use it carefully.

For example, the following pairs of expressions are semantically equivalent:

Static Relative Access Dynamic Absolute Access
x[2,-1]:c X 2 + Y 1 - x[]
x[-3,10]:c X 3.1 - Y 10.05 + x[]

Additional details:

  • x[] will automatically clamp the coordinates to be within their respective ranges, so if that's what you want, you can safely return negative coordinate or larger than width/height ones.
  • The coordinate is internally computed in 32-bit floating point by default (unless you use opt=1 and stick with integer constants, X/Y/width etc.), so there might some performance penalty associated with that; If the computed coordinate is not integer, it will be rounded to the nearest integer.

A (truncated) transpose of frame can be obtained with Y X x[] (a real transpose is not possible as Expr requires the input and output to have the same dimension.)

Potential uses:

  • Implement arbitrary LUT (unlike core.std.Lut and core.std.Lut2 you can use arbitrary expression to compute the LUT index, as long as you represent LUT as a GRAYS/YUVS/RGBS clip of the same dimension as the other inputs). Not as flexible as dedicated 3D-LUT implementations, but it can get the job done.
  • (Your ideas here.)