[cvs] / xvidcore / src / image / interpolate8x8.h Repository:
ViewVC logotype

Diff of /xvidcore/src/image/interpolate8x8.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8, Tue Nov 26 23:44:10 2002 UTC revision 1.11.2.1, Tue Oct 12 21:06:33 2004 UTC
# Line 1  Line 1 
1  /*****************************************************************************  /*****************************************************************************
2   *   *
3   *  XVID MPEG-4 VIDEO CODEC   *  XVID MPEG-4 VIDEO CODEC
4   *  - 8x8 block-based halfpel interpolation - headers   *  - Interpolation related header  -
5   *   *
6   *  Copyright(C) 2002 Peter Ross <pross@xvid.org>   *  Copyright(C) 2001-2003 Peter Ross <pross@xvid.org>
7   *   *
8   *  This file is part of XviD, a free MPEG-4 video encoder/decoder   *  This program is free software ; you can redistribute it and/or modify
9   *   *  it under the terms of the GNU General Public License as published by
  *  XviD is free software; you can redistribute it and/or modify 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   *  the Free Software Foundation; either version 2 of the License, or
11   *  (at your option) any later version.   *  (at your option) any later version.
12   *   *
# Line 21  Line 19 
19   *  along with this program; if not, write to the Free Software   *  along with this program; if not, write to the Free Software
20   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
  *  Under section 8 of the GNU General Public License, the copyright  
  *  holders of XVID explicitly forbid distribution in the following  
  *  countries:  
  *  
  *    - Japan  
  *    - United States of America  
  *  
  *  Linking XviD statically or dynamically with other modules is making a  
  *  combined work based on XviD.  Thus, the terms and conditions of the  
  *  GNU General Public License cover the whole combination.  
  *  
  *  As a special exception, the copyright holders of XviD give you  
  *  permission to link XviD with independent modules that communicate with  
  *  XviD solely through the VFW1.1 and DShow interfaces, regardless of the  
  *  license terms of these independent modules, and to copy and distribute  
  *  the resulting combined work under terms of your choice, provided that  
  *  every copy of the combined work is accompanied by a complete copy of  
  *  the source code of XviD (the version of XviD used to produce the  
  *  combined work), being distributed under the terms of the GNU General  
  *  Public License plus this exception.  An independent module is a module  
  *  which is not derived from or based on XviD.  
  *  
  *  Note that people who make modified versions of XviD are not obligated  
  *  to grant this special exception for their modified versions; it is  
  *  their choice whether to do so.  The GNU General Public License gives  
  *  permission to release a modified version without this exception; this  
  *  exception also makes it possible to release a modified version which  
  *  carries forward this exception.  
  *  
22   * $Id$   * $Id$
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
26    #ifndef _INTERPOLATE8X8_H_
27    #define _INTERPOLATE8X8_H_
28    
29  #include "../utils/mem_transfer.h"  #include "../utils/mem_transfer.h"
30    
31  typedef void (INTERPOLATE8X8) (uint8_t * const dst,  typedef void (INTERPOLATE8X8) (uint8_t * const dst,
# Line 62  Line 34 
34                                                             const uint32_t rounding);                                                             const uint32_t rounding);
35  typedef INTERPOLATE8X8 *INTERPOLATE8X8_PTR;  typedef INTERPOLATE8X8 *INTERPOLATE8X8_PTR;
36    
37    typedef void (INTERPOLATE8X8_AVG2) (uint8_t *dst,
38                                                                            const uint8_t *src1,
39                                                                            const uint8_t *src2,
40                                                                            const uint32_t stride,
41                                                                            const uint32_t rounding,
42                                                                            const uint32_t height);
43    typedef INTERPOLATE8X8_AVG2 *INTERPOLATE8X8_AVG2_PTR;
44    
45    typedef void (INTERPOLATE8X8_AVG4) (uint8_t *dst,
46                                                                            const uint8_t *src1,
47                                                                            const uint8_t *src2,
48                                                                            const uint8_t *src3,
49                                                                            const uint8_t *src4,
50                                                                            const uint32_t stride,
51                                                                            const uint32_t rounding);
52    typedef INTERPOLATE8X8_AVG4 *INTERPOLATE8X8_AVG4_PTR;
53    
54    typedef void (INTERPOLATE_LOWPASS) (uint8_t *dst,
55                                                                               uint8_t *src,
56                                                                               int32_t stride,
57                                                                               int32_t rounding);
58    
59    typedef INTERPOLATE_LOWPASS *INTERPOLATE_LOWPASS_PTR;
60    
61    typedef void (INTERPOLATE_LOWPASS_HV) (uint8_t *dst1,
62                                                                                      uint8_t *dst2,
63                                                                                      uint8_t *src,
64                                                                                      int32_t stride,
65                                                                                      int32_t rounding);
66    
67    typedef INTERPOLATE_LOWPASS_HV *INTERPOLATE_LOWPASS_HV_PTR;
68    
69    typedef void (INTERPOLATE8X8_6TAP_LOWPASS) (uint8_t *dst,
70                                                                                    uint8_t *src,
71                                                                                    int32_t stride,
72                                                                                    int32_t rounding);
73    
74    typedef INTERPOLATE8X8_6TAP_LOWPASS *INTERPOLATE8X8_6TAP_LOWPASS_PTR;
75    
76  extern INTERPOLATE8X8_PTR interpolate8x8_halfpel_h;  extern INTERPOLATE8X8_PTR interpolate8x8_halfpel_h;
77  extern INTERPOLATE8X8_PTR interpolate8x8_halfpel_v;  extern INTERPOLATE8X8_PTR interpolate8x8_halfpel_v;
78  extern INTERPOLATE8X8_PTR interpolate8x8_halfpel_hv;  extern INTERPOLATE8X8_PTR interpolate8x8_halfpel_hv;
79    
80    extern INTERPOLATE8X8_AVG2_PTR interpolate8x8_avg2;
81    extern INTERPOLATE8X8_AVG4_PTR interpolate8x8_avg4;
82    
83    extern INTERPOLATE_LOWPASS_PTR interpolate8x8_lowpass_h;
84    extern INTERPOLATE_LOWPASS_PTR interpolate8x8_lowpass_v;
85    
86    extern INTERPOLATE_LOWPASS_PTR interpolate16x16_lowpass_h;
87    extern INTERPOLATE_LOWPASS_PTR interpolate16x16_lowpass_v;
88    
89    extern INTERPOLATE_LOWPASS_HV_PTR interpolate8x8_lowpass_hv;
90    extern INTERPOLATE_LOWPASS_HV_PTR interpolate16x16_lowpass_hv;
91    
92    extern INTERPOLATE8X8_6TAP_LOWPASS_PTR interpolate8x8_6tap_lowpass_h;
93    extern INTERPOLATE8X8_6TAP_LOWPASS_PTR interpolate8x8_6tap_lowpass_v;
94    
95  INTERPOLATE8X8 interpolate8x8_halfpel_h_c;  INTERPOLATE8X8 interpolate8x8_halfpel_h_c;
96  INTERPOLATE8X8 interpolate8x8_halfpel_v_c;  INTERPOLATE8X8 interpolate8x8_halfpel_v_c;
97  INTERPOLATE8X8 interpolate8x8_halfpel_hv_c;  INTERPOLATE8X8 interpolate8x8_halfpel_hv_c;
98    
99    #ifdef ARCH_IS_IA32
100  INTERPOLATE8X8 interpolate8x8_halfpel_h_mmx;  INTERPOLATE8X8 interpolate8x8_halfpel_h_mmx;
101  INTERPOLATE8X8 interpolate8x8_halfpel_v_mmx;  INTERPOLATE8X8 interpolate8x8_halfpel_v_mmx;
102  INTERPOLATE8X8 interpolate8x8_halfpel_hv_mmx;  INTERPOLATE8X8 interpolate8x8_halfpel_hv_mmx;
# Line 82  Line 109 
109  INTERPOLATE8X8 interpolate8x8_halfpel_v_3dn;  INTERPOLATE8X8 interpolate8x8_halfpel_v_3dn;
110  INTERPOLATE8X8 interpolate8x8_halfpel_hv_3dn;  INTERPOLATE8X8 interpolate8x8_halfpel_hv_3dn;
111    
112    INTERPOLATE8X8 interpolate8x8_halfpel_h_3dne;
113    INTERPOLATE8X8 interpolate8x8_halfpel_v_3dne;
114    INTERPOLATE8X8 interpolate8x8_halfpel_hv_3dne;
115    #endif
116    
117    #ifdef ARCH_IS_IA64
118  INTERPOLATE8X8 interpolate8x8_halfpel_h_ia64;  INTERPOLATE8X8 interpolate8x8_halfpel_h_ia64;
119  INTERPOLATE8X8 interpolate8x8_halfpel_v_ia64;  INTERPOLATE8X8 interpolate8x8_halfpel_v_ia64;
120  INTERPOLATE8X8 interpolate8x8_halfpel_hv_ia64;  INTERPOLATE8X8 interpolate8x8_halfpel_hv_ia64;
121    #endif
122    
123  void interpolate8x8_lowpass_h(uint8_t *dst, uint8_t *src, int32_t dst_stride, int32_t src_stride, int32_t rounding);  INTERPOLATE8X8_AVG2 interpolate8x8_avg2_c;
124  void interpolate8x8_lowpass_v(uint8_t *dst, uint8_t *src, int32_t dst_stride, int32_t src_stride, int32_t rounding);  INTERPOLATE8X8_AVG4 interpolate8x8_avg4_c;
 void interpolate8x8_lowpass_hv(uint8_t *dst1, uint8_t *dst2, uint8_t *src, int32_t dst1_stride, int32_t dst2_stride, int32_t src_stride, int32_t rounding);  
 void interpolate8x8_bilinear2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int32_t dst_stride, int32_t src_stride, int32_t rounding);  
 void interpolate8x8_bilinear4(uint8_t *dst, uint8_t *src1, uint8_t *src2, uint8_t *src3, uint8_t *src4, int32_t stride, int32_t rounding);  
125    
126  void interpolate8x8_c(uint8_t * const dst,  #ifdef ARCH_IS_IA32
127                                            const uint8_t * const src,  INTERPOLATE8X8_AVG2 interpolate8x8_avg2_mmx;
128    INTERPOLATE8X8_AVG4 interpolate8x8_avg4_mmx;
129    #endif
130    
131    INTERPOLATE_LOWPASS interpolate8x8_lowpass_h_c;
132    INTERPOLATE_LOWPASS interpolate8x8_lowpass_v_c;
133    
134    INTERPOLATE_LOWPASS interpolate16x16_lowpass_h_c;
135    INTERPOLATE_LOWPASS interpolate16x16_lowpass_v_c;
136    
137    INTERPOLATE_LOWPASS_HV interpolate8x8_lowpass_hv_c;
138    INTERPOLATE_LOWPASS_HV interpolate16x16_lowpass_hv_c;
139    
140    INTERPOLATE8X8_6TAP_LOWPASS interpolate8x8_6tap_lowpass_h_c;
141    INTERPOLATE8X8_6TAP_LOWPASS interpolate8x8_6tap_lowpass_v_c;
142    
143    #ifdef ARCH_IS_IA32
144    INTERPOLATE8X8_6TAP_LOWPASS interpolate8x8_6tap_lowpass_h_mmx;
145    INTERPOLATE8X8_6TAP_LOWPASS interpolate8x8_6tap_lowpass_v_mmx;
146    #endif
147    
148    static __inline void
149    interpolate8x8_switch(uint8_t * const cur,
150                                              const uint8_t * const refn,
151                                              const uint32_t x,
152                                              const uint32_t y,
153                                              const int32_t dx,
154                                              const int dy,
155                                              const uint32_t stride,
156                                              const uint32_t rounding)
157    {
158    
159            const uint8_t * const src = refn + (int)((y + (dy>>1)) * stride + x + (dx>>1));
160            uint8_t * const dst = cur + (int)(y * stride + x);
161    
162            switch (((dx & 1) << 1) + (dy & 1))     { /* ((dx%2)?2:0)+((dy%2)?1:0) */
163            case 0:
164                    transfer8x8_copy(dst, src, stride);
165                    break;
166            case 1:
167                    interpolate8x8_halfpel_v(dst, src, stride, rounding);
168                    break;
169            case 2:
170                    interpolate8x8_halfpel_h(dst, src, stride, rounding);
171                    break;
172            default:
173                    interpolate8x8_halfpel_hv(dst, src, stride, rounding);
174                    break;
175            }
176    }
177    
178    
179    static __inline void
180    interpolate16x16_switch(uint8_t * const cur,
181                                              const uint8_t * const refn,
182                                            const uint32_t x,                                            const uint32_t x,
183                                            const uint32_t y,                                            const uint32_t y,
184                                            const uint32_t stride);                                            const int32_t dx,
185                                              const int dy,
186                                              const uint32_t stride,
187                                              const uint32_t rounding)
188    {
189            interpolate8x8_switch(cur, refn, x,   y,   dx, dy, stride, rounding);
190            interpolate8x8_switch(cur, refn, x+8, y,   dx, dy, stride, rounding);
191            interpolate8x8_switch(cur, refn, x,   y+8, dx, dy, stride, rounding);
192            interpolate8x8_switch(cur, refn, x+8, y+8, dx, dy, stride, rounding);
193    }
194    
195    
196  static __inline void  static __inline void
197  interpolate8x8_switch(uint8_t * const cur,  interpolate32x32_switch(uint8_t * const cur,
198                                            const uint8_t * const refn,                                            const uint8_t * const refn,
199                                            const uint32_t x,                                            const uint32_t x,
200                                            const uint32_t y,                                            const uint32_t y,
# Line 108  Line 203 
203                                            const uint32_t stride,                                            const uint32_t stride,
204                                            const uint32_t rounding)                                            const uint32_t rounding)
205  {  {
206          int32_t ddx, ddy;          interpolate16x16_switch(cur, refn, x,    y,    dx, dy, stride, rounding);
207            interpolate16x16_switch(cur, refn, x+16, y,    dx, dy, stride, rounding);
208            interpolate16x16_switch(cur, refn, x,    y+16, dx, dy, stride, rounding);
209            interpolate16x16_switch(cur, refn, x+16, y+16, dx, dy, stride, rounding);
210    }
211    
212    
213    static __inline uint8_t *
214    interpolate8x8_switch2(uint8_t * const buffer,
215                                              const uint8_t * const refn,
216                                              const int x,
217                                              const int y,
218                                              const int dx,
219                                              const int dy,
220                                              const uint32_t stride,
221                                              const uint32_t rounding)
222    {
223    
224            const uint8_t * const src = refn + (int)((y + (dy>>1)) * stride + x + (dx>>1));
225    
226            switch (((dx & 1) << 1) + (dy & 1))     { /* ((dx%2)?2:0)+((dy%2)?1:0) */
227            case 0:
228                    return (uint8_t *)src;
229            case 1:
230                    interpolate8x8_halfpel_v(buffer, src, stride, rounding);
231                    break;
232            case 2:
233                    interpolate8x8_halfpel_h(buffer, src, stride, rounding);
234                    break;
235            default:
236                    interpolate8x8_halfpel_hv(buffer, src, stride, rounding);
237                    break;
238            }
239            return buffer;
240    }
241    
242          switch (((dx & 1) << 1) + (dy & 1))     /* ((dx%2)?2:0)+((dy%2)?1:0) */  static __inline void interpolate8x8_quarterpel(uint8_t * const cur,
243                                         uint8_t * const refn,
244                                             uint8_t * const refh,
245                                             uint8_t * const refv,
246                                             uint8_t * const refhv,
247                                         const uint32_t x, const uint32_t y,
248                                             const int32_t dx,  const int dy,
249                                             const uint32_t stride,
250                                             const uint32_t rounding)
251          {          {
252            const int32_t xRef = (int)x*4 + dx;
253            const int32_t yRef = (int)y*4 + dy;
254    
255            uint8_t *src, *dst;
256            uint8_t *halfpel_h, *halfpel_v, *halfpel_hv;
257            int32_t x_int, y_int, x_frac, y_frac;
258    
259            x_int = xRef/4;
260            if (xRef < 0 && xRef % 4)
261                    x_int--;
262    
263            x_frac = xRef - (4*x_int);
264    
265            y_int  = yRef/4;
266            if (yRef < 0 && yRef % 4)
267                    y_int--;
268    
269            y_frac = yRef - (4*y_int);
270    
271            src = refn + y_int * (int)stride + x_int;
272            halfpel_h = refh;
273            halfpel_v = refv;
274            halfpel_hv = refhv;
275    
276            dst = cur + y * stride + x;
277    
278            switch((y_frac << 2) | (x_frac)) {
279    
280          case 0:          case 0:
281                  ddx = dx / 2;                  transfer8x8_copy(dst, src, stride);
                 ddy = dy / 2;  
                 transfer8x8_copy(cur + y * stride + x,  
                                                  refn + (int)((y + ddy) * stride + x + ddx), stride);  
282                  break;                  break;
283    
284          case 1:          case 1:
285                  ddx = dx / 2;                  interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
286                  ddy = (dy - 1) / 2;                  interpolate8x8_avg2(dst, src, halfpel_h, stride, rounding, 8);
                 interpolate8x8_halfpel_v(cur + y * stride + x,  
                                                                  refn + (int)((y + ddy) * stride + x + ddx), stride,  
                                                                  rounding);  
287                  break;                  break;
288    
289          case 2:          case 2:
290                  ddx = (dx - 1) / 2;              interpolate8x8_lowpass_h(dst, src, stride, rounding);
                 ddy = dy / 2;  
                 interpolate8x8_halfpel_h(cur + y * stride + x,  
                                                                  refn + (int)((y + ddy) * stride + x + ddx), stride,  
                                                                  rounding);  
291                  break;                  break;
292    
293          default:          case 3:
294                  ddx = (dx - 1) / 2;                  interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
295                  ddy = (dy - 1) / 2;                  interpolate8x8_avg2(dst, src + 1, halfpel_h, stride, rounding, 8);
296                  interpolate8x8_halfpel_hv(cur + y * stride + x,                  break;
297                                                                   refn + (int)((y + ddy) * stride + x + ddx), stride,  
298                                                                    rounding);          case 4:
299                    interpolate8x8_lowpass_v(halfpel_v, src, stride, rounding);
300                    interpolate8x8_avg2(dst, src, halfpel_v, stride, rounding, 8);
301                    break;
302    
303            case 5:
304                    interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
305                    interpolate8x8_avg2(halfpel_v, src, halfpel_h, stride, rounding, 9);
306                    interpolate8x8_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
307                    interpolate8x8_avg2(dst, halfpel_v, halfpel_hv, stride, rounding, 8);
308                    break;
309    
310            case 6:
311                    interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, stride, rounding);
312                    interpolate8x8_avg2(dst, halfpel_h, halfpel_hv, stride, rounding, 8);
313                    break;
314    
315            case 7:
316                    interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
317                    interpolate8x8_avg2(halfpel_v, src + 1, halfpel_h, stride, rounding, 9);
318                    interpolate8x8_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
319                    interpolate8x8_avg2(dst, halfpel_v, halfpel_hv, stride, rounding, 8);
320                    break;
321    
322            case 8:
323                interpolate8x8_lowpass_v(dst, src, stride, rounding);
324                    break;
325    
326            case 9:
327                    interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
328                    interpolate8x8_avg2(halfpel_v, src, halfpel_h, stride, rounding, 9);
329                    interpolate8x8_lowpass_v(dst, halfpel_v, stride, rounding);
330                    break;
331    
332            case 10:
333                    interpolate8x8_lowpass_hv(dst, halfpel_h, src, stride, rounding);
334                    break;
335    
336            case 11:
337                    interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
338                    interpolate8x8_avg2(halfpel_v, src + 1, halfpel_h, stride, rounding, 9);
339                    interpolate8x8_lowpass_v(dst, halfpel_v, stride, rounding);
340                    break;
341    
342            case 12:
343                    interpolate8x8_lowpass_v(halfpel_v, src, stride, rounding);
344                    interpolate8x8_avg2(dst, src+stride, halfpel_v, stride, rounding, 8);
345                    break;
346    
347            case 13:
348                    interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
349                    interpolate8x8_avg2(halfpel_v, src, halfpel_h, stride, rounding, 9);
350                    interpolate8x8_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
351                    interpolate8x8_avg2(dst, halfpel_v+stride, halfpel_hv, stride, rounding, 8);
352                    break;
353    
354            case 14:
355                    interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, stride, rounding);
356                    interpolate8x8_avg2(dst, halfpel_h+stride, halfpel_hv, stride, rounding, 8);
357                    break;
358    
359            case 15:
360                    interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
361                    interpolate8x8_avg2(halfpel_v, src + 1, halfpel_h, stride, rounding, 9);
362                    interpolate8x8_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
363                    interpolate8x8_avg2(dst, halfpel_hv, halfpel_v + stride, stride, rounding, 8);
364                  break;                  break;
365          }          }
366  }  }
367    
368    static __inline void interpolate16x16_quarterpel(uint8_t * const cur,
 static __inline void interpolate8x8_quarterpel(uint8_t * const cur,  
369                                       uint8_t * const refn,                                       uint8_t * const refn,
370                                             uint8_t * const refh,
371                                             uint8_t * const refv,
372                                             uint8_t * const refhv,
373                                       const uint32_t x, const uint32_t y,                                       const uint32_t x, const uint32_t y,
374                                           const int32_t dx,  const int dy,                                           const int32_t dx,  const int dy,
375                                           const uint32_t stride,                                           const uint32_t stride,
376                                           const uint32_t rounding)                                           const uint32_t rounding)
377  {  {
378          const int32_t xRef = x*4 + dx;          const int32_t xRef = (int)x*4 + dx;
379          const int32_t yRef = y*4 + dy;          const int32_t yRef = (int)y*4 + dy;
380    
381          uint8_t *src, *dst;          uint8_t *src, *dst;
382            uint8_t *halfpel_h, *halfpel_v, *halfpel_hv;
383          int32_t x_int, y_int, x_frac, y_frac;          int32_t x_int, y_int, x_frac, y_frac;
384    
         uint8_t halfpel_h[72];  
         uint8_t halfpel_v[64];  
         uint8_t halfpel_hv[64];  
   
385          x_int = xRef/4;          x_int = xRef/4;
386          if (xRef < 0 && xRef % 4)          if (xRef < 0 && xRef % 4)
387                  x_int--;                  x_int--;
# Line 175  Line 394 
394    
395          y_frac = yRef - (4*y_int);          y_frac = yRef - (4*y_int);
396    
397          src = refn + y_int * stride + x_int;          src = refn + y_int * (int)stride + x_int;
398            halfpel_h = refh;
399            halfpel_v = refv;
400            halfpel_hv = refhv;
401    
402          dst = cur + y * stride + x;          dst = cur + y * stride + x;
403    
404          switch((y_frac << 2) | (x_frac)) {          switch((y_frac << 2) | (x_frac)) {
405    
406          case 0:          case 0:
407                  transfer8x8_copy(dst, src, stride);                  transfer16x16_copy(dst, src, stride);
408                  break;                  break;
409    
410          case 1:          case 1:
411                  interpolate8x8_lowpass_h(halfpel_h, src, 8, stride, rounding);                  interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
412                  interpolate8x8_bilinear2(dst, src, halfpel_h, stride, stride, rounding);                  interpolate8x8_avg2(dst, src, halfpel_h, stride, rounding, 8);
413                    interpolate8x8_avg2(dst+8, src+8, halfpel_h+8, stride, rounding, 8);
414                    interpolate8x8_avg2(dst+8*stride, src+8*stride, halfpel_h+8*stride, stride, rounding, 8);
415                    interpolate8x8_avg2(dst+8*stride+8, src+8*stride+8, halfpel_h+8*stride+8, stride, rounding, 8);
416                  break;                  break;
417    
418          case 2:          case 2:
419              interpolate8x8_lowpass_h(dst, src, stride, stride, rounding);              interpolate16x16_lowpass_h(dst, src, stride, rounding);
420                  break;                  break;
421    
422          case 3:          case 3:
423                  interpolate8x8_lowpass_h(halfpel_h, src, 8, stride, rounding);                  interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
424                  interpolate8x8_bilinear2(dst, src+1, halfpel_h, stride, stride, rounding);                  interpolate8x8_avg2(dst, src + 1, halfpel_h, stride, rounding, 8);
425                    interpolate8x8_avg2(dst+8, src + 8 + 1, halfpel_h+8, stride, rounding, 8);
426                    interpolate8x8_avg2(dst+8*stride, src + 8*stride + 1, halfpel_h+8*stride, stride, rounding, 8);
427                    interpolate8x8_avg2(dst+8*stride+8, src+8*stride+8 + 1, halfpel_h+8*stride+8, stride, rounding, 8);
428                  break;                  break;
429    
430          case 4:          case 4:
431                  interpolate8x8_lowpass_v(halfpel_v, src, 8, stride, rounding);                  interpolate16x16_lowpass_v(halfpel_v, src, stride, rounding);
432                  interpolate8x8_bilinear2(dst, src, halfpel_v, stride, stride, rounding);                  interpolate8x8_avg2(dst, src, halfpel_v, stride, rounding, 8);
433                    interpolate8x8_avg2(dst+8, src+8, halfpel_v+8, stride, rounding, 8);
434                    interpolate8x8_avg2(dst+8*stride, src+8*stride, halfpel_v+8*stride, stride, rounding, 8);
435                    interpolate8x8_avg2(dst+8*stride+8, src+8*stride+8, halfpel_v+8*stride+8, stride, rounding, 8);
436                  break;                  break;
437    
438          case 5:          case 5:
439                  interpolate8x8_lowpass_v(halfpel_v, src, 8, stride, rounding);                  interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
440                  interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);                  interpolate8x8_avg2(halfpel_v, src, halfpel_h, stride, rounding, 9);
441                  interpolate8x8_bilinear4(dst, src, halfpel_h, halfpel_v, halfpel_hv, stride, rounding);                  interpolate8x8_avg2(halfpel_v+8, src + 8, halfpel_h+8, stride, rounding, 9);
442                    interpolate8x8_avg2(halfpel_v+8*stride, src + 8*stride, halfpel_h+8*stride, stride, rounding, 9);
443                    interpolate8x8_avg2(halfpel_v+8*stride+8, src+8*stride+8, halfpel_h+8*stride+8, stride, rounding, 9);
444    
445                    interpolate16x16_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
446                    interpolate8x8_avg2(dst, halfpel_hv, halfpel_v, stride, rounding, 8);
447                    interpolate8x8_avg2(dst+8, halfpel_hv+8, halfpel_v+8, stride, rounding, 8);
448                    interpolate8x8_avg2(dst+8*stride, halfpel_hv+8*stride, halfpel_v+8*stride, stride, rounding, 8);
449                    interpolate8x8_avg2(dst+8*stride+8, halfpel_hv+8*stride+8, halfpel_v+8*stride+8, stride, rounding, 8);
450                  break;                  break;
451    
452          case 6:          case 6:
453                  interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);                  interpolate16x16_lowpass_hv(halfpel_hv, halfpel_h, src, stride, rounding);
454                  interpolate8x8_bilinear2(dst, halfpel_h, halfpel_hv, stride, 8, 1-rounding);                  interpolate8x8_avg2(dst, halfpel_h, halfpel_hv, stride, rounding, 8);
455                    interpolate8x8_avg2(dst+8, halfpel_h+8, halfpel_hv+8, stride, rounding, 8);
456                    interpolate8x8_avg2(dst+8*stride, halfpel_h+8*stride, halfpel_hv+8*stride, stride, rounding, 8);
457                    interpolate8x8_avg2(dst+8*stride+8, halfpel_h+8*stride+8, halfpel_hv+8*stride+8, stride, rounding, 8);
458                  break;                  break;
459    
460          case 7:          case 7:
461                  interpolate8x8_lowpass_v(halfpel_v, src+1, 8, stride, 16-rounding);                  interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
462                  interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);                  interpolate8x8_avg2(halfpel_v, src+1, halfpel_h, stride, rounding, 9);
463                  interpolate8x8_bilinear4(dst, src+1, halfpel_h, halfpel_v, halfpel_hv, stride, rounding);                  interpolate8x8_avg2(halfpel_v+8, src+1 + 8, halfpel_h+8, stride, rounding, 9);
464                    interpolate8x8_avg2(halfpel_v+8*stride, src+1 + 8*stride, halfpel_h+8*stride, stride, rounding, 9);
465                    interpolate8x8_avg2(halfpel_v+8*stride+8, src+1+8*stride+8, halfpel_h+8*stride+8, stride, rounding, 9);
466    
467                    interpolate16x16_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
468                    interpolate8x8_avg2(dst, halfpel_hv, halfpel_v, stride, rounding, 8);
469                    interpolate8x8_avg2(dst+8, halfpel_hv+8, halfpel_v+8, stride, rounding, 8);
470                    interpolate8x8_avg2(dst+8*stride, halfpel_hv+8*stride, halfpel_v+8*stride, stride, rounding, 8);
471                    interpolate8x8_avg2(dst+8*stride+8, halfpel_hv+8*stride+8, halfpel_v+8*stride+8, stride, rounding, 8);
472                  break;                  break;
473    
474          case 8:          case 8:
475              interpolate8x8_lowpass_v(dst, src, stride, stride, rounding);              interpolate16x16_lowpass_v(dst, src, stride, rounding);
476                  break;                  break;
477    
478          case 9:          case 9:
479                  interpolate8x8_lowpass_v(halfpel_v, src, 8, stride, 16-rounding);                  interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
480                  interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);                  interpolate8x8_avg2(halfpel_v, src, halfpel_h, stride, rounding, 9);
481                  interpolate8x8_bilinear2(dst, halfpel_v, halfpel_hv, stride, 8, rounding);                  interpolate8x8_avg2(halfpel_v+8, src + 8, halfpel_h+8, stride, rounding, 9);
482                    interpolate8x8_avg2(halfpel_v+8*stride, src + 8*stride, halfpel_h+8*stride, stride, rounding, 9);
483                    interpolate8x8_avg2(halfpel_v+8*stride+8, src+8*stride+8, halfpel_h+8*stride+8, stride, rounding, 9);
484                    interpolate16x16_lowpass_v(dst, halfpel_v, stride, rounding);
485                  break;                  break;
486    
487          case 10:          case 10:
488                  interpolate8x8_lowpass_hv(dst, halfpel_h, src, stride, 8, stride, rounding);                  interpolate16x16_lowpass_hv(dst, halfpel_h, src, stride, rounding);
489                  break;                  break;
490    
491          case 11:          case 11:
492                  interpolate8x8_lowpass_v(halfpel_v, src+1, 8, stride, 16-rounding);                  interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
493                  interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);                  interpolate8x8_avg2(halfpel_v, src+1, halfpel_h, stride, rounding, 9);
494                  interpolate8x8_bilinear2(dst, halfpel_v, halfpel_hv, stride, 8, rounding);                  interpolate8x8_avg2(halfpel_v+8, src+1 + 8, halfpel_h+8, stride, rounding, 9);
495                    interpolate8x8_avg2(halfpel_v+8*stride, src+1 + 8*stride, halfpel_h+8*stride, stride, rounding, 9);
496                    interpolate8x8_avg2(halfpel_v+8*stride+8, src+1+8*stride+8, halfpel_h+8*stride+8, stride, rounding, 9);
497                    interpolate16x16_lowpass_v(dst, halfpel_v, stride, rounding);
498                  break;                  break;
499    
500          case 12:          case 12:
501                  interpolate8x8_lowpass_v(halfpel_v, src, 8, stride, rounding);                  interpolate16x16_lowpass_v(halfpel_v, src, stride, rounding);
502                  interpolate8x8_bilinear2(dst, src+stride, halfpel_v, stride, stride, rounding);                  interpolate8x8_avg2(dst, src+stride, halfpel_v, stride, rounding, 8);
503                    interpolate8x8_avg2(dst+8, src+stride+8, halfpel_v+8, stride, rounding, 8);
504                    interpolate8x8_avg2(dst+8*stride, src+stride+8*stride, halfpel_v+8*stride, stride, rounding, 8);
505                    interpolate8x8_avg2(dst+8*stride+8, src+stride+8*stride+8, halfpel_v+8*stride+8, stride, rounding, 8);
506                  break;                  break;
507    
508          case 13:          case 13:
509                  interpolate8x8_lowpass_v(halfpel_v, src, 8, stride, rounding);                  interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
510                  interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);                  interpolate8x8_avg2(halfpel_v, src, halfpel_h, stride, rounding, 9);
511                  interpolate8x8_bilinear4(dst, src+stride, halfpel_h+8, halfpel_v, halfpel_hv, stride, rounding);                  interpolate8x8_avg2(halfpel_v+8, src + 8, halfpel_h+8, stride, rounding, 9);
512                    interpolate8x8_avg2(halfpel_v+8*stride, src + 8*stride, halfpel_h+8*stride, stride, rounding, 9);
513                    interpolate8x8_avg2(halfpel_v+8*stride+8, src+8*stride+8, halfpel_h+8*stride+8, stride, rounding, 9);
514    
515                    interpolate16x16_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
516                    interpolate8x8_avg2(dst, halfpel_hv, halfpel_v+stride, stride, rounding, 8);
517                    interpolate8x8_avg2(dst+8, halfpel_hv+8, halfpel_v+stride+8, stride, rounding, 8);
518                    interpolate8x8_avg2(dst+8*stride, halfpel_hv+8*stride, halfpel_v+stride+8*stride, stride, rounding, 8);
519                    interpolate8x8_avg2(dst+8*stride+8, halfpel_hv+8*stride+8, halfpel_v+stride+8*stride+8, stride, rounding, 8);
520                  break;                  break;
521    
522          case 14:          case 14:
523                  interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);                  interpolate16x16_lowpass_hv(halfpel_hv, halfpel_h, src, stride, rounding);
524                  interpolate8x8_bilinear2(dst, halfpel_h+8, halfpel_hv, stride, 8, rounding);                  interpolate8x8_avg2(dst, halfpel_h+stride, halfpel_hv, stride, rounding, 8);
525                    interpolate8x8_avg2(dst+8, halfpel_h+stride+8, halfpel_hv+8, stride, rounding, 8);
526                    interpolate8x8_avg2(dst+8*stride, halfpel_h+stride+8*stride, halfpel_hv+8*stride, stride, rounding, 8);
527                    interpolate8x8_avg2(dst+8*stride+8, halfpel_h+stride+8*stride+8, halfpel_hv+8*stride+8, stride, rounding, 8);
528                  break;                  break;
529    
530          case 15:          case 15:
531                  interpolate8x8_lowpass_v(halfpel_v, src+1, 8, stride, rounding);                  interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
532                  interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);                  interpolate8x8_avg2(halfpel_v, src+1, halfpel_h, stride, rounding, 9);
533                  interpolate8x8_bilinear4(dst, src+stride+1, halfpel_h+8, halfpel_v, halfpel_hv, stride, rounding);                  interpolate8x8_avg2(halfpel_v+8, src+1 + 8, halfpel_h+8, stride, rounding, 9);
534                    interpolate8x8_avg2(halfpel_v+8*stride, src+1 + 8*stride, halfpel_h+8*stride, stride, rounding, 9);
535                    interpolate8x8_avg2(halfpel_v+8*stride+8, src+1+8*stride+8, halfpel_h+8*stride+8, stride, rounding, 9);
536    
537                    interpolate16x16_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
538                    interpolate8x8_avg2(dst, halfpel_hv, halfpel_v+stride, stride, rounding, 8);
539                    interpolate8x8_avg2(dst+8, halfpel_hv+8, halfpel_v+stride+8, stride, rounding, 8);
540                    interpolate8x8_avg2(dst+8*stride, halfpel_hv+8*stride, halfpel_v+stride+8*stride, stride, rounding, 8);
541                    interpolate8x8_avg2(dst+8*stride+8, halfpel_hv+8*stride+8, halfpel_v+stride+8*stride+8, stride, rounding, 8);
542                  break;                  break;
543          }          }
544  }  }
545    
546    #endif

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.11.2.1

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4