context_ini.c File Reference

CABAC context initializations. More...

#include <math.h>
#include "global.h"
#include "ctx_tables.h"
#include "biariencode.h"
#include "memalloc.h"

Include dependency graph for context_ini.c:

Go to the source code of this file.

Defines

#define CONTEXT_INI_C
#define DEFAULT_CTX_MODEL   0
#define RELIABLE_COUNT   32.0
#define FRAME_TYPES   4
#define FIXED   0
#define BIARI_CTX_INIT2(ii, jj, ctx, tab, num)
#define BIARI_CTX_INIT1(jj, ctx, tab, num)
#define ADD_XRATE2(ii, jj, ctx, tab, num)
#define ADD_XRATE1(jj, ctx, tab, num)

Functions

void create_context_memory (void)
void free_context_memory (void)
void SetCtxModelNumber (void)
void init_contexts (void)
double XRate (BiContextTypePtr ctx, const char *model)
void GetCtxModelNumber (int *mnumber, MotionInfoContexts *mc, TextureInfoContexts *tc)
void store_contexts (void)
void update_field_frame_contexts (int field)

Variables

int num_mb_per_slice
int number_of_slices
int *** initialized
int *** model_number
double entropy [128]
double probability [128]


Detailed Description

CABAC context initializations.

Author:
Main contributors (see contributors.h for copyright, address and affiliation details)

Definition in file context_ini.c.


Define Documentation

#define ADD_XRATE1 ( jj,
ctx,
tab,
num   ) 

Value:

{ \
  if      (img->type==I_SLICE)  \
  for (j=0; j<jj; j++) \
  { \
    xr += XRate (&(ctx[j]), &(tab ## _I[num][0][j][0])); \
  } \
  else \
  for (j=0; j<jj; j++) \
  { \
    xr += XRate (&(ctx[j]), &(tab ## _P[num][0][j][0])); \
  } \
}

Definition at line 219 of file context_ini.c.

#define ADD_XRATE2 ( ii,
jj,
ctx,
tab,
num   ) 

Value:

{ \
  if      (img->type==I_SLICE)  \
  for (i=0; i<ii; i++) \
  for (j=0; j<jj; j++) \
  { \
    xr += XRate (&(ctx[i][j]), &(tab ## _I[num][i][j][0])); \
  } \
  else \
  for (i=0; i<ii; i++) \
  for (j=0; j<jj; j++) \
  { \
    xr += XRate (&(ctx[i][j]), &(tab ## _P[num][i][j][0])); \
  } \
}

Definition at line 203 of file context_ini.c.

#define BIARI_CTX_INIT1 ( jj,
ctx,
tab,
num   ) 

Value:

{ \
  if ((img->type==I_SLICE)||(img->type==SI_SLICE))  \
  for (j=0; j<jj; j++) \
  { \
    biari_init_context (&(ctx[j]), &(tab ## _I[num][0][j][0])); \
  } \
  else \
  for (j=0; j<jj; j++) \
  { \
    biari_init_context (&(ctx[j]), &(tab ## _P[num][0][j][0])); \
  } \
}

Definition at line 107 of file context_ini.c.

#define BIARI_CTX_INIT2 ( ii,
jj,
ctx,
tab,
num   ) 

Value:

{ \
  if ((img->type==I_SLICE)||(img->type==SI_SLICE))  \
  for (i=0; i<ii; i++) \
  for (j=0; j<jj; j++) \
  { \
    biari_init_context (&(ctx[i][j]), &(tab ## _I[num][i][j][0])); \
  } \
  else \
  for (i=0; i<ii; i++) \
  for (j=0; j<jj; j++) \
  { \
    biari_init_context (&(ctx[i][j]), &(tab ## _P[num][i][j][0])); \
  } \
}

Definition at line 91 of file context_ini.c.


Variable Documentation

double probability[128]

Initial value:

{
  0.000000, 0.000000, 0.000000, 0.000000,    0.000000, 0.000000, 0.000000, 0.000000,
  0.000000, 0.000000, 0.000000, 0.000000,    0.000000, 0.000000, 0.000000, 0.000000,
  0.000000, 0.000000, 0.000000, 0.000000,    0.000000, 0.000000, 0.000000, 0.000000,
  0.000000, 0.000000, 0.000000, 0.000000,    0.000000, 0.000000, 0.000000, 0.000000,
  0.000000, 0.000000, 0.000000, 0.000000,    0.000000, 0.000000, 0.000000, 0.000000,
  0.000000, 0.000000, 0.000000, 0.000000,    0.000000, 0.000000, 0.000000, 0.000000,
  0.000000, 0.000000, 0.000000, 0.000000,    0.000000, 0.000000, 0.000000, 0.000000,
  0.000000, 0.000000, 0.000000, 0.000000,    0.000000, 0.000000, 0.000000, 0.000000,
  
  0.500000, 0.474609, 0.450507, 0.427629,    0.405912, 0.385299, 0.365732, 0.347159,
  0.329530, 0.312795, 0.296911, 0.281833,    0.267520, 0.253935, 0.241039, 0.228799,
  0.217180, 0.206151, 0.195682, 0.185744,    0.176312, 0.167358, 0.158859, 0.150792,
  0.143134, 0.135866, 0.128966, 0.122417,    0.116200, 0.110299, 0.104698, 0.099381,
  0.094334, 0.089543, 0.084996, 0.080680,    0.076583, 0.072694, 0.069002, 0.065498,
  0.062172, 0.059014, 0.056018, 0.053173,    0.050473, 0.047909, 0.045476, 0.043167,
  0.040975, 0.038894, 0.036919, 0.035044,    0.033264, 0.031575, 0.029972, 0.028450,
  0.027005, 0.025633, 0.024332, 0.023096,    0.021923, 0.020810, 0.019753, 0.018750
}

Definition at line 39 of file context_ini.c.


Documentation generated with DoxyGen