Lines Matching refs:cpi
267 void vp8cx_init_quantizer(VP8_COMP *cpi)
279 quant_val = vp8_dc_quant(Q, cpi->common.y1dc_delta_q);
280 cpi->Y1quant_fast[Q][0] = (1 << 16) / quant_val;
281 invert_quant(cpi->sf.improved_quant, cpi->Y1quant[Q] + 0,
282 cpi->Y1quant_shift[Q] + 0, quant_val);
283 cpi->Y1zbin[Q][0] = ((qzbin_factors[Q] * quant_val) + 64) >> 7;
284 cpi->Y1round[Q][0] = (qrounding_factors[Q] * quant_val) >> 7;
285 cpi->common.Y1dequant[Q][0] = quant_val;
286 cpi->zrun_zbin_boost_y1[Q][0] = (quant_val * zbin_boost[0]) >> 7;
288 quant_val = vp8_dc2quant(Q, cpi->common.y2dc_delta_q);
289 cpi->Y2quant_fast[Q][0] = (1 << 16) / quant_val;
290 invert_quant(cpi->sf.improved_quant, cpi->Y2quant[Q] + 0,
291 cpi->Y2quant_shift[Q] + 0, quant_val);
292 cpi->Y2zbin[Q][0] = ((qzbin_factors_y2[Q] * quant_val) + 64) >> 7;
293 cpi->Y2round[Q][0] = (qrounding_factors_y2[Q] * quant_val) >> 7;
294 cpi->common.Y2dequant[Q][0] = quant_val;
295 cpi->zrun_zbin_boost_y2[Q][0] = (quant_val * zbin_boost[0]) >> 7;
297 quant_val = vp8_dc_uv_quant(Q, cpi->common.uvdc_delta_q);
298 cpi->UVquant_fast[Q][0] = (1 << 16) / quant_val;
299 invert_quant(cpi->sf.improved_quant, cpi->UVquant[Q] + 0,
300 cpi->UVquant_shift[Q] + 0, quant_val);
301 cpi->UVzbin[Q][0] = ((qzbin_factors[Q] * quant_val) + 64) >> 7;;
302 cpi->UVround[Q][0] = (qrounding_factors[Q] * quant_val) >> 7;
303 cpi->common.UVdequant[Q][0] = quant_val;
304 cpi->zrun_zbin_boost_uv[Q][0] = (quant_val * zbin_boost[0]) >> 7;
308 cpi->Y1quant_fast[Q][1] = (1 << 16) / quant_val;
309 invert_quant(cpi->sf.improved_quant, cpi->Y1quant[Q] + 1,
310 cpi->Y1quant_shift[Q] + 1, quant_val);
311 cpi->Y1zbin[Q][1] = ((qzbin_factors[Q] * quant_val) + 64) >> 7;
312 cpi->Y1round[Q][1] = (qrounding_factors[Q] * quant_val) >> 7;
313 cpi->common.Y1dequant[Q][1] = quant_val;
314 cpi->zrun_zbin_boost_y1[Q][1] = (quant_val * zbin_boost[1]) >> 7;
316 quant_val = vp8_ac2quant(Q, cpi->common.y2ac_delta_q);
317 cpi->Y2quant_fast[Q][1] = (1 << 16) / quant_val;
318 invert_quant(cpi->sf.improved_quant, cpi->Y2quant[Q] + 1,
319 cpi->Y2quant_shift[Q] + 1, quant_val);
320 cpi->Y2zbin[Q][1] = ((qzbin_factors_y2[Q] * quant_val) + 64) >> 7;
321 cpi->Y2round[Q][1] = (qrounding_factors_y2[Q] * quant_val) >> 7;
322 cpi->common.Y2dequant[Q][1] = quant_val;
323 cpi->zrun_zbin_boost_y2[Q][1] = (quant_val * zbin_boost[1]) >> 7;
325 quant_val = vp8_ac_uv_quant(Q, cpi->common.uvac_delta_q);
326 cpi->UVquant_fast[Q][1] = (1 << 16) / quant_val;
327 invert_quant(cpi->sf.improved_quant, cpi->UVquant[Q] + 1,
328 cpi->UVquant_shift[Q] + 1, quant_val);
329 cpi->UVzbin[Q][1] = ((qzbin_factors[Q] * quant_val) + 64) >> 7;
330 cpi->UVround[Q][1] = (qrounding_factors[Q] * quant_val) >> 7;
331 cpi->common.UVdequant[Q][1] = quant_val;
332 cpi->zrun_zbin_boost_uv[Q][1] = (quant_val * zbin_boost[1]) >> 7;
336 cpi->Y1quant_fast[Q][i] = cpi->Y1quant_fast[Q][1];
337 cpi->Y1quant[Q][i] = cpi->Y1quant[Q][1];
338 cpi->Y1quant_shift[Q][i] = cpi->Y1quant_shift[Q][1];
339 cpi->Y1zbin[Q][i] = cpi->Y1zbin[Q][1];
340 cpi->Y1round[Q][i] = cpi->Y1round[Q][1];
341 cpi->zrun_zbin_boost_y1[Q][i] = (cpi->common.Y1dequant[Q][1] *
344 cpi->Y2quant_fast[Q][i] = cpi->Y2quant_fast[Q][1];
345 cpi->Y2quant[Q][i] = cpi->Y2quant[Q][1];
346 cpi->Y2quant_shift[Q][i] = cpi->Y2quant_shift[Q][1];
347 cpi->Y2zbin[Q][i] = cpi->Y2zbin[Q][1];
348 cpi->Y2round[Q][i] = cpi->Y2round[Q][1];
349 cpi->zrun_zbin_boost_y2[Q][i] = (cpi->common.Y2dequant[Q][1] *
352 cpi->UVquant_fast[Q][i] = cpi->UVquant_fast[Q][1];
353 cpi->UVquant[Q][i] = cpi->UVquant[Q][1];
354 cpi->UVquant_shift[Q][i] = cpi->UVquant_shift[Q][1];
355 cpi->UVzbin[Q][i] = cpi->UVzbin[Q][1];
356 cpi->UVround[Q][i] = cpi->UVround[Q][1];
357 cpi->zrun_zbin_boost_uv[Q][i] = (cpi->common.UVdequant[Q][1] *
364 (( cpi->common.Y1dequant[QIndex][1] * \
370 (( cpi->common.UVdequant[QIndex][1] * \
376 (( cpi->common.Y2dequant[QIndex][1] * \
381 void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x, int ok_to_skip)
397 QIndex = cpi->common.base_qindex + xd->segment_feature_data[MB_LVL_ALT_Q][xd->mode_info_context->mbmi.segment_id];
403 QIndex = cpi->common.base_qindex;
415 xd->dequant_y1[0] = cpi->common.Y1dequant[QIndex][0];
416 xd->dequant_y2[0] = cpi->common.Y2dequant[QIndex][0];
417 xd->dequant_uv[0] = cpi->common.UVdequant[QIndex][0];
422 xd->dequant_y1[i] = cpi->common.Y1dequant[QIndex][1];
423 xd->dequant_y2[i] = cpi->common.Y2dequant[QIndex][1];
424 xd->dequant_uv[i] = cpi->common.UVdequant[QIndex][1];
443 x->block[i].quant = cpi->Y1quant[QIndex];
444 x->block[i].quant_fast = cpi->Y1quant_fast[QIndex];
445 x->block[i].quant_shift = cpi->Y1quant_shift[QIndex];
446 x->block[i].zbin = cpi->Y1zbin[QIndex];
447 x->block[i].round = cpi->Y1round[QIndex];
448 x->block[i].zrun_zbin_boost = cpi->zrun_zbin_boost_y1[QIndex];
457 x->block[i].quant = cpi->UVquant[QIndex];
458 x->block[i].quant_fast = cpi->UVquant_fast[QIndex];
459 x->block[i].quant_shift = cpi->UVquant_shift[QIndex];
460 x->block[i].zbin = cpi->UVzbin[QIndex];
461 x->block[i].round = cpi->UVround[QIndex];
462 x->block[i].zrun_zbin_boost = cpi->zrun_zbin_boost_uv[QIndex];
469 x->block[24].quant_fast = cpi->Y2quant_fast[QIndex];
470 x->block[24].quant = cpi->Y2quant[QIndex];
471 x->block[24].quant_shift = cpi->Y2quant_shift[QIndex];
472 x->block[24].zbin = cpi->Y2zbin[QIndex];
473 x->block[24].round = cpi->Y2round[QIndex];
474 x->block[24].zrun_zbin_boost = cpi->zrun_zbin_boost_y2[QIndex];
513 void vp8_update_zbin_extra(VP8_COMP *cpi, MACROBLOCK *x)
539 void vp8cx_frame_init_quantizer(VP8_COMP *cpi)
542 cpi->mb.zbin_mode_boost = 0;
545 vp8cx_mb_init_quantizer(cpi, &cpi->mb, 0);
549 void vp8_set_quantizer(struct VP8_COMP *cpi, int Q)
551 VP8_COMMON *cm = &cpi->common;
552 MACROBLOCKD *mbd = &cpi->mb.e_mbd;
577 mbd->segment_feature_data[MB_LVL_ALT_Q][0] = cpi->segment_feature_data[MB_LVL_ALT_Q][0];
578 mbd->segment_feature_data[MB_LVL_ALT_Q][1] = cpi->segment_feature_data[MB_LVL_ALT_Q][1];
579 mbd->segment_feature_data[MB_LVL_ALT_Q][2] = cpi->segment_feature_data[MB_LVL_ALT_Q][2];
580 mbd->segment_feature_data[MB_LVL_ALT_Q][3] = cpi->segment_feature_data[MB_LVL_ALT_Q][3];
584 vp8cx_init_quantizer(cpi);