annotate libmpeg2/motion_comp_mlib.c @ 6681:98c129b78f63

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