1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
int D = 65536;
int m, S, dwt;
char chaine[20]="";
FILE *fp = NULL;
FILE *qim;
FILE *bis;
FILE *ref;
fp = fopen("dwt.txt", "a");
qim = fopen ("dwtw.txt", "a");
bis = fopen ("bis_ins.txt", "r");
ref = fopen ("reference.txt", "a");
S = 2 * D;
for (k = 0; k < cblk->z1 - cblk->z0; k++) {
for (j = 0; j < cblk->y1 - cblk->y0; j++) {
for (i = 0; i < cblk->x1 - cblk->x0; i++) {
if ((resno == 0) && (bandno == 0)){
/*-------Recuperation de coefficients DWT dans LLL-----------------*/
dwt = tilec->data[(x + i) + (y + j) * (tilec->x1 - tilec->x0) + (z + k) * (tilec->x1 - tilec->x0) * (tilec->y1 - tilec->y0)];
fprintf(fp, "%i\n", dwt);
/*-------Insertion QIM----------------*/
if ( abs (dwt) > S)
{
fprintf(ref,"%i %i %i\n", i, j, k);
fscanf (bis, "%i ", &m);
if (m == 0)
{
dwt = (((int) floor (dwt/ D)) * D) + 3 * (D/4) ;
} else if (m == 1)
{
dwt = (((int) floor (dwt/ D)) * D) + (D/4) ;
}
fprintf(qim, "%i\n", dwt);
}
}
}
}
} |
Partager