Commit 9a0a2c9f authored by Baptiste Coudurier's avatar Baptiste Coudurier

no need to duplicate cid table vars in context

Originally committed as revision 9899 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 940e4bf9
...@@ -54,11 +54,7 @@ typedef struct { ...@@ -54,11 +54,7 @@ typedef struct {
unsigned int mb_width, mb_height; unsigned int mb_width, mb_height;
uint32_t mb_scan_index[68]; /* max for 1080p */ uint32_t mb_scan_index[68]; /* max for 1080p */
int cur_field; ///< current interlaced field int cur_field; ///< current interlaced field
int index_bits; ///< length of index value
VLC ac_vlc, dc_vlc, run_vlc; VLC ac_vlc, dc_vlc, run_vlc;
const uint8_t *ac_level, *run;
const uint8_t *ac_run_flag, *ac_index_flag;
const uint8_t *luma_weigth, *chroma_weigth;
int last_dc[3]; int last_dc[3];
DSPContext dsp; DSPContext dsp;
DECLARE_ALIGNED_16(DCTELEM, blocks[8][64]); DECLARE_ALIGNED_16(DCTELEM, blocks[8][64]);
...@@ -124,15 +120,6 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, int cid) ...@@ -124,15 +120,6 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, int cid)
ctx->cid_table->run_bits, 1, 1, ctx->cid_table->run_bits, 1, 1,
ctx->cid_table->run_codes, 2, 2, 0); ctx->cid_table->run_codes, 2, 2, 0);
ctx->run = ctx->cid_table->run;
ctx->ac_level = ctx->cid_table->ac_level;
ctx->ac_run_flag = ctx->cid_table->ac_run_flag;
ctx->ac_index_flag = ctx->cid_table->ac_index_flag;
ctx->luma_weigth = ctx->cid_table->luma_weigth;
ctx->chroma_weigth = ctx->cid_table->chroma_weigth;
ctx->index_bits = ctx->cid_table->index_bits;
ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, ff_zigzag_direct); ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, ff_zigzag_direct);
} }
return 0; return 0;
...@@ -213,10 +200,10 @@ static void dnxhd_decode_dct_block(DNXHDContext *ctx, DCTELEM *block, int n, int ...@@ -213,10 +200,10 @@ static void dnxhd_decode_dct_block(DNXHDContext *ctx, DCTELEM *block, int n, int
if (n&2) { if (n&2) {
component = 1 + (n&1); component = 1 + (n&1);
weigth_matrix = ctx->chroma_weigth; weigth_matrix = ctx->cid_table->chroma_weigth;
} else { } else {
component = 0; component = 0;
weigth_matrix = ctx->luma_weigth; weigth_matrix = ctx->cid_table->luma_weigth;
} }
ctx->last_dc[component] += dnxhd_decode_dc(ctx); ctx->last_dc[component] += dnxhd_decode_dc(ctx);
...@@ -225,20 +212,20 @@ static void dnxhd_decode_dct_block(DNXHDContext *ctx, DCTELEM *block, int n, int ...@@ -225,20 +212,20 @@ static void dnxhd_decode_dct_block(DNXHDContext *ctx, DCTELEM *block, int n, int
for (i = 1; ; i++) { for (i = 1; ; i++) {
index = get_vlc2(&ctx->gb, ctx->ac_vlc.table, DNXHD_VLC_BITS, 2); index = get_vlc2(&ctx->gb, ctx->ac_vlc.table, DNXHD_VLC_BITS, 2);
//av_log(ctx->avctx, AV_LOG_DEBUG, "index %d\n", index); //av_log(ctx->avctx, AV_LOG_DEBUG, "index %d\n", index);
level = ctx->ac_level[index]; level = ctx->cid_table->ac_level[index];
if (!level) { /* EOB */ if (!level) { /* EOB */
//av_log(ctx->avctx, AV_LOG_DEBUG, "EOB\n"); //av_log(ctx->avctx, AV_LOG_DEBUG, "EOB\n");
return; return;
} }
sign = get_sbits(&ctx->gb, 1); sign = get_sbits(&ctx->gb, 1);
if (ctx->ac_index_flag[index]) { if (ctx->cid_table->ac_index_flag[index]) {
level += get_bits(&ctx->gb, ctx->index_bits)<<6; level += get_bits(&ctx->gb, ctx->cid_table->index_bits)<<6;
} }
if (ctx->ac_run_flag[index]) { if (ctx->cid_table->ac_run_flag[index]) {
index2 = get_vlc2(&ctx->gb, ctx->run_vlc.table, DNXHD_VLC_BITS, 2); index2 = get_vlc2(&ctx->gb, ctx->run_vlc.table, DNXHD_VLC_BITS, 2);
i += ctx->run[index2]; i += ctx->cid_table->run[index2];
} }
j = ctx->scantable.permutated[i]; j = ctx->scantable.permutated[i];
......
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