Logo Search packages:      
Sourcecode: ffmpeg-debian version File versions

void ff_ref_fdct ( short *  block  ) 

Transform 8x8 block of data with a double precision forward DCT
This is a reference implementation.

Parameters:
block pointer to 8x8 block of data to transform

Definition at line 57 of file dctref.c.

{
    /* implement the equation: block = coefficients * block * coefficients' */

    unsigned int i, j, k;
    double out[8 * 8];

    /* out = coefficients * block */
    for (i = 0; i < 64; i += 8) {
        for (j = 0; j < 8; ++j) {
            double tmp = 0;
            for (k = 0; k < 8; ++k) {
                tmp += coefficients[i + k] * block[k * 8 + j];
            }
            out[i + j] = tmp * 8;
        }
    }

    /* block = out * (coefficients') */
    for (j = 0; j < 8; ++j) {
        for (i = 0; i < 64; i += 8) {
            double tmp = 0;
            for (k = 0; k < 8; ++k) {
                tmp += out[i + k] * coefficients[j * 8 + k];
            }
            block[i + j] = floor(tmp + 0.499999999999);
        }
    }
}


Generated by  Doxygen 1.6.0   Back to index