Revision 0a45801f libavcodec/vc1.c

View differences:

libavcodec/vc1.c
1331 1331
    else
1332 1332
        v->pq = pquant_table[v->quantizer_mode-1][pqindex];
1333 1333

  
1334
    v->pquantizer = 1;
1334 1335
    if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)
1335 1336
        v->pquantizer = pqindex < 9;
1336
    if (v->quantizer_mode == QUANT_UNIFORM || v->quantizer_mode == QUANT_NON_UNIFORM)
1337
        v->pquantizer = v->quantizer_mode == QUANT_UNIFORM;
1337
    if (v->quantizer_mode == QUANT_NON_UNIFORM)
1338
        v->pquantizer = 0;
1338 1339
    v->pqindex = pqindex;
1339 1340
    if (pqindex < 9) v->halfpq = get_bits(gb, 1);
1340 1341
    else v->halfpq = 0;
......
2151 2152
    ac_val = s->ac_val[0][0] + s->block_index[n] * 16;
2152 2153
    ac_val2 = ac_val;
2153 2154

  
2154
    scale = mquant * 2;
2155
    scale = mquant * 2 + v->halfpq;
2155 2156

  
2156 2157
    if(dc_pred_dir) //left
2157 2158
        ac_val -= 16;
......
2289 2290
        if(ttblk == TT_8X4_TOP || ttblk == TT_8X4_BOTTOM) ttblk = TT_8X4;
2290 2291
        if(ttblk == TT_4X8_RIGHT || ttblk == TT_4X8_LEFT) ttblk = TT_4X8;
2291 2292
    }
2292
    scale = 2 * mquant;
2293
    scale = 2 * mquant + v->halfpq;
2293 2294

  
2294 2295
    // convert transforms like 8X4_TOP to generic TT and SUBBLKPAT
2295 2296
    if(ttblk == TT_8X4_TOP || ttblk == TT_8X4_BOTTOM) {
......
2311 2312
                break;
2312 2313
            idx = vc1_simple_progressive_8x8_zz[i++];
2313 2314
            block[idx] = value * scale;
2315
            if(!v->pquantizer)
2316
                block[idx] += (block[idx] < 0) ? -mquant : mquant;
2314 2317
        }
2315 2318
        vc1_inv_trans(block, 8, 8);
2316 2319
        break;
......
2326 2329
                    break;
2327 2330
                idx = vc1_simple_progressive_4x4_zz[i++];
2328 2331
                block[idx + off] = value * scale;
2332
                if(!v->pquantizer)
2333
                    block[idx + off] += (block[idx + off] < 0) ? -mquant : mquant;
2329 2334
            }
2330 2335
            if(!(subblkpat & (1 << (3 - j))))
2331 2336
                vc1_inv_trans(block + off, 4, 4);
......
2343 2348
                    break;
2344 2349
                idx = vc1_simple_progressive_8x4_zz[i++];
2345 2350
                block[idx + off] = value * scale;
2351
                if(!v->pquantizer)
2352
                    block[idx + off] += (block[idx + off] < 0) ? -mquant : mquant;
2346 2353
            }
2347 2354
            if(!(subblkpat & (1 << (1 - j))))
2348 2355
                vc1_inv_trans(block + off, 8, 4);
......
2360 2367
                    break;
2361 2368
                idx = vc1_simple_progressive_4x8_zz[i++];
2362 2369
                block[idx + off] = value * scale;
2370
                if(!v->pquantizer)
2371
                    block[idx + off] += (block[idx + off] < 0) ? -mquant : mquant;
2363 2372
            }
2364 2373
            if(!(subblkpat & (1 << (1 - j))))
2365 2374
                vc1_inv_trans(block + off, 4, 8);

Also available in: Unified diff