michael@0: #!/usr/bin/python michael@0: michael@0: import math michael@0: michael@0: f = open("jpeg_nbits_table.h", "w") michael@0: michael@0: for i in range(65536): michael@0: f.write('%2d' % math.ceil(math.log(i + 1, 2))) michael@0: if i != 65535: michael@0: f.write(',') michael@0: if (i + 1) % 16 == 0: michael@0: f.write('\n') michael@0: else: michael@0: f.write(' ') michael@0: michael@0: f.close()