Merge "vp8_rd_pick_best_mbsegmentation code restructure"
[libvpx.git] / vp8 / common / ppc / loopfilter_altivec.c
blobbad3cf3bd59e4fe85bd31ed3c15f4d361cec453b
1 /*
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.
9 */
12 #include "loopfilter.h"
13 #include "onyxc_int.h"
15 typedef void loop_filter_function_y_ppc
17 unsigned char *s, // source pointer
18 int p, // pitch
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
28 int p, // pitch
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
37 int p, // pitch
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)
58 (void)simpler_lpf;
59 mbloop_filter_horizontal_edge_y_ppc(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->mbthr);
61 if (u_ptr)
62 mbloop_filter_horizontal_edge_uv_ppc(u_ptr, v_ptr, uv_stride, lfi->uvmbflim, lfi->uvlim, lfi->uvmbthr);
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)
68 (void)simpler_lpf;
69 (void)u_ptr;
70 (void)v_ptr;
71 (void)uv_stride;
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)
79 (void)simpler_lpf;
80 mbloop_filter_vertical_edge_y_ppc(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->mbthr);
82 if (u_ptr)
83 mbloop_filter_vertical_edge_uv_ppc(u_ptr, v_ptr, uv_stride, lfi->uvmbflim, lfi->uvlim, lfi->uvmbthr);
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)
89 (void)simpler_lpf;
90 (void)u_ptr;
91 (void)v_ptr;
92 (void)uv_stride;
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)
100 (void)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);
106 if (u_ptr)
107 loop_filter_horizontal_edge_uv_ppc(u_ptr + 4 * uv_stride, v_ptr + 4 * uv_stride, uv_stride, lfi->uvflim, lfi->uvlim, lfi->uvthr);
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)
113 (void)simpler_lpf;
114 (void)u_ptr;
115 (void)v_ptr;
116 (void)uv_stride;
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)
126 (void)simpler_lpf;
127 loop_filter_vertical_edge_y_ppc(y_ptr, y_stride, lfi->flim, lfi->lim, lfi->thr);
129 if (u_ptr)
130 loop_filter_vertical_edge_uv_ppc(u_ptr + 4, v_ptr + 4, uv_stride, lfi->uvflim, lfi->uvlim, lfi->uvthr);
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)
136 (void)simpler_lpf;
137 (void)u_ptr;
138 (void)v_ptr;
139 (void)uv_stride;
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);