Now i have 512 * 512 * 3 numpy array, I want to apply a function to each 8 * 8 block, for example, a dct transform, is there any built_in module to do that? I tried to implement it in a naive way
for c in xrange(3):
for x in xrange(0, 512, 8):
for y in xrange(0, 512, 8):
img[x:x + 8, y:y + 8, c] = dct_2d(img[x:x + 8, y:y + 8, c])
img[x:x + 8, y:y + 8, c] = idct_2d(img[x:x + 8, y:y + 8, c])
Which takes long time to iterate and calculate.
