Index: source/libvpx/vp8/common/loopfilter.c |
=================================================================== |
--- source/libvpx/vp8/common/loopfilter.c (revision 177019) |
+++ source/libvpx/vp8/common/loopfilter.c (working copy) |
@@ -567,46 +567,28 @@ |
int mb_cols = post->y_width >> 4; |
int mb_rows = post->y_height >> 4; |
- int linestocopy, i; |
+ int linestocopy; |
loop_filter_info_n *lfi_n = &cm->lf_info; |
loop_filter_info lfi; |
int filter_level; |
- int alt_flt_enabled = mbd->segmentation_enabled; |
FRAME_TYPE frame_type = cm->frame_type; |
const MODE_INFO *mode_info_context; |
- int lvl_seg[MAX_MB_SEGMENTS]; |
+#if 0 |
+ if(default_filt_lvl == 0) /* no filter applied */ |
+ return; |
+#endif |
+ /* Initialize the loop filter for this frame. */ |
+ vp8_loop_filter_frame_init( cm, mbd, default_filt_lvl); |
+ |
/* number of MB rows to use in partial filtering */ |
linestocopy = mb_rows / PARTIAL_FRAME_FRACTION; |
linestocopy = linestocopy ? linestocopy << 4 : 16; /* 16 lines per MB */ |
- /* Note the baseline filter values for each segment */ |
- /* See vp8_loop_filter_frame_init. Rather than call that for each change |
- * to default_filt_lvl, copy the relevant calculation here. |
- */ |
- if (alt_flt_enabled) |
- { |
- for (i = 0; i < MAX_MB_SEGMENTS; i++) |
- { /* Abs value */ |
- if (mbd->mb_segement_abs_delta == SEGMENT_ABSDATA) |
- { |
- lvl_seg[i] = mbd->segment_feature_data[MB_LVL_ALT_LF][i]; |
- } |
- /* Delta Value */ |
- else |
- { |
- lvl_seg[i] = default_filt_lvl |
- + mbd->segment_feature_data[MB_LVL_ALT_LF][i]; |
- lvl_seg[i] = (lvl_seg[i] > 0) ? |
- ((lvl_seg[i] > 63) ? 63: lvl_seg[i]) : 0; |
- } |
- } |
- } |
- |
/* Set up the buffer pointers; partial image starts at ~middle of frame */ |
y_ptr = post->y_buffer + ((post->y_height >> 5) * 16) * post->y_stride; |
mode_info_context = cm->mi + (post->y_height >> 5) * (mb_cols + 1); |
@@ -620,11 +602,13 @@ |
mode_info_context->mbmi.mode != SPLITMV && |
mode_info_context->mbmi.mb_skip_coeff); |
- if (alt_flt_enabled) |
- filter_level = lvl_seg[mode_info_context->mbmi.segment_id]; |
- else |
- filter_level = default_filt_lvl; |
+ const int mode_index = |
+ lfi_n->mode_lf_lut[mode_info_context->mbmi.mode]; |
+ const int seg = mode_info_context->mbmi.segment_id; |
+ const int ref_frame = mode_info_context->mbmi.ref_frame; |
+ filter_level = lfi_n->lvl[seg][ref_frame][mode_index]; |
+ |
if (filter_level) |
{ |
if (cm->filter_type == NORMAL_LOOPFILTER) |