2 * Copyright (c) 2010 The VP8 project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license and patent
5 * grant that can be found in the LICENSE file in the root of the source
6 * tree. All contributing project authors may be found in the AUTHORS
7 * file in the root of the source tree.
14 #include "vpx_ports/mem.h"
16 #define MAX_LOOP_FILTER 63
20 NORMAL_LOOPFILTER
= 0,
25 // Need to align this structure so when it is declared and
26 // passed it can be loaded into vector registers.
30 DECLARE_ALIGNED(16, signed char, lim
[16]);
31 DECLARE_ALIGNED(16, signed char, flim
[16]);
32 DECLARE_ALIGNED(16, signed char, thr
[16]);
33 DECLARE_ALIGNED(16, signed char, mbflim
[16]);
34 DECLARE_ALIGNED(16, signed char, mbthr
[16]);
35 DECLARE_ALIGNED(16, signed char, uvlim
[16]);
36 DECLARE_ALIGNED(16, signed char, uvflim
[16]);
37 DECLARE_ALIGNED(16, signed char, uvthr
[16]);
38 DECLARE_ALIGNED(16, signed char, uvmbflim
[16]);
39 DECLARE_ALIGNED(16, signed char, uvmbthr
[16]);
43 #define prototype_loopfilter(sym) \
44 void sym(unsigned char *src, int pitch, const signed char *flimit,\
45 const signed char *limit, const signed char *thresh, int count)
47 #define prototype_loopfilter_block(sym) \
48 void sym(unsigned char *y, unsigned char *u, unsigned char *v,\
49 int ystride, int uv_stride, loop_filter_info *lfi, int simpler)
51 #if ARCH_X86 || ARCH_X86_64
52 #include "x86/loopfilter_x86.h"
56 #include "arm/loopfilter_arm.h"
59 #ifndef vp8_lf_normal_mb_v
60 #define vp8_lf_normal_mb_v vp8_loop_filter_mbv_c
62 extern prototype_loopfilter_block(vp8_lf_normal_mb_v
);
64 #ifndef vp8_lf_normal_b_v
65 #define vp8_lf_normal_b_v vp8_loop_filter_bv_c
67 extern prototype_loopfilter_block(vp8_lf_normal_b_v
);
69 #ifndef vp8_lf_normal_mb_h
70 #define vp8_lf_normal_mb_h vp8_loop_filter_mbh_c
72 extern prototype_loopfilter_block(vp8_lf_normal_mb_h
);
74 #ifndef vp8_lf_normal_b_h
75 #define vp8_lf_normal_b_h vp8_loop_filter_bh_c
77 extern prototype_loopfilter_block(vp8_lf_normal_b_h
);
80 #ifndef vp8_lf_simple_mb_v
81 #define vp8_lf_simple_mb_v vp8_loop_filter_mbvs_c
83 extern prototype_loopfilter_block(vp8_lf_simple_mb_v
);
85 #ifndef vp8_lf_simple_b_v
86 #define vp8_lf_simple_b_v vp8_loop_filter_bvs_c
88 extern prototype_loopfilter_block(vp8_lf_simple_b_v
);
90 #ifndef vp8_lf_simple_mb_h
91 #define vp8_lf_simple_mb_h vp8_loop_filter_mbhs_c
93 extern prototype_loopfilter_block(vp8_lf_simple_mb_h
);
95 #ifndef vp8_lf_simple_b_h
96 #define vp8_lf_simple_b_h vp8_loop_filter_bhs_c
98 extern prototype_loopfilter_block(vp8_lf_simple_b_h
);
100 typedef prototype_loopfilter_block((*vp8_lf_block_fn_t
));
103 vp8_lf_block_fn_t normal_mb_v
;
104 vp8_lf_block_fn_t normal_b_v
;
105 vp8_lf_block_fn_t normal_mb_h
;
106 vp8_lf_block_fn_t normal_b_h
;
107 vp8_lf_block_fn_t simple_mb_v
;
108 vp8_lf_block_fn_t simple_b_v
;
109 vp8_lf_block_fn_t simple_mb_h
;
110 vp8_lf_block_fn_t simple_b_h
;
111 } vp8_loopfilter_rtcd_vtable_t
;
113 #if CONFIG_RUNTIME_CPU_DETECT
114 #define LF_INVOKE(ctx,fn) (ctx)->fn
116 #define LF_INVOKE(ctx,fn) vp8_lf_##fn