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