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"
17 #define MAX_LOOP_FILTER 63
21 NORMAL_LOOPFILTER
= 0,
26 * Need to align this structure so when it is declared and
27 * passed it can be loaded into vector registers.
31 DECLARE_ALIGNED(16, signed char, lim
[16]);
32 DECLARE_ALIGNED(16, signed char, flim
[16]);
33 DECLARE_ALIGNED(16, signed char, thr
[16]);
34 DECLARE_ALIGNED(16, signed char, mbflim
[16]);
35 DECLARE_ALIGNED(16, signed char, mbthr
[16]);
36 DECLARE_ALIGNED(16, signed char, uvlim
[16]);
37 DECLARE_ALIGNED(16, signed char, uvflim
[16]);
38 DECLARE_ALIGNED(16, signed char, uvthr
[16]);
39 DECLARE_ALIGNED(16, signed char, uvmbflim
[16]);
40 DECLARE_ALIGNED(16, signed char, uvmbthr
[16]);
44 #define prototype_loopfilter(sym) \
45 void sym(unsigned char *src, int pitch, const signed char *flimit,\
46 const signed char *limit, const signed char *thresh, int count)
48 #define prototype_loopfilter_block(sym) \
49 void sym(unsigned char *y, unsigned char *u, unsigned char *v,\
50 int ystride, int uv_stride, loop_filter_info *lfi, int simpler)
52 #if ARCH_X86 || ARCH_X86_64
53 #include "x86/loopfilter_x86.h"
57 #include "arm/loopfilter_arm.h"
60 #ifndef vp8_lf_normal_mb_v
61 #define vp8_lf_normal_mb_v vp8_loop_filter_mbv_c
63 extern prototype_loopfilter_block(vp8_lf_normal_mb_v
);
65 #ifndef vp8_lf_normal_b_v
66 #define vp8_lf_normal_b_v vp8_loop_filter_bv_c
68 extern prototype_loopfilter_block(vp8_lf_normal_b_v
);
70 #ifndef vp8_lf_normal_mb_h
71 #define vp8_lf_normal_mb_h vp8_loop_filter_mbh_c
73 extern prototype_loopfilter_block(vp8_lf_normal_mb_h
);
75 #ifndef vp8_lf_normal_b_h
76 #define vp8_lf_normal_b_h vp8_loop_filter_bh_c
78 extern prototype_loopfilter_block(vp8_lf_normal_b_h
);
81 #ifndef vp8_lf_simple_mb_v
82 #define vp8_lf_simple_mb_v vp8_loop_filter_mbvs_c
84 extern prototype_loopfilter_block(vp8_lf_simple_mb_v
);
86 #ifndef vp8_lf_simple_b_v
87 #define vp8_lf_simple_b_v vp8_loop_filter_bvs_c
89 extern prototype_loopfilter_block(vp8_lf_simple_b_v
);
91 #ifndef vp8_lf_simple_mb_h
92 #define vp8_lf_simple_mb_h vp8_loop_filter_mbhs_c
94 extern prototype_loopfilter_block(vp8_lf_simple_mb_h
);
96 #ifndef vp8_lf_simple_b_h
97 #define vp8_lf_simple_b_h vp8_loop_filter_bhs_c
99 extern prototype_loopfilter_block(vp8_lf_simple_b_h
);
101 typedef prototype_loopfilter_block((*vp8_lf_block_fn_t
));
104 vp8_lf_block_fn_t normal_mb_v
;
105 vp8_lf_block_fn_t normal_b_v
;
106 vp8_lf_block_fn_t normal_mb_h
;
107 vp8_lf_block_fn_t normal_b_h
;
108 vp8_lf_block_fn_t simple_mb_v
;
109 vp8_lf_block_fn_t simple_b_v
;
110 vp8_lf_block_fn_t simple_mb_h
;
111 vp8_lf_block_fn_t simple_b_h
;
112 } vp8_loopfilter_rtcd_vtable_t
;
114 #if CONFIG_RUNTIME_CPU_DETECT
115 #define LF_INVOKE(ctx,fn) (ctx)->fn
117 #define LF_INVOKE(ctx,fn) vp8_lf_##fn
120 typedef void loop_filter_uvfunction
122 unsigned char *u
, /* source pointer */
124 const signed char *flimit
,
125 const signed char *limit
,
126 const signed char *thresh
,