added clamp of segment loop filter level

for ABSDATA mode, so segment loop filter level always fall in valid
range for both Absolute and delta modes.

Change-Id: If90df3411479533dbdab63f8ae088d2f5dd174a9
This commit is contained in:
Yaowu Xu 2014-02-22 12:41:06 -08:00 committed by Gerrit Code Review
parent bfaf415ea7
commit 05e850cb9e

View File

@ -262,9 +262,9 @@ void vp9_loop_filter_frame_init(VP9_COMMON *cm, int default_filt_lvl) {
int lvl_seg = default_filt_lvl;
if (vp9_segfeature_active(seg, seg_id, SEG_LVL_ALT_LF)) {
const int data = vp9_get_segdata(seg, seg_id, SEG_LVL_ALT_LF);
lvl_seg = seg->abs_delta == SEGMENT_ABSDATA
? data
: clamp(default_filt_lvl + data, 0, MAX_LOOP_FILTER);
lvl_seg = clamp(seg->abs_delta == SEGMENT_ABSDATA ?
data : default_filt_lvl + data,
0, MAX_LOOP_FILTER);
}
if (!lf->mode_ref_delta_enabled) {