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 #include "loopfilter.h"
13 #include "onyxc_int.h"
15 typedef void loop_filter_function_y_ppc
17 unsigned char *s
, // source pointer
19 const signed char *flimit
,
20 const signed char *limit
,
21 const signed char *thresh
24 typedef void loop_filter_function_uv_ppc
26 unsigned char *u
, // source pointer
27 unsigned char *v
, // source pointer
29 const signed char *flimit
,
30 const signed char *limit
,
31 const signed char *thresh
34 typedef void loop_filter_function_s_ppc
36 unsigned char *s
, // source pointer
38 const signed char *flimit
41 loop_filter_function_y_ppc mbloop_filter_horizontal_edge_y_ppc
;
42 loop_filter_function_y_ppc mbloop_filter_vertical_edge_y_ppc
;
43 loop_filter_function_y_ppc loop_filter_horizontal_edge_y_ppc
;
44 loop_filter_function_y_ppc loop_filter_vertical_edge_y_ppc
;
46 loop_filter_function_uv_ppc mbloop_filter_horizontal_edge_uv_ppc
;
47 loop_filter_function_uv_ppc mbloop_filter_vertical_edge_uv_ppc
;
48 loop_filter_function_uv_ppc loop_filter_horizontal_edge_uv_ppc
;
49 loop_filter_function_uv_ppc loop_filter_vertical_edge_uv_ppc
;
51 loop_filter_function_s_ppc loop_filter_simple_horizontal_edge_ppc
;
52 loop_filter_function_s_ppc loop_filter_simple_vertical_edge_ppc
;
54 // Horizontal MB filtering
55 void loop_filter_mbh_ppc(unsigned char *y_ptr
, unsigned char *u_ptr
, unsigned char *v_ptr
,
56 int y_stride
, int uv_stride
, loop_filter_info
*lfi
, int simpler_lpf
)
59 mbloop_filter_horizontal_edge_y_ppc(y_ptr
, y_stride
, lfi
->mbflim
, lfi
->lim
, lfi
->thr
);
62 mbloop_filter_horizontal_edge_uv_ppc(u_ptr
, v_ptr
, uv_stride
, lfi
->mbflim
, lfi
->lim
, lfi
->thr
);
65 void loop_filter_mbhs_ppc(unsigned char *y_ptr
, unsigned char *u_ptr
, unsigned char *v_ptr
,
66 int y_stride
, int uv_stride
, loop_filter_info
*lfi
, int simpler_lpf
)
72 loop_filter_simple_horizontal_edge_ppc(y_ptr
, y_stride
, lfi
->mbflim
);
75 // Vertical MB Filtering
76 void loop_filter_mbv_ppc(unsigned char *y_ptr
, unsigned char *u_ptr
, unsigned char *v_ptr
,
77 int y_stride
, int uv_stride
, loop_filter_info
*lfi
, int simpler_lpf
)
80 mbloop_filter_vertical_edge_y_ppc(y_ptr
, y_stride
, lfi
->mbflim
, lfi
->lim
, lfi
->thr
);
83 mbloop_filter_vertical_edge_uv_ppc(u_ptr
, v_ptr
, uv_stride
, lfi
->mbflim
, lfi
->lim
, lfi
->thr
);
86 void loop_filter_mbvs_ppc(unsigned char *y_ptr
, unsigned char *u_ptr
, unsigned char *v_ptr
,
87 int y_stride
, int uv_stride
, loop_filter_info
*lfi
, int simpler_lpf
)
93 loop_filter_simple_vertical_edge_ppc(y_ptr
, y_stride
, lfi
->mbflim
);
96 // Horizontal B Filtering
97 void loop_filter_bh_ppc(unsigned char *y_ptr
, unsigned char *u_ptr
, unsigned char *v_ptr
,
98 int y_stride
, int uv_stride
, loop_filter_info
*lfi
, int simpler_lpf
)
101 // These should all be done at once with one call, instead of 3
102 loop_filter_horizontal_edge_y_ppc(y_ptr
+ 4 * y_stride
, y_stride
, lfi
->flim
, lfi
->lim
, lfi
->thr
);
103 loop_filter_horizontal_edge_y_ppc(y_ptr
+ 8 * y_stride
, y_stride
, lfi
->flim
, lfi
->lim
, lfi
->thr
);
104 loop_filter_horizontal_edge_y_ppc(y_ptr
+ 12 * y_stride
, y_stride
, lfi
->flim
, lfi
->lim
, lfi
->thr
);
107 loop_filter_horizontal_edge_uv_ppc(u_ptr
+ 4 * uv_stride
, v_ptr
+ 4 * uv_stride
, uv_stride
, lfi
->flim
, lfi
->lim
, lfi
->thr
);
110 void loop_filter_bhs_ppc(unsigned char *y_ptr
, unsigned char *u_ptr
, unsigned char *v_ptr
,
111 int y_stride
, int uv_stride
, loop_filter_info
*lfi
, int simpler_lpf
)
117 loop_filter_simple_horizontal_edge_ppc(y_ptr
+ 4 * y_stride
, y_stride
, lfi
->flim
);
118 loop_filter_simple_horizontal_edge_ppc(y_ptr
+ 8 * y_stride
, y_stride
, lfi
->flim
);
119 loop_filter_simple_horizontal_edge_ppc(y_ptr
+ 12 * y_stride
, y_stride
, lfi
->flim
);
122 // Vertical B Filtering
123 void loop_filter_bv_ppc(unsigned char *y_ptr
, unsigned char *u_ptr
, unsigned char *v_ptr
,
124 int y_stride
, int uv_stride
, loop_filter_info
*lfi
, int simpler_lpf
)
127 loop_filter_vertical_edge_y_ppc(y_ptr
, y_stride
, lfi
->flim
, lfi
->lim
, lfi
->thr
);
130 loop_filter_vertical_edge_uv_ppc(u_ptr
+ 4, v_ptr
+ 4, uv_stride
, lfi
->flim
, lfi
->lim
, lfi
->thr
);
133 void loop_filter_bvs_ppc(unsigned char *y_ptr
, unsigned char *u_ptr
, unsigned char *v_ptr
,
134 int y_stride
, int uv_stride
, loop_filter_info
*lfi
, int simpler_lpf
)
140 loop_filter_simple_vertical_edge_ppc(y_ptr
+ 4, y_stride
, lfi
->flim
);
141 loop_filter_simple_vertical_edge_ppc(y_ptr
+ 8, y_stride
, lfi
->flim
);
142 loop_filter_simple_vertical_edge_ppc(y_ptr
+ 12, y_stride
, lfi
->flim
);