Context algorithm
Semi-predictive context algorithm implementation
 All Data Structures Files Functions Variables Typedefs Macros Pages
decoder.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include "decoder.h"
#include "debug.h"
#include "alpha.h"
#include "spacedef.h"
#include "stack.h"
#include "see.h"
#include "reset.h"
#include "arithmetic/coder.h"
#include "arithmetic/bitio.h"

Go to the source code of this file.

Functions

static void fixParents (decoderTree_t tree, BOOL *deletedChars)
 Remove symbols from the statistics of the ancestors of this node in case that is necessary. More...
 
static void rescale (decoderTree_t tree)
 
static void addNodes (Uchar *text, Uchar sym, decoderTree_t *tree, decoderTree_t *prevTree, Uint i, Uint *zPrevLeft, Uint *zPrevRight)
 
void decode (decoderTree_t tree, const Uint textlen, FILE *compressedFile, FILE *output, const BOOL useSee)
 Decodes the compressed file data to the output file (for non-binary alphabet). More...
 

Function Documentation

static void addNodes ( Uchar text,
Uchar  sym,
decoderTree_t tree,
decoderTree_t prevTree,
Uint  i,
Uint zPrevLeft,
Uint zPrevRight 
)
static

Definition at line 118 of file decoder.c.

void decode ( decoderTree_t  ,
const Uint  textlen,
FILE *  compressed_file,
FILE *  output,
const BOOL  useSee 
)

Decodes the compressed file data to the output file (for non-binary alphabet).

Definition at line 312 of file decoder.c.

static void fixParents ( decoderTree_t  tree,
BOOL deletedChars 
)
static

Remove symbols from the statistics of the ancestors of this node in case that is necessary.

Symbols are removed from the ancestors if they only have the same symbols as the child node (including the ones indicated in deletedChars).

Parameters
[in]treenode of the tree.
[in]deletedCharsbit vector indicating which characters have been erased from the node statistics.

Definition at line 40 of file decoder.c.

static void rescale ( decoderTree_t  tree)
static

Definition at line 71 of file decoder.c.