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.
12 #ifndef VP8_COMMON_LOOPFILTER_H_
13 #define VP8_COMMON_LOOPFILTER_H_
15 #include "vpx_ports/mem.h"
16 #include "vpx_config.h"
23 #define MAX_LOOP_FILTER 63
24 /* fraction of total macroblock rows to be used in fast filter level picking */
26 #define PARTIAL_FRAME_FRACTION 8
30 NORMAL_LOOPFILTER
= 0,
40 /* Need to align this structure so when it is declared and
41 * passed it can be loaded into vector registers.
45 DECLARE_ALIGNED(SIMD_WIDTH
, unsigned char, mblim
[MAX_LOOP_FILTER
+ 1][SIMD_WIDTH
]);
46 DECLARE_ALIGNED(SIMD_WIDTH
, unsigned char, blim
[MAX_LOOP_FILTER
+ 1][SIMD_WIDTH
]);
47 DECLARE_ALIGNED(SIMD_WIDTH
, unsigned char, lim
[MAX_LOOP_FILTER
+ 1][SIMD_WIDTH
]);
48 DECLARE_ALIGNED(SIMD_WIDTH
, unsigned char, hev_thr
[4][SIMD_WIDTH
]);
49 unsigned char lvl
[4][4][4];
50 unsigned char hev_thr_lut
[2][MAX_LOOP_FILTER
+ 1];
51 unsigned char mode_lf_lut
[10];
54 typedef struct loop_filter_info
56 const unsigned char * mblim
;
57 const unsigned char * blim
;
58 const unsigned char * lim
;
59 const unsigned char * hev_thr
;
63 typedef void loop_filter_uvfunction
65 unsigned char *u
, /* source pointer */
67 const unsigned char *blimit
,
68 const unsigned char *limit
,
69 const unsigned char *thresh
,
73 /* assorted loopfilter functions which get used elsewhere */
78 void vp8_loop_filter_init(struct VP8Common
*cm
);
80 void vp8_loop_filter_frame_init(struct VP8Common
*cm
,
81 struct macroblockd
*mbd
,
82 int default_filt_lvl
);
84 void vp8_loop_filter_frame(struct VP8Common
*cm
, struct macroblockd
*mbd
,
87 void vp8_loop_filter_partial_frame(struct VP8Common
*cm
,
88 struct macroblockd
*mbd
,
89 int default_filt_lvl
);
91 void vp8_loop_filter_frame_yonly(struct VP8Common
*cm
,
92 struct macroblockd
*mbd
,
93 int default_filt_lvl
);
95 void vp8_loop_filter_update_sharpness(loop_filter_info_n
*lfi
,
98 void vp8_loop_filter_row_normal(struct VP8Common
*cm
,
99 struct modeinfo
*mode_info_context
,
100 int mb_row
, int post_ystride
, int post_uvstride
,
101 unsigned char *y_ptr
, unsigned char *u_ptr
,
102 unsigned char *v_ptr
);
104 void vp8_loop_filter_row_simple(struct VP8Common
*cm
,
105 struct modeinfo
*mode_info_context
,
106 int mb_row
, int post_ystride
, int post_uvstride
,
107 unsigned char *y_ptr
, unsigned char *u_ptr
,
108 unsigned char *v_ptr
);
113 #endif // VP8_COMMON_LOOPFILTER_H_