Commit bfaf415e authored by Yaowu Xu's avatar Yaowu Xu Committed by Gerrit Code Review

Merge "Added clamp of qindex to valid range"

parents 6859d0f0 e22b12e3
...@@ -134,9 +134,9 @@ int vp9_get_qindex(const struct segmentation *seg, int segment_id, ...@@ -134,9 +134,9 @@ int vp9_get_qindex(const struct segmentation *seg, int segment_id,
int base_qindex) { int base_qindex) {
if (vp9_segfeature_active(seg, segment_id, SEG_LVL_ALT_Q)) { if (vp9_segfeature_active(seg, segment_id, SEG_LVL_ALT_Q)) {
const int data = vp9_get_segdata(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 ? const int seg_qindex = seg->abs_delta == SEGMENT_ABSDATA ?
data : // Abs value data : base_qindex + data;
clamp(base_qindex + data, 0, MAXQ); // Delta value return clamp(seg_qindex, 0, MAXQ);
} else { } else {
return base_qindex; return base_qindex;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment