biariencode.c File Reference

Routines for binary arithmetic encoding. More...

#include "global.h"
#include "biariencode.h"

Include dependency graph for biariencode.c:

Go to the source code of this file.

Functions

void reset_pic_bin_count (ImageParameters *p_Img)
int get_pic_bin_count (ImageParameters *p_Img)
EncodingEnvironmentPtr arienco_create_encoding_environment (void)
void arienco_delete_encoding_environment (EncodingEnvironmentPtr eep)
static void put_one_byte_final (EncodingEnvironmentPtr eep, unsigned int b)
static forceinline void put_buffer (EncodingEnvironmentPtr eep)
static void put_one_byte (EncodingEnvironmentPtr eep, int b)
static void put_one_word (EncodingEnvironmentPtr eep, int b)
static forceinline void propagate_carry (EncodingEnvironmentPtr eep)
static void put_last_chunk_plus_outstanding (EncodingEnvironmentPtr eep, unsigned int l)
static void put_last_chunk_plus_outstanding_final (EncodingEnvironmentPtr eep, unsigned int l)
void arienco_reset_EC (EncodingEnvironmentPtr eep)
void arienco_start_encoding (EncodingEnvironmentPtr eep, unsigned char *code_buffer, int *code_len)
void set_pic_bin_count (ImageParameters *p_Img, EncodingEnvironmentPtr eep)
void arienco_done_encoding (Macroblock *currMB, EncodingEnvironmentPtr eep)
void biari_encode_symbol (EncodingEnvironmentPtr eep, signed short symbol, BiContextTypePtr bi_ct)
void biari_encode_symbol_eq_prob (EncodingEnvironmentPtr eep, signed short symbol)
void biari_encode_symbol_final (EncodingEnvironmentPtr eep, signed short symbol)
void biari_init_context (int qp, BiContextTypePtr ctx, const char *ini)

Variables

static const byte rLPS_table_64x4 [64][4]
static const byte AC_next_state_MPS_64 [64]
static const byte AC_next_state_LPS_64 [64]
static const byte renorm_table_32 [32] = {6,5,4,4,3,3,3,3,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}


Detailed Description

Routines for binary arithmetic encoding.

This modified implementation of the M Coder is based on JVT-U084 with the choice of M_BITS = 16.

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

Definition in file biariencode.c.


Function Documentation

EncodingEnvironmentPtr arienco_create_encoding_environment ( void   ) 

Allocates memory for the EncodingEnvironment struct.

Definition at line 133 of file biariencode.c.

References no_mem_exit().

Here is the call graph for this function:

void arienco_delete_encoding_environment ( EncodingEnvironmentPtr  eep  ) 

Frees memory of the EncodingEnvironment struct.

Definition at line 149 of file biariencode.c.

References error(), errortext, and ET_SIZE.

Here is the call graph for this function:

void arienco_done_encoding ( Macroblock currMB,
EncodingEnvironmentPtr  eep 
)

Terminates the arithmetic codeword, writes stop bit and stuffing bytes (if any).

Definition at line 291 of file biariencode.c.

References put_one_byte_final().

Referenced by terminate_slice(), and writeIPCMData().

Here is the call graph for this function:

void arienco_reset_EC ( EncodingEnvironmentPtr  eep  ) 

Initializes the EncodingEnvironment E and C values to zero.

Definition at line 245 of file biariencode.c.

Referenced by start_slice().

void arienco_start_encoding ( EncodingEnvironmentPtr  eep,
unsigned char *  code_buffer,
int *  code_len 
)

Initializes the EncodingEnvironment for the arithmetic coder.

Definition at line 257 of file biariencode.c.

Referenced by start_slice(), and writeIPCMData().

void biari_encode_symbol ( EncodingEnvironmentPtr  eep,
signed short  symbol,
BiContextTypePtr  bi_ct 
)

void biari_encode_symbol_eq_prob ( EncodingEnvironmentPtr  eep,
signed short  symbol 
)

Arithmetic encoding of one binary symbol assuming a fixed prob. distribution with p(symbol) = 0.5.

Definition at line 445 of file biariencode.c.

Referenced by exp_golomb_encode_eq_prob(), write_significant_coefficients(), and writeMVD_CABAC().

void biari_encode_symbol_final ( EncodingEnvironmentPtr  eep,
signed short  symbol 
)

Arithmetic encoding for last symbol before termination.

Definition at line 488 of file biariencode.c.

Referenced by writeMB_B_typeInfo_CABAC(), writeMB_I_typeInfo_CABAC(), and writeMB_P_typeInfo_CABAC().

void biari_init_context ( int  qp,
BiContextTypePtr  ctx,
const char *  ini 
)

Initializes a given context with some pre-defined probability state.

Definition at line 560 of file biariencode.c.

static void put_one_byte_final ( EncodingEnvironmentPtr  eep,
unsigned int  b 
) [inline, static]

inline functions for writing bytes of code

Definition at line 166 of file biariencode.c.

Referenced by arienco_done_encoding().

void set_pic_bin_count ( ImageParameters p_Img,
EncodingEnvironmentPtr  eep 
)

add slice bin number to picture bin counter should be only used when slice is terminated

Definition at line 280 of file biariencode.c.

Referenced by terminate_slice().


Variable Documentation

const byte AC_next_state_LPS_64[64] [static]

Initial value:

{
  0, 0, 1, 2, 2, 4, 4, 5, 6, 7,
  8, 9, 9,11,11,12,13,13,15,15,
  16,16,18,18,19,19,21,21,22,22,
  23,24,24,25,26,26,27,27,28,29,
  29,30,30,30,31,32,32,33,33,33,
  34,34,35,35,35,36,36,36,37,37,
  37,38,38,63
}

Definition at line 103 of file biariencode.c.

const byte AC_next_state_MPS_64[64] [static]

Initial value:

{
  1,2,3,4,5,6,7,8,9,10,
  11,12,13,14,15,16,17,18,19,20,
  21,22,23,24,25,26,27,28,29,30,
  31,32,33,34,35,36,37,38,39,40,
  41,42,43,44,45,46,47,48,49,50,
  51,52,53,54,55,56,57,58,59,60,
  61,62,62,63
}

Definition at line 92 of file biariencode.c.


Documentation generated with DoxyGen