Commit 05d7fb66 authored by Loren Merritt's avatar Loren Merritt

de-duplicate vlc tables

parent 91e0ff6b
......@@ -7,7 +7,7 @@ all: default
SRCS = common/mc.c common/predict.c common/pixel.c common/macroblock.c \
common/frame.c common/dct.c common/cpu.c common/cabac.c \
common/common.c common/mdate.c common/set.c \
common/quant.c \
common/quant.c common/vlc.c \
encoder/analyse.c encoder/me.c encoder/ratecontrol.c \
encoder/set.c encoder/macroblock.c encoder/cabac.c \
encoder/cavlc.c encoder/encoder.c encoder/eval.c
......
......@@ -25,6 +25,12 @@
#ifndef X264_BS_H
#define X264_BS_H
typedef struct
{
uint8_t i_bits;
uint8_t i_size;
} vlc_t;
typedef struct bs_s
{
uint8_t *p_start;
......@@ -36,6 +42,11 @@ typedef struct bs_s
int i_bits_encoded; /* RD only */
} bs_t;
extern const vlc_t x264_coeff_token[5][17*4];
extern const vlc_t x264_total_zeros[15][16];
extern const vlc_t x264_total_zeros_dc[3][4];
extern const vlc_t x264_run_before[7][15];
static inline void bs_init( bs_t *s, void *p_data, int i_data )
{
int offset = ((intptr_t)p_data & (WORD_SIZE-1));
......
/*****************************************************************************
* vlc.h : vlc table
* vlc.c : vlc table
*****************************************************************************
* Copyright (C) 2003 Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -18,15 +18,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
*****************************************************************************/
typedef struct
{
uint16_t i_bits;
uint16_t i_size;
} vlc_t;
#include "common.h"
/* XXX: don't forget to change it if you change vlc_t */
#define MKVLC( a, b ) { a, b }
static const vlc_t x264_coeff_token[5][17*4] =
const vlc_t x264_coeff_token[5][17*4] =
{
/* table 0 */
{
......@@ -469,7 +464,7 @@ static const vlc_t x264_coeff_token[5][17*4] =
};
/* [i_total_coeff-1][i_total_zeros] */
static const vlc_t x264_total_zeros[15][16] =
const vlc_t x264_total_zeros[15][16] =
{
{ /* i_total 1 */
MKVLC( 0x1, 1 ), /* str=1 */
......@@ -744,7 +739,7 @@ static const vlc_t x264_total_zeros[15][16] =
};
/* [i_total_coeff-1][i_total_zeros] */
static const vlc_t x264_total_zeros_dc[3][4] =
const vlc_t x264_total_zeros_dc[3][4] =
{
{
MKVLC( 0x01, 1 ), /* 1 */
......@@ -767,7 +762,7 @@ static const vlc_t x264_total_zeros_dc[3][4] =
};
/* x264_run_before[__MIN( i_zero_left -1, 6 )][run_before] */
static const vlc_t x264_run_before[7][15] =
const vlc_t x264_run_before[7][15] =
{
{ /* i_zero_left 1 */
MKVLC( 0x1, 1 ), /* str=1 */
......
......@@ -22,7 +22,6 @@
*****************************************************************************/
#include "common/common.h"
#include "common/vlc.h"
#include "macroblock.h"
static const uint8_t intra4x4_cbp_to_golomb[48]=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment