New cost-effective VLSI implementation of 2D discrete cosine transform and its inverse