From 30c16fe2993623c9c6741575a093eaaa9901a74b Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Fri, 20 Sep 2013 15:04:02 +0300 Subject: [PATCH] Remove unused members from cabac_data. - Removing them also makes cabac_init unnecessary. --- src/cabac.c | 14 -------------- src/cabac.h | 4 ---- src/encmain.c | 1 - 3 files changed, 19 deletions(-) diff --git a/src/cabac.c b/src/cabac.c index fcbdb241..7d7fd57c 100644 --- a/src/cabac.c +++ b/src/cabac.c @@ -66,16 +66,6 @@ const uint8_t g_auc_renorm_table[32] = 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. */ @@ -95,7 +85,6 @@ void cabac_encode_bin(cabac_data *data, uint32_t bin_value) { uint32_t lps; - data->bins_coded += data->bin_count_increment; data->ctx->bins_coded = 1; 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) { - data->bins_coded += data->bin_count_increment; data->range -= 2; if(bin_value) { 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) { - data->bins_coded += data->bin_count_increment; data->low <<= 1; if (bin_value) { 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) { uint32_t pattern; - data->bins_coded += num_bins & -data->bin_count_increment; while (num_bins > 8) { num_bins -= 8; diff --git a/src/cabac.h b/src/cabac.h index 52d08c6e..fb518814 100644 --- a/src/cabac.h +++ b/src/cabac.h @@ -27,9 +27,6 @@ typedef struct uint32_t buffered_byte; int32_t num_buffered_bytes; int32_t bits_left; - uint32_t bins_coded; - int32_t bin_count_increment; - uint64_t frac_bits; bitstream *stream; } cabac_data; @@ -44,7 +41,6 @@ extern cabac_data cabac; // Functions 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_ep(cabac_data *data, uint32_t bin_value); void cabac_encode_bins_ep(cabac_data *data, uint32_t bin_values, int num_bins); diff --git a/src/encmain.c b/src/encmain.c index dea4d37c..5f5443b9 100644 --- a/src/encmain.c +++ b/src/encmain.c @@ -125,7 +125,6 @@ int main(int argc, char *argv[]) // Initialization init_tables(); init_exp_golomb(4096*8); //Allocate and init exp golomb table - cabac_init(&cabac); scalinglist_init(); init_encoder_control(encoder, (bitstream*)malloc(sizeof(bitstream))); encoder->ref = picture_list_init(MAX_REF_PIC_COUNT);