Video Coding: An Introduction to Standard Codecs

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

<span class="fixed">/*ffdct.c*//*fast forward discrete cosine transform in the current frame */#include "config.h"#include "global.h"#define W1 2841         /* sqrt (2) cos</span> (<span class="unicode">?</span>/16)<<11<span class="fixed">*/</span><span class="fixed">#define W2 2676         /* sqrt (2) cos</span> (2<span class="unicode">?</span>/16)<<11<span class="fixed">*/</span><span class="fixed">#define W3 2408         /* sqrt (2) cos</span> (3<span class="unicode">?</span>/16)<<11<span class="fixed">*/</span><span class="fixed">#define W5 1609         /* sqrt (2) cos</span> (5<span class="unicode">?</span>/16)<<11<span class="fixed">*/</span><span class="fixed">#define W6 1108         /* sqrt (2) cos</span> (6<span class="unicode">?</span>/16)<<11<span class="fixed">*/</span><span class="fixed">#define W7 565          /* sqrt (2) cos</span> (7<span class="unicode">?</span>/16)<<11<span class="fixed">*/</span><span class="fixed">#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;/*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) +...

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.