Standard Codecs: Image Compression to Advanced Video Coding

Appendix A: A C Program for the Fast Discrete Cosine Transform

/*ffdct.c*//*fast forward discrete cosine transform in the current  frame */#include "config.h"#include "global.h"#define W1 2841        /* sqrt(2)cos(<span class="unicode">?</span>/16)<< 11*/#define W2 2676        /* sqrt(2)cos(2<span class="unicode">?</span>/16)<< 11*/#define W3 2408        /* sqrt(2)cos(3<span class="unicode">?</span>/16)<< 11*/#define W5 1609        /* sqrt(2)cos(5<span class="unicode">?</span>/16)<< 11*/#define W6 1108        /* sqrt(2)cos(6<span class="unicode">?</span>/16)<< 11*/#define W7 565         /* sqrt(2)cos(7<span class="unicode">?</span>/16)<< 11*/#define W10 2276       /* W1 - W7 */#define W11 3406       /* W1 + W7 */#define W12 4017       /* W3 + W5 */#define W13 799        /* W3 - W5 */#define W14 1568       /* W2 - W6 */#define W15 3784       /* W2 + W6 *//* global declarations */void ffdct _ANSI_ARGS_((int *block));void ffdct(block)int *block;{int s [10] ,t [10] ,r [10] ;int *p;int j, temp;<a name="1201"></a><a name="IDX-370"></a>/*forward transformation in "H" direction*/p = block;for(j=0; j<64; j +=8 )   {   /* first stage transformation */   s[0] = (*(p) + *(p+7));   s[1] = (*(p+1) + *(p+6));   s[2] = (*(p+2) + *(p+5));   s[3] = (*(p+3) + *(p+4));   s[4] = (*(p+3) - *(p+4));   s[5] =...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Biosensors and Microarrays
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.