Revision 9a0a2c9f

View differences:

libavcodec/dnxhddec.c
54 54
    unsigned int mb_width, mb_height;
55 55
    uint32_t mb_scan_index[68];         /* max for 1080p */
56 56
    int cur_field;                      ///< current interlaced field
57
    int index_bits;                     ///< length of index value
58 57
    VLC ac_vlc, dc_vlc, run_vlc;
59
    const uint8_t *ac_level, *run;
60
    const uint8_t *ac_run_flag, *ac_index_flag;
61
    const uint8_t *luma_weigth, *chroma_weigth;
62 58
    int last_dc[3];
63 59
    DSPContext dsp;
64 60
    DECLARE_ALIGNED_16(DCTELEM, blocks[8][64]);
......
124 120
                 ctx->cid_table->run_bits, 1, 1,
125 121
                 ctx->cid_table->run_codes, 2, 2, 0);
126 122

  
127
        ctx->run           = ctx->cid_table->run;
128
        ctx->ac_level      = ctx->cid_table->ac_level;
129
        ctx->ac_run_flag   = ctx->cid_table->ac_run_flag;
130
        ctx->ac_index_flag = ctx->cid_table->ac_index_flag;
131
        ctx->luma_weigth   = ctx->cid_table->luma_weigth;
132
        ctx->chroma_weigth = ctx->cid_table->chroma_weigth;
133

  
134
        ctx->index_bits = ctx->cid_table->index_bits;
135

  
136 123
        ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, ff_zigzag_direct);
137 124
    }
138 125
    return 0;
......
213 200

  
214 201
    if (n&2) {
215 202
        component = 1 + (n&1);
216
        weigth_matrix = ctx->chroma_weigth;
203
        weigth_matrix = ctx->cid_table->chroma_weigth;
217 204
    } else {
218 205
        component = 0;
219
        weigth_matrix = ctx->luma_weigth;
206
        weigth_matrix = ctx->cid_table->luma_weigth;
220 207
    }
221 208

  
222 209
    ctx->last_dc[component] += dnxhd_decode_dc(ctx);
......
225 212
    for (i = 1; ; i++) {
226 213
        index = get_vlc2(&ctx->gb, ctx->ac_vlc.table, DNXHD_VLC_BITS, 2);
227 214
        //av_log(ctx->avctx, AV_LOG_DEBUG, "index %d\n", index);
228
        level = ctx->ac_level[index];
215
        level = ctx->cid_table->ac_level[index];
229 216
        if (!level) { /* EOB */
230 217
            //av_log(ctx->avctx, AV_LOG_DEBUG, "EOB\n");
231 218
            return;
232 219
        }
233 220
        sign = get_sbits(&ctx->gb, 1);
234 221

  
235
        if (ctx->ac_index_flag[index]) {
236
            level += get_bits(&ctx->gb, ctx->index_bits)<<6;
222
        if (ctx->cid_table->ac_index_flag[index]) {
223
            level += get_bits(&ctx->gb, ctx->cid_table->index_bits)<<6;
237 224
        }
238 225

  
239
        if (ctx->ac_run_flag[index]) {
226
        if (ctx->cid_table->ac_run_flag[index]) {
240 227
            index2 = get_vlc2(&ctx->gb, ctx->run_vlc.table, DNXHD_VLC_BITS, 2);
241
            i += ctx->run[index2];
228
            i += ctx->cid_table->run[index2];
242 229
        }
243 230

  
244 231
        j = ctx->scantable.permutated[i];

Also available in: Unified diff