OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 int16_t vp9_dc_quant(int qindex, int delta) { | 124 int16_t vp9_dc_quant(int qindex, int delta) { |
125 return dc_qlookup[clamp(qindex + delta, 0, MAXQ)]; | 125 return dc_qlookup[clamp(qindex + delta, 0, MAXQ)]; |
126 } | 126 } |
127 | 127 |
128 int16_t vp9_ac_quant(int qindex, int delta) { | 128 int16_t vp9_ac_quant(int qindex, int delta) { |
129 return ac_qlookup[clamp(qindex + delta, 0, MAXQ)]; | 129 return ac_qlookup[clamp(qindex + delta, 0, MAXQ)]; |
130 } | 130 } |
131 | 131 |
132 | 132 |
133 int vp9_get_qindex(struct segmentation *seg, int segment_id, int base_qindex) { | 133 int vp9_get_qindex(const struct segmentation *seg, int segment_id, |
| 134 int base_qindex) { |
134 if (vp9_segfeature_active(seg, segment_id, SEG_LVL_ALT_Q)) { | 135 if (vp9_segfeature_active(seg, segment_id, SEG_LVL_ALT_Q)) { |
135 const int data = vp9_get_segdata(seg, segment_id, SEG_LVL_ALT_Q); | 136 const int data = vp9_get_segdata(seg, segment_id, SEG_LVL_ALT_Q); |
136 return seg->abs_delta == SEGMENT_ABSDATA ? | 137 return seg->abs_delta == SEGMENT_ABSDATA ? |
137 data : // Abs value | 138 data : // Abs value |
138 clamp(base_qindex + data, 0, MAXQ); // Delta value | 139 clamp(base_qindex + data, 0, MAXQ); // Delta value |
139 } else { | 140 } else { |
140 return base_qindex; | 141 return base_qindex; |
141 } | 142 } |
142 } | 143 } |
143 | 144 |
OLD | NEW |