X-Git-Url: https://git.llucax.com/z.facultad/75.06/jacu.git/blobdiff_plain/bfe6de10fe456e512b54d97dc54de7591c443875..a293398508dd82716cabed67614d1692fe689457:/src/jacu.c?ds=sidebyside diff --git a/src/jacu.c b/src/jacu.c index 5add536..62939f4 100644 --- a/src/jacu.c +++ b/src/jacu.c @@ -99,9 +99,9 @@ int main(int argc, char* argv[]) /* Comprimo */ FILE *fp; Uint32 i, j, total, k; - char *mtf; - char *salida, *data; - char *z; + unsigned char *mtf; + unsigned char *salida, *data; + unsigned char *z; int z_len; /* Preparo el compresor huffman */ @@ -109,8 +109,8 @@ int main(int argc, char* argv[]) if (mflag == 1) shuff_loadmodel(shuff,staticmodel); /* Preparo el BS alocando mem para el K, el Block y su Size */ - data = malloc(sizeof(char)*pagesize); - salida = malloc(sizeof(char)*pagesize+sizeof(Uint32)*2); + data = malloc(sizeof(unsigned char)*pagesize); + salida = malloc(sizeof(unsigned char)*pagesize+sizeof(Uint32)*2); bs = bs_create(pagesize); /* Abrimos el archivo a comprimir y encodeamos bloques */ @@ -130,28 +130,9 @@ int main(int argc, char* argv[]) /* Aplico el BlockSorting */ bs_solve(data, salida, bs, &k, i); - /*printf("BS k=%ld\n", *(Uint32 *)(salida+sizeof(Uint32))); - printf("PageSize = %ld\n", *(Uint32 *)salida); - - printf("Antes de MTF = %ld [", i); - { - int ii; - for(ii=0; ii<(i+sizeof(Uint32)); ii++) - printf("(%c)", salida[ii+sizeof(Uint32)]); - printf("]\n"); - }*/ - /* Le aplico el MTF, salteo el tamaƱo del bloque para que no se pierda. */ mtf = jacu_mtf(salida+sizeof(Uint32), i+sizeof(Uint32), &z, &z_len); -/* - printf("MTF Z (len=%d) = [", z_len); - { - int ii; - for(ii=0; ii 0) { moredata = shuff_decode_chunk(shuff,(char*)&z_len,sizeof(int),&decoded); - z = malloc(sizeof(char)*z_len); + z = malloc(sizeof(unsigned char)*z_len); moredata = shuff_decode_chunk(shuff,z,z_len,&decoded); - /*printf("MTF Z (len=%d) = [", z_len); - { - int ii; - for(ii=0; ii