static void vp6_parse_coeff(vp56_context_t *s)
{
    vp56_range_coder_t *c = s->ccp;
    vp56_model_t *model = s->modelp;
    uint8_t *permute = s->scantable.permutated;
    uint8_t *model1, *model2, *model3;
    int coeff, sign, coeff_idx;
    int b, i, cg, idx, ctx;
    int pt = 0;
    for (b=0; b<6; b++) {
        int ct = 1;
        int run = 1;
        if (b > 3) pt = 1;
        ctx = s->left_block[vp56_b6to4[b]].not_null_dc
              + s->above_blocks[s->above_block_idx[b]].not_null_dc;
        model1 = model->coeff_dccv[pt];
        model2 = model->coeff_dcct[pt][ctx];
        for (coeff_idx=0; coeff_idx<64; ) {
            if ((coeff_idx>1 && ct==0) || vp56_rac_get_prob(c, model2[0])) {
                if (vp56_rac_get_prob(c, model2[2])) {
                    if (vp56_rac_get_prob(c, model2[3])) {
                        idx = vp56_rac_get_tree(c, vp56_pc_tree, model1);
                        coeff = vp56_coeff_bias[idx+5];
                        for (i=vp56_coeff_bit_length[idx]; i>=0; i--)
                            coeff += vp56_rac_get_prob(c, vp56_coeff_parse_table[idx][i]) << i;
                    } else {
                        if (vp56_rac_get_prob(c, model2[4]))
                            coeff = 3 + vp56_rac_get_prob(c, model1[5]);
                        else
                            coeff = 2;
                    }
                    ct = 2;
                } else {
                    ct = 1;
                    coeff = 1;
                }
                sign = vp56_rac_get(c);
                coeff = (coeff ^ -sign) + sign;
                if (coeff_idx)
                    coeff *= s->dequant_ac;
                idx = model->coeff_index_to_pos[coeff_idx];
                s->block_coeff[b][permute[idx]] = coeff;
                run = 1;
            } else {
                ct = 0;
                if (coeff_idx > 0) {
                    if (!vp56_rac_get_prob(c, model2[1]))
                        break;
                    model3 = model->coeff_runv[coeff_idx >= 6];
                    run = vp56_rac_get_tree(c, vp6_pcr_tree, model3);
                    if (!run)
                        for (run=9, i=0; i<6; i++)
                            run += vp56_rac_get_prob(c, model3[i+8]) << i;
                }
            }
            cg = vp6_coeff_groups[coeff_idx+=run];
            model1 = model2 = model->coeff_ract[pt][ct][cg];
        }
        s->left_block[vp56_b6to4[b]].not_null_dc =
        s->above_blocks[s->above_block_idx[b]].not_null_dc = !!s->block_coeff[b][0];
    }
}
['static void vp6_parse_coeff(vp56_context_t *s)\n{\n    vp56_range_coder_t *c = s->ccp;\n    vp56_model_t *model = s->modelp;\n    uint8_t *permute = s->scantable.permutated;\n    uint8_t *model1, *model2, *model3;\n    int coeff, sign, coeff_idx;\n    int b, i, cg, idx, ctx;\n    int pt = 0;\n    for (b=0; b<6; b++) {\n        int ct = 1;\n        int run = 1;\n        if (b > 3) pt = 1;\n        ctx = s->left_block[vp56_b6to4[b]].not_null_dc\n              + s->above_blocks[s->above_block_idx[b]].not_null_dc;\n        model1 = model->coeff_dccv[pt];\n        model2 = model->coeff_dcct[pt][ctx];\n        for (coeff_idx=0; coeff_idx<64; ) {\n            if ((coeff_idx>1 && ct==0) || vp56_rac_get_prob(c, model2[0])) {\n                if (vp56_rac_get_prob(c, model2[2])) {\n                    if (vp56_rac_get_prob(c, model2[3])) {\n                        idx = vp56_rac_get_tree(c, vp56_pc_tree, model1);\n                        coeff = vp56_coeff_bias[idx+5];\n                        for (i=vp56_coeff_bit_length[idx]; i>=0; i--)\n                            coeff += vp56_rac_get_prob(c, vp56_coeff_parse_table[idx][i]) << i;\n                    } else {\n                        if (vp56_rac_get_prob(c, model2[4]))\n                            coeff = 3 + vp56_rac_get_prob(c, model1[5]);\n                        else\n                            coeff = 2;\n                    }\n                    ct = 2;\n                } else {\n                    ct = 1;\n                    coeff = 1;\n                }\n                sign = vp56_rac_get(c);\n                coeff = (coeff ^ -sign) + sign;\n                if (coeff_idx)\n                    coeff *= s->dequant_ac;\n                idx = model->coeff_index_to_pos[coeff_idx];\n                s->block_coeff[b][permute[idx]] = coeff;\n                run = 1;\n            } else {\n                ct = 0;\n                if (coeff_idx > 0) {\n                    if (!vp56_rac_get_prob(c, model2[1]))\n                        break;\n                    model3 = model->coeff_runv[coeff_idx >= 6];\n                    run = vp56_rac_get_tree(c, vp6_pcr_tree, model3);\n                    if (!run)\n                        for (run=9, i=0; i<6; i++)\n                            run += vp56_rac_get_prob(c, model3[i+8]) << i;\n                }\n            }\n            cg = vp6_coeff_groups[coeff_idx+=run];\n            model1 = model2 = model->coeff_ract[pt][ct][cg];\n        }\n        s->left_block[vp56_b6to4[b]].not_null_dc =\n        s->above_blocks[s->above_block_idx[b]].not_null_dc = !!s->block_coeff[b][0];\n    }\n}']