3 ms·
Here is a 250 lines jpeg decompressor written using vanilla python https://github.com/aguaviva/micro-jpeg-visualizer https://github.com/aguaviva/micro-jpeg-vis
by xchip 9y ago
Here is a 250 lines jpeg decompressor written using vanilla python
https://github.com/aguaviva/micro-jpeg-visualizer https://github.com/aguaviva/micro-jpeg-visualizer
Enjoy the 5 lines (but slow) IDCT :)
for y in range(0,8):
for x in range(0,8):
nn = an*math.cos( n* math.pi * (x +.5)/8.0 )
mm = am*math.cos( m* math.pi * (y +.5)/8.0 )
self.base[ XYtoLin(x, y) ] += nn*mm*coeff