1 /*----------------------------------------------------------------------------
2 * jacu - Just Another Compression Utility
3 *----------------------------------------------------------------------------
4 * This file is part of jacu.
6 * jacu is free software; you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation; either version 2 of the License, or (at your option) any later
11 * jacu is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 * You should have received a copy of the GNU General Public License along
17 * with jacu; if not, write to the Free Software Foundation, Inc., 59 Temple
18 * Place, Suite 330, Boston, MA 02111-1307 USA
19 *----------------------------------------------------------------------------
30 * Implementación del Move To Front
34 /** Aplica el algoritmo MTF a un dato
36 * \param datos Array de entrada
37 * \param len Tamaño del array de entrada
38 * \param _z Puntero donde se retornará el z
39 * \param z_len Puntero donde se retornará el tamaño de Z
40 * \return El nuevo array luego de aplicar el algotirmo.
42 unsigned char *jacu_mtf(unsigned char *datos, int len, unsigned char **_z, int *z_len);
44 /** Aplica el algoritmo inverso de MTF
46 * \param z Vector Z retornado por jacu_mtf
47 * \param pos Vector retornado por jacu_mtf
48 * \param len Tamaño del vector
49 * \param Array de dato original
51 unsigned char *jacu_mtf_inv(unsigned char *z, unsigned char *pos, int len);
53 /** Busca el vector Z en base a una entrada */
54 unsigned char *jacu_buscar_z(unsigned char* datos, int len, int *size);
56 void print_z(char *z, int len);