mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-12-04 05:54:05 +00:00
Remove unused members from cabac_data.
- Removing them also makes cabac_init unnecessary.
This commit is contained in:
parent
602e0fee9c
commit
30c16fe299
14
src/cabac.c
14
src/cabac.c
|
@ -66,16 +66,6 @@ const uint8_t g_auc_renorm_table[32] =
|
||||||
cabac_data cabac;
|
cabac_data cabac;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Initialize struct cabac_data.
|
|
||||||
*/
|
|
||||||
void cabac_init(cabac_data* data)
|
|
||||||
{
|
|
||||||
data->frac_bits = 0;
|
|
||||||
data->bin_count_increment = 0;
|
|
||||||
data->bins_coded = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Initialize struct cabac_data.
|
* \brief Initialize struct cabac_data.
|
||||||
*/
|
*/
|
||||||
|
@ -95,7 +85,6 @@ void cabac_encode_bin(cabac_data *data, uint32_t bin_value)
|
||||||
{
|
{
|
||||||
uint32_t lps;
|
uint32_t lps;
|
||||||
|
|
||||||
data->bins_coded += data->bin_count_increment;
|
|
||||||
data->ctx->bins_coded = 1;
|
data->ctx->bins_coded = 1;
|
||||||
|
|
||||||
lps = g_auc_lpst_table[CTX_STATE(data->ctx)][(data->range >> 6) & 3];
|
lps = g_auc_lpst_table[CTX_STATE(data->ctx)][(data->range >> 6) & 3];
|
||||||
|
@ -184,7 +173,6 @@ void cabac_finish(cabac_data *data)
|
||||||
*/
|
*/
|
||||||
void cabac_encode_bin_trm(cabac_data *data, uint8_t bin_value)
|
void cabac_encode_bin_trm(cabac_data *data, uint8_t bin_value)
|
||||||
{
|
{
|
||||||
data->bins_coded += data->bin_count_increment;
|
|
||||||
data->range -= 2;
|
data->range -= 2;
|
||||||
if(bin_value) {
|
if(bin_value) {
|
||||||
data->low += data->range;
|
data->low += data->range;
|
||||||
|
@ -221,7 +209,6 @@ void cabac_flush(cabac_data *data)
|
||||||
*/
|
*/
|
||||||
void cabac_encode_bin_ep(cabac_data *data, uint32_t bin_value)
|
void cabac_encode_bin_ep(cabac_data *data, uint32_t bin_value)
|
||||||
{
|
{
|
||||||
data->bins_coded += data->bin_count_increment;
|
|
||||||
data->low <<= 1;
|
data->low <<= 1;
|
||||||
if (bin_value) {
|
if (bin_value) {
|
||||||
data->low += data->range;
|
data->low += data->range;
|
||||||
|
@ -239,7 +226,6 @@ void cabac_encode_bin_ep(cabac_data *data, uint32_t bin_value)
|
||||||
void cabac_encode_bins_ep(cabac_data *data, uint32_t bin_values, int num_bins)
|
void cabac_encode_bins_ep(cabac_data *data, uint32_t bin_values, int num_bins)
|
||||||
{
|
{
|
||||||
uint32_t pattern;
|
uint32_t pattern;
|
||||||
data->bins_coded += num_bins & -data->bin_count_increment;
|
|
||||||
|
|
||||||
while (num_bins > 8) {
|
while (num_bins > 8) {
|
||||||
num_bins -= 8;
|
num_bins -= 8;
|
||||||
|
|
|
@ -27,9 +27,6 @@ typedef struct
|
||||||
uint32_t buffered_byte;
|
uint32_t buffered_byte;
|
||||||
int32_t num_buffered_bytes;
|
int32_t num_buffered_bytes;
|
||||||
int32_t bits_left;
|
int32_t bits_left;
|
||||||
uint32_t bins_coded;
|
|
||||||
int32_t bin_count_increment;
|
|
||||||
uint64_t frac_bits;
|
|
||||||
bitstream *stream;
|
bitstream *stream;
|
||||||
} cabac_data;
|
} cabac_data;
|
||||||
|
|
||||||
|
@ -44,7 +41,6 @@ extern cabac_data cabac;
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
void cabac_start(cabac_data *data);
|
void cabac_start(cabac_data *data);
|
||||||
void cabac_init(cabac_data *data);
|
|
||||||
void cabac_encode_bin(cabac_data *data, uint32_t bin_value);
|
void cabac_encode_bin(cabac_data *data, uint32_t bin_value);
|
||||||
void cabac_encode_bin_ep(cabac_data *data, uint32_t bin_value);
|
void cabac_encode_bin_ep(cabac_data *data, uint32_t bin_value);
|
||||||
void cabac_encode_bins_ep(cabac_data *data, uint32_t bin_values, int num_bins);
|
void cabac_encode_bins_ep(cabac_data *data, uint32_t bin_values, int num_bins);
|
||||||
|
|
|
@ -125,7 +125,6 @@ int main(int argc, char *argv[])
|
||||||
// Initialization
|
// Initialization
|
||||||
init_tables();
|
init_tables();
|
||||||
init_exp_golomb(4096*8); //Allocate and init exp golomb table
|
init_exp_golomb(4096*8); //Allocate and init exp golomb table
|
||||||
cabac_init(&cabac);
|
|
||||||
scalinglist_init();
|
scalinglist_init();
|
||||||
init_encoder_control(encoder, (bitstream*)malloc(sizeof(bitstream)));
|
init_encoder_control(encoder, (bitstream*)malloc(sizeof(bitstream)));
|
||||||
encoder->ref = picture_list_init(MAX_REF_PIC_COUNT);
|
encoder->ref = picture_list_init(MAX_REF_PIC_COUNT);
|
||||||
|
|
Loading…
Reference in a new issue