Created
November 6, 2015 08:50
-
-
Save barrbrain/b074567f35222e925831 to your computer and use it in GitHub Desktop.
Chroma quantization curve table generation for Daala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
P = 2.25 | |
def quant(cq): return math.trunc(math.exp((cq-6.235)*.10989525)*16.0) | |
def curve(cq): return quant(cq-math.pow(cq-1,P)/(2.0*P*math.pow(62.0,P-1))) | |
print(', '.join(['0x%04X' % n for n in [0] + [curve(cq) for cq in range(1,64)]])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment