media/libjpeg/genTables.py
author Gregory Szorc <gps@mozilla.com>
Mon, 16 Sep 2013 17:49:44 -0700
changeset 147512 312925464acbda3fb964108c34e7408c2c06a3e3
parent 116208 a5f94f2c5f940f1f9fad7dd952452cededc4b57b
permissions -rw-r--r--
Bug 911375 - Part 2: Convert uses of PurgeManifest to InstallManifest; r=glandium

#!/usr/bin/python

import math

f = open("jpeg_nbits_table.h", "w")

for i in range(65536):
    f.write('%2d' % math.ceil(math.log(i + 1, 2)))
    if i != 65535:
        f.write(',')
    if (i + 1) % 16 == 0:
        f.write('\n')
    else:
        f.write(' ')

f.close()