| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(const struct segmentation *seg, int segment_id, | 133 int vp9_get_qindex(const struct segmentation *seg, int segment_id, |
| 134 int base_qindex) { | 134 int base_qindex) { |
| 135 if (vp9_segfeature_active(seg, segment_id, SEG_LVL_ALT_Q)) { | 135 if (vp9_segfeature_active(seg, segment_id, SEG_LVL_ALT_Q)) { |
| 136 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); |
| 137 return seg->abs_delta == SEGMENT_ABSDATA ? | 137 const int seg_qindex = seg->abs_delta == SEGMENT_ABSDATA ? |
| 138 data : // Abs value | 138 data : base_qindex + data; |
| 139 clamp(base_qindex + data, 0, MAXQ); // Delta value | 139 return clamp(seg_qindex, 0, MAXQ); |
| 140 } else { | 140 } else { |
| 141 return base_qindex; | 141 return base_qindex; |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| OLD | NEW |