arith.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include "arith.h"

Include dependency graph for arith.c:

Go to the source code of this file.

Functions

int l2 (unsigned long x)
arith_t arith_init (struct buff *b)
int ajuster (arith_t state, int coder)
int coder (int i, distrib_t d, arith_t state)
int coder_uniforme (unsigned long i, unsigned long n, arith_t state)
int chercher (unsigned long valeur, unsigned long *sprob, int a, int b)
int decoder (distrib_t d, int *lettre, arith_t state)
unsigned long decoder_uniforme (unsigned long n, unsigned long *lettre, arith_t state)


Function Documentation

int ajuster ( arith_t  state,
int  coder 
)

Definition at line 82 of file arith.c.

References code_arith::buffer, bwrite(), bwrite_bit(), bwrite_bits(), code_arith::compteur, l2(), code_arith::max, code_arith::min, and PREC_INTER.

Referenced by coder(), coder_uniforme(), decoder(), and decoder_uniforme().

Here is the call graph for this function:

arith_t arith_init ( struct buff b  ) 

Definition at line 69 of file arith.c.

References code_arith::buffer, code_arith::compteur, code_arith::max, code_arith::min, and PREC_INTER.

Referenced by dicho_b2cw(), and dicho_cw2b().

int chercher ( unsigned long  valeur,
unsigned long *  sprob,
int  a,
int  b 
)

Definition at line 209 of file arith.c.

Referenced by decoder().

int coder ( int  i,
distrib_t  d,
arith_t  state 
)

Definition at line 137 of file arith.c.

References ajuster(), code_arith::buffer, bwrite_lock(), code_arith::compteur, distrib_get_proba, distrib_t::max, code_arith::max, code_arith::min, PREC_INTER, and PREC_PROBA.

Referenced by dicho_rec().

Here is the call graph for this function:

int coder_uniforme ( unsigned long  i,
unsigned long  n,
arith_t  state 
)

Definition at line 176 of file arith.c.

References ajuster(), code_arith::buffer, bwrite_lock(), code_arith::compteur, code_arith::max, code_arith::min, and PREC_INTER.

Referenced by dicho().

Here is the call graph for this function:

int decoder ( distrib_t  d,
int *  lettre,
arith_t  state 
)

unsigned long decoder_uniforme ( unsigned long  n,
unsigned long *  lettre,
arith_t  state 
)

Definition at line 289 of file arith.c.

References ajuster(), blook(), bread_lock(), bstep(), code_arith::buffer, code_arith::compteur, code_arith::max, code_arith::min, and PREC_INTER.

Referenced by dichoinv().

Here is the call graph for this function:

int l2 ( unsigned long  x  ) 

Definition at line 25 of file arith.c.

Referenced by adjust_delta(), ajuster(), and leaf_info().


This work was partially suported by Europian Network of Excellence, ECRYPT; ECRYPT