1
|
1 /*
|
36
|
2 * motion_comp_mlib.c
|
9852
|
3 * Copyright (C) 2000-2002 Håkan Hjort <d95hjort@dtek.chalmers.se>
|
1
|
4 *
|
|
5 * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
|
9852
|
6 * See http://libmpeg2.sourceforge.net/ for updates.
|
1
|
7 *
|
|
8 * mpeg2dec is free software; you can redistribute it and/or modify
|
|
9 * it under the terms of the GNU General Public License as published by
|
|
10 * the Free Software Foundation; either version 2 of the License, or
|
|
11 * (at your option) any later version.
|
|
12 *
|
|
13 * mpeg2dec is distributed in the hope that it will be useful,
|
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16 * GNU General Public License for more details.
|
|
17 *
|
|
18 * You should have received a copy of the GNU General Public License
|
|
19 * along with this program; if not, write to the Free Software
|
|
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
21 */
|
|
22
|
|
23 #include "config.h"
|
|
24
|
|
25 #ifdef LIBMPEG2_MLIB
|
|
26
|
|
27 #include <mlib_types.h>
|
|
28 #include <mlib_status.h>
|
|
29 #include <mlib_sys.h>
|
|
30 #include <mlib_video.h>
|
9852
|
31 #include <inttypes.h>
|
1
|
32
|
9852
|
33 #include "mpeg2.h"
|
1
|
34 #include "mpeg2_internal.h"
|
|
35
|
9852
|
36 static void MC_put_o_16_mlib (uint8_t * dest, const uint8_t * ref,
|
|
37 int stride, int height)
|
1
|
38 {
|
|
39 if (height == 16)
|
9852
|
40 mlib_VideoCopyRef_U8_U8_16x16 (dest, (uint8_t *) ref, stride);
|
1
|
41 else
|
9852
|
42 mlib_VideoCopyRef_U8_U8_16x8 (dest, (uint8_t *) ref, stride);
|
1
|
43 }
|
|
44
|
9852
|
45 static void MC_put_x_16_mlib (uint8_t * dest, const uint8_t * ref,
|
|
46 int stride, int height)
|
1
|
47 {
|
|
48 if (height == 16)
|
9852
|
49 mlib_VideoInterpX_U8_U8_16x16 (dest, (uint8_t *) ref, stride, stride);
|
1
|
50 else
|
9852
|
51 mlib_VideoInterpX_U8_U8_16x8 (dest, (uint8_t *) ref, stride, stride);
|
1
|
52 }
|
|
53
|
9852
|
54 static void MC_put_y_16_mlib (uint8_t * dest, const uint8_t * ref,
|
1
|
55 int stride, int height)
|
|
56 {
|
|
57 if (height == 16)
|
9852
|
58 mlib_VideoInterpY_U8_U8_16x16 (dest, (uint8_t *) ref, stride, stride);
|
1
|
59 else
|
9852
|
60 mlib_VideoInterpY_U8_U8_16x8 (dest, (uint8_t *) ref, stride, stride);
|
1
|
61 }
|
|
62
|
9852
|
63 static void MC_put_xy_16_mlib (uint8_t * dest, const uint8_t * ref,
|
|
64 int stride, int height)
|
1
|
65 {
|
9852
|
66 if (height == 16)
|
|
67 mlib_VideoInterpXY_U8_U8_16x16 (dest, (uint8_t *) ref, stride, stride);
|
1
|
68 else
|
9852
|
69 mlib_VideoInterpXY_U8_U8_16x8 (dest, (uint8_t *) ref, stride, stride);
|
1
|
70 }
|
|
71
|
9852
|
72 static void MC_put_o_8_mlib (uint8_t * dest, const uint8_t * ref,
|
|
73 int stride, int height)
|
1
|
74 {
|
|
75 if (height == 8)
|
9852
|
76 mlib_VideoCopyRef_U8_U8_8x8 (dest, (uint8_t *) ref, stride);
|
1
|
77 else
|
9852
|
78 mlib_VideoCopyRef_U8_U8_8x4 (dest, (uint8_t *) ref, stride);
|
1
|
79 }
|
|
80
|
9852
|
81 static void MC_put_x_8_mlib (uint8_t * dest, const uint8_t * ref,
|
1
|
82 int stride, int height)
|
|
83 {
|
9852
|
84 if (height == 8)
|
|
85 mlib_VideoInterpX_U8_U8_8x8 (dest, (uint8_t *) ref, stride, stride);
|
1
|
86 else
|
9852
|
87 mlib_VideoInterpX_U8_U8_8x4 (dest, (uint8_t *) ref, stride, stride);
|
1
|
88 }
|
|
89
|
9852
|
90 static void MC_put_y_8_mlib (uint8_t * dest, const uint8_t * ref,
|
|
91 int stride, int height)
|
1
|
92 {
|
9852
|
93 if (height == 8)
|
|
94 mlib_VideoInterpY_U8_U8_8x8 (dest, (uint8_t *) ref, stride, stride);
|
1
|
95 else
|
9852
|
96 mlib_VideoInterpY_U8_U8_8x4 (dest, (uint8_t *) ref, stride, stride);
|
1
|
97 }
|
|
98
|
9852
|
99 static void MC_put_xy_8_mlib (uint8_t * dest, const uint8_t * ref,
|
|
100 int stride, int height)
|
1
|
101 {
|
9852
|
102 if (height == 8)
|
|
103 mlib_VideoInterpXY_U8_U8_8x8 (dest, (uint8_t *) ref, stride, stride);
|
1
|
104 else
|
9852
|
105 mlib_VideoInterpXY_U8_U8_8x4 (dest, (uint8_t *) ref, stride, stride);
|
1
|
106 }
|
|
107
|
9852
|
108 static void MC_avg_o_16_mlib (uint8_t * dest, const uint8_t * ref,
|
|
109 int stride, int height)
|
1
|
110 {
|
|
111 if (height == 16)
|
9852
|
112 mlib_VideoCopyRefAve_U8_U8_16x16 (dest, (uint8_t *) ref, stride);
|
1
|
113 else
|
9852
|
114 mlib_VideoCopyRefAve_U8_U8_16x8 (dest, (uint8_t *) ref, stride);
|
1
|
115 }
|
|
116
|
9852
|
117 static void MC_avg_x_16_mlib (uint8_t * dest, const uint8_t * ref,
|
1
|
118 int stride, int height)
|
|
119 {
|
|
120 if (height == 16)
|
9852
|
121 mlib_VideoInterpAveX_U8_U8_16x16 (dest, (uint8_t *) ref,
|
|
122 stride, stride);
|
1
|
123 else
|
9852
|
124 mlib_VideoInterpAveX_U8_U8_16x8 (dest, (uint8_t *) ref,
|
|
125 stride, stride);
|
1
|
126 }
|
|
127
|
9852
|
128 static void MC_avg_y_16_mlib (uint8_t * dest, const uint8_t * ref,
|
|
129 int stride, int height)
|
1
|
130 {
|
9852
|
131 if (height == 16)
|
|
132 mlib_VideoInterpAveY_U8_U8_16x16 (dest, (uint8_t *) ref,
|
|
133 stride, stride);
|
1
|
134 else
|
9852
|
135 mlib_VideoInterpAveY_U8_U8_16x8 (dest, (uint8_t *) ref,
|
|
136 stride, stride);
|
1
|
137 }
|
|
138
|
9852
|
139 static void MC_avg_xy_16_mlib (uint8_t * dest, const uint8_t * ref,
|
|
140 int stride, int height)
|
1
|
141 {
|
9852
|
142 if (height == 16)
|
|
143 mlib_VideoInterpAveXY_U8_U8_16x16 (dest, (uint8_t *) ref,
|
|
144 stride, stride);
|
1
|
145 else
|
9852
|
146 mlib_VideoInterpAveXY_U8_U8_16x8 (dest, (uint8_t *) ref,
|
|
147 stride, stride);
|
1
|
148 }
|
|
149
|
9852
|
150 static void MC_avg_o_8_mlib (uint8_t * dest, const uint8_t * ref,
|
1
|
151 int stride, int height)
|
|
152 {
|
|
153 if (height == 8)
|
9852
|
154 mlib_VideoCopyRefAve_U8_U8_8x8 (dest, (uint8_t *) ref, stride);
|
1
|
155 else
|
9852
|
156 mlib_VideoCopyRefAve_U8_U8_8x4 (dest, (uint8_t *) ref, stride);
|
|
157 }
|
|
158
|
|
159 static void MC_avg_x_8_mlib (uint8_t * dest, const uint8_t * ref,
|
|
160 int stride, int height)
|
|
161 {
|
|
162 if (height == 8)
|
|
163 mlib_VideoInterpAveX_U8_U8_8x8 (dest, (uint8_t *) ref, stride, stride);
|
|
164 else
|
|
165 mlib_VideoInterpAveX_U8_U8_8x4 (dest, (uint8_t *) ref, stride, stride);
|
1
|
166 }
|
|
167
|
9852
|
168 static void MC_avg_y_8_mlib (uint8_t * dest, const uint8_t * ref,
|
|
169 int stride, int height)
|
|
170 {
|
|
171 if (height == 8)
|
|
172 mlib_VideoInterpAveY_U8_U8_8x8 (dest, (uint8_t *) ref, stride, stride);
|
|
173 else
|
|
174 mlib_VideoInterpAveY_U8_U8_8x4 (dest, (uint8_t *) ref, stride, stride);
|
|
175 }
|
|
176
|
|
177 static void MC_avg_xy_8_mlib (uint8_t * dest, const uint8_t * ref,
|
|
178 int stride, int height)
|
|
179 {
|
|
180 if (height == 8)
|
|
181 mlib_VideoInterpAveXY_U8_U8_8x8 (dest, (uint8_t *) ref,
|
|
182 stride, stride);
|
|
183 else
|
|
184 mlib_VideoInterpAveXY_U8_U8_8x4 (dest, (uint8_t *) ref,
|
|
185 stride, stride);
|
|
186 }
|
|
187
|
|
188 MPEG2_MC_EXTERN (mlib)
|
1
|
189
|
|
190 #endif
|