Documentation
¶
Overview ¶
Package transform implements VP9 inverse transforms (spec §8.7.1). Sizes 4/8/16/32; kernels DCT-II and ADST (no 32×32 ADST in VP9). Integer arithmetic: constants scaled by 2^14; drs = (v+(1<<13))>>14. 2-D pass (libvpx convention): rows (no shift) → transpose → cols → transpose with a single ROUND_POWER_OF_TWO of FinalShift(bs) = 4/5/6/6 for bs 4/8/16/32.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BD16 = 8
Functions ¶
func DCOnlyValue ¶
DCOnlyValue returns the uniform output value of a DCT_DCT inverse 2-D transform when only the DC coefficient (after dequantization) is non-zero. shift is FinalShift(bs) for the block (libvpx vpx_idctNxN_1_add: two cascaded cospi_16 round-shifts, then ROUND_POWER_OF_TWO(_, shift)).
func DCOnlyValue16 ¶ added in v0.2.0
func FinalShift ¶ added in v0.2.0
FinalShift returns the VP9 inverse-transform output round-shift for a block of side bs pixels: 4 for 4×4, 5 for 8×8, 6 for 16×16 and 32×32 (libvpx vpx_idctNxN, ROUND_POWER_OF_TWO at the end of the column pass).
func InvTransform2D ¶
InvTransform2D applies the inverse 2-D transform in-place. coeffs is bs×bs int16, row-major. bs ∈ {4,8,16,32}; bs=32 forces DCT_DCT.
Convention matches libvpx: the row pass writes 16-bit (wrapping) intermediates with NO shift; the column pass is followed by a single ROUND_POWER_OF_TWO of FinalShift(bs). (An earlier version shifted >>4 after each pass, scaling the residual 16× too small.)