2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
15 #include "vpx_ports/mem.h"
16 #include "vpx_config.h"
19 #define MAX_LOOP_FILTER 63
20 /* fraction of total macroblock rows to be used in fast filter level picking */
22 #define PARTIAL_FRAME_FRACTION 8
26 NORMAL_LOOPFILTER = 0,
36 /* Need to align this structure so when it is declared and
37 * passed it can be loaded into vector registers.
41 DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, mblim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]);
42 DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, blim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]);
43 DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, lim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]);
44 DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, hev_thr[4][SIMD_WIDTH]);
45 unsigned char lvl[4][4][4];
46 unsigned char hev_thr_lut[2][MAX_LOOP_FILTER + 1];
47 unsigned char mode_lf_lut[10];
50 typedef struct loop_filter_info
52 const unsigned char * mblim;
53 const unsigned char * blim;
54 const unsigned char * lim;
55 const unsigned char * hev_thr;
59 typedef void loop_filter_uvfunction
61 unsigned char *u, /* source pointer */
63 const unsigned char *blimit,
64 const unsigned char *limit,
65 const unsigned char *thresh,
69 /* assorted loopfilter functions which get used elsewhere */
73 void vp8_loop_filter_init(struct VP8Common *cm);
75 void vp8_loop_filter_frame_init(struct VP8Common *cm,
76 struct macroblockd *mbd,
77 int default_filt_lvl);
79 void vp8_loop_filter_frame(struct VP8Common *cm, struct macroblockd *mbd);
81 void vp8_loop_filter_partial_frame(struct VP8Common *cm,
82 struct macroblockd *mbd,
83 int default_filt_lvl);
85 void vp8_loop_filter_frame_yonly(struct VP8Common *cm,
86 struct macroblockd *mbd,
87 int default_filt_lvl);
89 void vp8_loop_filter_update_sharpness(loop_filter_info_n *lfi,