Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

mquant.c

Go to the documentation of this file.
00001 #include "mtypes.h"
00002 #include "mproto.h"
00003 
00004 static int qtable[][8] = {
00005     { 8,16,19,22,26,27,29,34},
00006     {16,16,22,24,27,29,34,37},
00007     {19,22,26,27,29,34,34,38},
00008     {22,22,26,27,29,34,37,40},
00009     {22,26,27,29,32,35,40,48},
00010     {26,27,29,32,35,40,48,58},
00011     {26,27,29,34,38,46,56,69},
00012     {27,29,35,38,46,56,69,83} };
00013 
00014 
00015 /*
00016  *--------------------------------------------------------------
00017  *
00018  * mp_quant_block --
00019  *
00020  *      Quantizes a block -- removing information
00021  *      It's safe for out == in.
00022  *
00023  * Results:
00024  *      None.
00025  *
00026  * Side effects:
00027  *      Modifies the out block.
00028  *
00029  *--------------------------------------------------------------
00030  */
00031 void mp_quant_block(Block in, Block out) {
00032     int i;
00033 
00034     for(i=0;i<8;i++) {
00035         out[i][0] = in[i][0] / qtable[i][0];
00036         out[i][1] = in[i][1] / qtable[i][1];
00037         out[i][2] = in[i][2] / qtable[i][2];
00038         out[i][3] = in[i][3] / qtable[i][3];
00039         out[i][4] = in[i][4] / qtable[i][4];
00040         out[i][5] = in[i][5] / qtable[i][5];
00041         out[i][6] = in[i][6] / qtable[i][6];
00042         out[i][7] = in[i][7] / qtable[i][7];
00043     }
00044 }
 

Powered by Plone

This site conforms to the following standards: