imgfdct

Capsim Block Documentation

Short Description

This star inputs an image and computes the DCT. Note that the input images must be 8x8.

Top
Input Connections
Port Type Name
0 image_t x
Top
Output Connections
Port Type Name
0 image_t y
Top
States
Num Type Name Initial Value Description
0 short* dctBlock_A
Top

Declarations


 

	int no_samples;
	int i,j,k;
	float	temp;
	dsp_floatMatrix_t	matrix;
	dsp_floatMatrix_Pt	matrix_P;
	dsp_floatMatrix_Pt	subMatrix_P;
	int	pwidth;
	int	pheight;
	float**		mat_PP;
	image_t	img;



Top

Initialization Code



 

	dctBlock_A=(short*)calloc(64,sizeof(short));




Top

Main Code



 

for (no_samples = MIN_AVAIL(); no_samples > 0; --no_samples) {
	/*
	 * collect the image
	 */
	IT_IN(0);
	img=x(0);
	pheight=img.height;
	pwidth=img.width;
	mat_PP=img.image_PP;

	if(!(pheight == 8 && pwidth == 8)) {
		fprintf(stderr,"Forward DCT: image must be 8x8\n");
		return(4);
	}

	/*
	 * put image into dct block
	 * note that we convert 0-255 range tp -128 to 128 range
	 */
	k=0;
	for(i=0; i
    
Top

Wrapup Code



 





Top

License



/*  Capsim (r) Text Mode Kernel (TMK) Star Library (Blocks)
    Copyright (C) 1989-2002  XCAD Corporation 

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    http://www.xcad.com
    XCAD Corporation
    Raleigh, North Carolina 
*/


Top

Description



 

/* imgfdtc.s */
/***********************************************************************
                             imgfdtc()
************************************************************************
This star inputs an image and computes the DCT.
Note that the input images must be 8x8.
If not an error message is printed and the star returns.
The DCT images are sequentially output.
Programmer:  	Sasan Ardalan	
Date: 		August 15, 1993
*/