view pydct/tNxN.py @ 1:9aa2dd7d0de7

fix zigzag() with start/stop
author pmeerw@pan
date Tue, 06 May 2008 23:39:54 +0200
parents 63af49cca5d2
children
line wrap: on
line source

import dct, numpy

def fdctNxN(b):
    '''
    Forward 2D DCT on NxN array.
    '''
    c = dct.__init_dctN(b.shape[0])
    return numpy.dot(c, numpy.dot(b, numpy.transpose(c)))

def idctNxN(b):
    '''
    Inverse 2D DCT on NxN array.
    '''
    c = dct.__init_dctN(b.shape[0])
    return numpy.dot(numpy.transpose(c), numpy.dot(b, c))

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.