void vp9_init_dequantizer(VP9_COMMON *pc) { int q; for (q = 0; q < QINDEX_RANGE; q++) { // DC value pc->y_dequant[q][0] = vp9_dc_quant(q, pc->y_dc_delta_q); pc->uv_dequant[q][0] = vp9_dc_quant(q, pc->uv_dc_delta_q); // AC values pc->y_dequant[q][1] = vp9_ac_quant(q, 0); pc->uv_dequant[q][1] = vp9_ac_quant(q, pc->uv_ac_delta_q); } }
// These functions use formulaic calculations to make playing with the // quantizer tables easier. If necessary they can be replaced by lookup // tables if and when things settle down in the experimental bitstream double vp9_convert_qindex_to_q(int qindex) { // Convert the index to a real Q value (scaled down to match old Q values) return vp9_ac_quant(qindex, 0) / 4.0; }
static int get_aq_c_strength(int q_index, vpx_bit_depth_t bit_depth) { // Approximate base quatizer (truncated to int) const int base_quant = vp9_ac_quant(q_index, 0, bit_depth) / 4; return (base_quant > 10) + (base_quant > 25); }