ref: bfaf415ea7a90af4f093733d5e0a115f73d03930
parent: 6859d0f0d0175f5bad38e12da5b3eabed11f8d67
parent: e22b12e3040dca09d212da3bc3e92595449549be
author: Yaowu Xu <yaowu@google.com>
date: Mon Feb 24 03:28:07 EST 2014
Merge "Added clamp of qindex to valid range"
--- a/vp9/common/vp9_quant_common.c
+++ b/vp9/common/vp9_quant_common.c
@@ -134,9 +134,9 @@
int base_qindex) {
if (vp9_segfeature_active(seg, segment_id, SEG_LVL_ALT_Q)) {
const int data = vp9_get_segdata(seg, segment_id, SEG_LVL_ALT_Q);
- return seg->abs_delta == SEGMENT_ABSDATA ?
- data : // Abs value
- clamp(base_qindex + data, 0, MAXQ); // Delta value
+ const int seg_qindex = seg->abs_delta == SEGMENT_ABSDATA ?
+ data : base_qindex + data;
+ return clamp(seg_qindex, 0, MAXQ);
} else {
return base_qindex;
}
--
⑨