summaryrefslogtreecommitdiff
path: root/libavcodec/dnxhddec.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-08-04 13:09:08 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-08-04 13:09:08 +0000
commit9a0a2c9f120066be063fc5ff13183f36f91f1604 (patch)
tree65267fce488afae9039c73b8f94a9e1b577ae0fc /libavcodec/dnxhddec.c
parent940e4bf9b9fcca463f804a3b847e94b97a7b858c (diff)
no need to duplicate cid table vars in context
Originally committed as revision 9899 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dnxhddec.c')
-rw-r--r--libavcodec/dnxhddec.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 64be3b905f..e44b2aefe0 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -54,11 +54,7 @@ typedef struct {
unsigned int mb_width, mb_height;
uint32_t mb_scan_index[68]; /* max for 1080p */
int cur_field; ///< current interlaced field
- int index_bits; ///< length of index value
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];
DSPContext dsp;
DECLARE_ALIGNED_16(DCTELEM, blocks[8][64]);
@@ -124,15 +120,6 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, int cid)
ctx->cid_table->run_bits, 1, 1,
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);
}
return 0;
@@ -213,10 +200,10 @@ static void dnxhd_decode_dct_block(DNXHDContext *ctx, DCTELEM *block, int n, int
if (n&2) {
component = 1 + (n&1);
- weigth_matrix = ctx->chroma_weigth;
+ weigth_matrix = ctx->cid_table->chroma_weigth;
} else {
component = 0;
- weigth_matrix = ctx->luma_weigth;
+ weigth_matrix = ctx->cid_table->luma_weigth;
}
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
for (i = 1; ; i++) {
index = get_vlc2(&ctx->gb, ctx->ac_vlc.table, DNXHD_VLC_BITS, 2);
//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 */
//av_log(ctx->avctx, AV_LOG_DEBUG, "EOB\n");
return;
}
sign = get_sbits(&ctx->gb, 1);
- if (ctx->ac_index_flag[index]) {
- level += get_bits(&ctx->gb, ctx->index_bits)<<6;
+ if (ctx->cid_table->ac_index_flag[index]) {
+ 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);
- i += ctx->run[index2];
+ i += ctx->cid_table->run[index2];
}
j = ctx->scantable.permutated[i];