[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.3, Wed Jun 12 20:38:40 2002 UTC revision 1.12, Mon Apr 5 20:36:36 2004 UTC
# Line 1  Line 1 
1    /*****************************************************************************
2     *
3     *  XVID MPEG-4 VIDEO CODEC
4     *  - Interpolation related header  -
5     *
6     *  Copyright(C) 2001-2003 Peter Ross <pross@xvid.org>
7     *
8     *  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
10     *  the Free Software Foundation ; either version 2 of the License, or
11     *  (at your option) any later version.
12     *
13     *  This program 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     * $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 6  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 26  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;
119    INTERPOLATE8X8 interpolate8x8_halfpel_v_ia64;
120    INTERPOLATE8X8 interpolate8x8_halfpel_hv_ia64;
121    #endif
122    
123    #ifdef ARCH_IS_PPC
124    INTERPOLATE8X8 interpolate8x8_halfpel_h_altivec_c;
125    INTERPOLATE8X8 interpolate8x8_halfpel_v_altivec_c;
126    INTERPOLATE8X8 interpolate8x8_halfpel_hv_altivec_c;
127    #endif
128    
129    INTERPOLATE8X8_AVG2 interpolate8x8_avg2_c;
130    INTERPOLATE8X8_AVG4 interpolate8x8_avg4_c;
131    
132    #ifdef ARCH_IS_IA32
133    INTERPOLATE8X8_AVG2 interpolate8x8_avg2_mmx;
134    INTERPOLATE8X8_AVG4 interpolate8x8_avg4_mmx;
135    #endif
136    
137    #ifdef ARCH_IS_PPC
138    INTERPOLATE8X8_AVG2 interpolate8x8_avg2_altivec_c;
139    INTERPOLATE8X8_AVG4 interpolate8x8_avg4_altivec_c;
140    #endif
141    
142    INTERPOLATE_LOWPASS interpolate8x8_lowpass_h_c;
143    INTERPOLATE_LOWPASS interpolate8x8_lowpass_v_c;
144    
145    INTERPOLATE_LOWPASS interpolate16x16_lowpass_h_c;
146    INTERPOLATE_LOWPASS interpolate16x16_lowpass_v_c;
147    
148    INTERPOLATE_LOWPASS_HV interpolate8x8_lowpass_hv_c;
149    INTERPOLATE_LOWPASS_HV interpolate16x16_lowpass_hv_c;
150    
151    INTERPOLATE8X8_6TAP_LOWPASS interpolate8x8_6tap_lowpass_h_c;
152    INTERPOLATE8X8_6TAP_LOWPASS interpolate8x8_6tap_lowpass_v_c;
153    
154    #ifdef ARCH_IS_IA32
155    INTERPOLATE8X8_6TAP_LOWPASS interpolate8x8_6tap_lowpass_h_mmx;
156    INTERPOLATE8X8_6TAP_LOWPASS interpolate8x8_6tap_lowpass_v_mmx;
157    #endif
158    
159    #ifdef ARCH_IS_PPC
160    INTERPOLATE8X8_6TAP_LOWPASS interpolate8x8_6tap_lowpass_h_altivec_c;
161    #endif
162    
163  static __inline void  static __inline void
164  interpolate8x8_switch(uint8_t * const cur,  interpolate8x8_switch(uint8_t * const cur,
165                                            const uint8_t * const refn,                                            const uint8_t * const refn,
# Line 36  Line 170 
170                                            const uint32_t stride,                                            const uint32_t stride,
171                                            const uint32_t rounding)                                            const uint32_t rounding)
172  {  {
         int32_t ddx, ddy;  
173    
174          switch (((dx & 1) << 1) + (dy & 1))     // ((dx%2)?2:0)+((dy%2)?1:0)          const uint8_t * const src = refn + (int)((y + (dy>>1)) * stride + x + (dx>>1));
175            uint8_t * const dst = cur + (int)(y * stride + x);
176    
177            switch (((dx & 1) << 1) + (dy & 1))     { /* ((dx%2)?2:0)+((dy%2)?1:0) */
178            case 0:
179                    transfer8x8_copy(dst, src, stride);
180                    break;
181            case 1:
182                    interpolate8x8_halfpel_v(dst, src, stride, rounding);
183                    break;
184            case 2:
185                    interpolate8x8_halfpel_h(dst, src, stride, rounding);
186                    break;
187            default:
188                    interpolate8x8_halfpel_hv(dst, src, stride, rounding);
189                    break;
190            }
191    }
192    
193    
194    static __inline void
195    interpolate16x16_switch(uint8_t * const cur,
196                                              const uint8_t * const refn,
197                                              const uint32_t x,
198                                              const uint32_t y,
199                                              const int32_t dx,
200                                              const int dy,
201                                              const uint32_t stride,
202                                              const uint32_t rounding)
203    {
204            interpolate8x8_switch(cur, refn, x,   y,   dx, dy, stride, rounding);
205            interpolate8x8_switch(cur, refn, x+8, y,   dx, dy, stride, rounding);
206            interpolate8x8_switch(cur, refn, x,   y+8, dx, dy, stride, rounding);
207            interpolate8x8_switch(cur, refn, x+8, y+8, dx, dy, stride, rounding);
208    }
209    
210    
211    static __inline void
212    interpolate32x32_switch(uint8_t * const cur,
213                                              const uint8_t * const refn,
214                                              const uint32_t x,
215                                              const uint32_t y,
216                                              const int32_t dx,
217                                              const int dy,
218                                              const uint32_t stride,
219                                              const uint32_t rounding)
220    {
221            interpolate16x16_switch(cur, refn, x,    y,    dx, dy, stride, rounding);
222            interpolate16x16_switch(cur, refn, x+16, y,    dx, dy, stride, rounding);
223            interpolate16x16_switch(cur, refn, x,    y+16, dx, dy, stride, rounding);
224            interpolate16x16_switch(cur, refn, x+16, y+16, dx, dy, stride, rounding);
225    }
226    
227    
228    static __inline uint8_t *
229    interpolate8x8_switch2(uint8_t * const buffer,
230                                              const uint8_t * const refn,
231                                              const int x,
232                                              const int y,
233                                              const int dx,
234                                              const int dy,
235                                              const uint32_t stride,
236                                              const uint32_t rounding)
237          {          {
238    
239            const uint8_t * const src = refn + (int)((y + (dy>>1)) * stride + x + (dx>>1));
240    
241            switch (((dx & 1) << 1) + (dy & 1))     { /* ((dx%2)?2:0)+((dy%2)?1:0) */
242          case 0:          case 0:
243                  ddx = dx / 2;                  return (uint8_t *)src;
244                  ddy = dy / 2;          case 1:
245                  transfer8x8_copy(cur + y * stride + x,                  interpolate8x8_halfpel_v(buffer, src, stride, rounding);
246                                                   refn + (y + ddy) * stride + x + ddx, stride);                  break;
247            case 2:
248                    interpolate8x8_halfpel_h(buffer, src, stride, rounding);
249                    break;
250            default:
251                    interpolate8x8_halfpel_hv(buffer, src, stride, rounding);
252                    break;
253            }
254            return buffer;
255    }
256    
257    static __inline void interpolate8x8_quarterpel(uint8_t * const cur,
258                                         uint8_t * const refn,
259                                             uint8_t * const refh,
260                                             uint8_t * const refv,
261                                             uint8_t * const refhv,
262                                         const uint32_t x, const uint32_t y,
263                                             const int32_t dx,  const int dy,
264                                             const uint32_t stride,
265                                             const uint32_t rounding)
266    {
267            const int32_t xRef = x*4 + dx;
268            const int32_t yRef = y*4 + dy;
269    
270            uint8_t *src, *dst;
271            uint8_t *halfpel_h, *halfpel_v, *halfpel_hv;
272            int32_t x_int, y_int, x_frac, y_frac;
273    
274            x_int = xRef/4;
275            if (xRef < 0 && xRef % 4)
276                    x_int--;
277    
278            x_frac = xRef - (4*x_int);
279    
280            y_int  = yRef/4;
281            if (yRef < 0 && yRef % 4)
282                    y_int--;
283    
284            y_frac = yRef - (4*y_int);
285    
286            src = refn + y_int * stride + x_int;
287            halfpel_h = refh;
288            halfpel_v = refv;
289            halfpel_hv = refhv;
290    
291            dst = cur + y * stride + x;
292    
293            switch((y_frac << 2) | (x_frac)) {
294    
295            case 0:
296                    transfer8x8_copy(dst, src, stride);
297                  break;                  break;
298    
299          case 1:          case 1:
300                  ddx = dx / 2;                  interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
301                  ddy = (dy - 1) / 2;                  interpolate8x8_avg2(dst, src, halfpel_h, stride, rounding, 8);
                 interpolate8x8_halfpel_v(cur + y * stride + x,  
                                                                  refn + (y + ddy) * stride + x + ddx, stride,  
                                                                  rounding);  
302                  break;                  break;
303    
304          case 2:          case 2:
305                  ddx = (dx - 1) / 2;              interpolate8x8_lowpass_h(dst, src, stride, rounding);
                 ddy = dy / 2;  
                 interpolate8x8_halfpel_h(cur + y * stride + x,  
                                                                  refn + (y + ddy) * stride + x + ddx, stride,  
                                                                  rounding);  
306                  break;                  break;
307    
308          default:          case 3:
309                  ddx = (dx - 1) / 2;                  interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
310                  ddy = (dy - 1) / 2;                  interpolate8x8_avg2(dst, src + 1, halfpel_h, stride, rounding, 8);
311                  interpolate8x8_halfpel_hv(cur + y * stride + x,                  break;
312                                                                    refn + (y + ddy) * stride + x + ddx, stride,  
313                                                                    rounding);          case 4:
314                    interpolate8x8_lowpass_v(halfpel_v, src, stride, rounding);
315                    interpolate8x8_avg2(dst, src, halfpel_v, stride, rounding, 8);
316                    break;
317    
318            case 5:
319                    interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
320                    interpolate8x8_avg2(halfpel_v, src, halfpel_h, stride, rounding, 9);
321                    interpolate8x8_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
322                    interpolate8x8_avg2(dst, halfpel_v, halfpel_hv, stride, rounding, 8);
323                    break;
324    
325            case 6:
326                    interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, stride, rounding);
327                    interpolate8x8_avg2(dst, halfpel_h, halfpel_hv, stride, rounding, 8);
328                    break;
329    
330            case 7:
331                    interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
332                    interpolate8x8_avg2(halfpel_v, src + 1, halfpel_h, stride, rounding, 9);
333                    interpolate8x8_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
334                    interpolate8x8_avg2(dst, halfpel_v, halfpel_hv, stride, rounding, 8);
335                    break;
336    
337            case 8:
338                interpolate8x8_lowpass_v(dst, src, stride, rounding);
339                    break;
340    
341            case 9:
342                    interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
343                    interpolate8x8_avg2(halfpel_v, src, halfpel_h, stride, rounding, 9);
344                    interpolate8x8_lowpass_v(dst, halfpel_v, stride, rounding);
345                    break;
346    
347            case 10:
348                    interpolate8x8_lowpass_hv(dst, halfpel_h, src, stride, rounding);
349                    break;
350    
351            case 11:
352                    interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
353                    interpolate8x8_avg2(halfpel_v, src + 1, halfpel_h, stride, rounding, 9);
354                    interpolate8x8_lowpass_v(dst, halfpel_v, stride, rounding);
355                    break;
356    
357            case 12:
358                    interpolate8x8_lowpass_v(halfpel_v, src, stride, rounding);
359                    interpolate8x8_avg2(dst, src+stride, halfpel_v, stride, rounding, 8);
360                    break;
361    
362            case 13:
363                    interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
364                    interpolate8x8_avg2(halfpel_v, src, halfpel_h, stride, rounding, 9);
365                    interpolate8x8_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
366                    interpolate8x8_avg2(dst, halfpel_v+stride, halfpel_hv, stride, rounding, 8);
367                    break;
368    
369            case 14:
370                    interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, stride, rounding);
371                    interpolate8x8_avg2(dst, halfpel_h+stride, halfpel_hv, stride, rounding, 8);
372                    break;
373    
374            case 15:
375                    interpolate8x8_lowpass_h(halfpel_h, src, stride, rounding);
376                    interpolate8x8_avg2(halfpel_v, src + 1, halfpel_h, stride, rounding, 9);
377                    interpolate8x8_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
378                    interpolate8x8_avg2(dst, halfpel_hv, halfpel_v + stride, stride, rounding, 8);
379                  break;                  break;
380          }          }
381  }  }
382    
383    static __inline void interpolate16x16_quarterpel(uint8_t * const cur,
384                                         uint8_t * const refn,
385                                             uint8_t * const refh,
386                                             uint8_t * const refv,
387                                             uint8_t * const refhv,
388                                         const uint32_t x, const uint32_t y,
389                                             const int32_t dx,  const int dy,
390                                             const uint32_t stride,
391                                             const uint32_t rounding)
392    {
393            const int32_t xRef = x*4 + dx;
394            const int32_t yRef = y*4 + dy;
395    
396            uint8_t *src, *dst;
397            uint8_t *halfpel_h, *halfpel_v, *halfpel_hv;
398            int32_t x_int, y_int, x_frac, y_frac;
399    
400  void interpolate8x8_c(uint8_t * const dst,          x_int = xRef/4;
401                                            const uint8_t * const src,          if (xRef < 0 && xRef % 4)
402                                            const uint32_t x,                  x_int--;
403                                            const uint32_t y,  
404                                            const uint32_t stride);          x_frac = xRef - (4*x_int);
405    
406            y_int  = yRef/4;
407            if (yRef < 0 && yRef % 4)
408                    y_int--;
409    
410            y_frac = yRef - (4*y_int);
411    
412            src = refn + y_int * stride + x_int;
413            halfpel_h = refh;
414            halfpel_v = refv;
415            halfpel_hv = refhv;
416    
417            dst = cur + y * stride + x;
418    
419            switch((y_frac << 2) | (x_frac)) {
420    
421            case 0:
422                    transfer16x16_copy(dst, src, stride);
423                    break;
424    
425            case 1:
426                    interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
427                    interpolate8x8_avg2(dst, src, halfpel_h, stride, rounding, 8);
428                    interpolate8x8_avg2(dst+8, src+8, halfpel_h+8, stride, rounding, 8);
429                    interpolate8x8_avg2(dst+8*stride, src+8*stride, halfpel_h+8*stride, stride, rounding, 8);
430                    interpolate8x8_avg2(dst+8*stride+8, src+8*stride+8, halfpel_h+8*stride+8, stride, rounding, 8);
431                    break;
432    
433            case 2:
434                interpolate16x16_lowpass_h(dst, src, stride, rounding);
435                    break;
436    
437            case 3:
438                    interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
439                    interpolate8x8_avg2(dst, src + 1, halfpel_h, stride, rounding, 8);
440                    interpolate8x8_avg2(dst+8, src + 8 + 1, halfpel_h+8, stride, rounding, 8);
441                    interpolate8x8_avg2(dst+8*stride, src + 8*stride + 1, halfpel_h+8*stride, stride, rounding, 8);
442                    interpolate8x8_avg2(dst+8*stride+8, src+8*stride+8 + 1, halfpel_h+8*stride+8, stride, rounding, 8);
443                    break;
444    
445            case 4:
446                    interpolate16x16_lowpass_v(halfpel_v, src, stride, rounding);
447                    interpolate8x8_avg2(dst, src, halfpel_v, stride, rounding, 8);
448                    interpolate8x8_avg2(dst+8, src+8, halfpel_v+8, stride, rounding, 8);
449                    interpolate8x8_avg2(dst+8*stride, src+8*stride, halfpel_v+8*stride, stride, rounding, 8);
450                    interpolate8x8_avg2(dst+8*stride+8, src+8*stride+8, halfpel_v+8*stride+8, stride, rounding, 8);
451                    break;
452    
453            case 5:
454                    interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
455                    interpolate8x8_avg2(halfpel_v, src, halfpel_h, stride, rounding, 9);
456                    interpolate8x8_avg2(halfpel_v+8, src + 8, halfpel_h+8, stride, rounding, 9);
457                    interpolate8x8_avg2(halfpel_v+8*stride, src + 8*stride, halfpel_h+8*stride, stride, rounding, 9);
458                    interpolate8x8_avg2(halfpel_v+8*stride+8, src+8*stride+8, halfpel_h+8*stride+8, stride, rounding, 9);
459    
460                    interpolate16x16_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
461                    interpolate8x8_avg2(dst, halfpel_hv, halfpel_v, stride, rounding, 8);
462                    interpolate8x8_avg2(dst+8, halfpel_hv+8, halfpel_v+8, stride, rounding, 8);
463                    interpolate8x8_avg2(dst+8*stride, halfpel_hv+8*stride, halfpel_v+8*stride, stride, rounding, 8);
464                    interpolate8x8_avg2(dst+8*stride+8, halfpel_hv+8*stride+8, halfpel_v+8*stride+8, stride, rounding, 8);
465                    break;
466    
467            case 6:
468                    interpolate16x16_lowpass_hv(halfpel_hv, halfpel_h, src, stride, rounding);
469                    interpolate8x8_avg2(dst, halfpel_h, halfpel_hv, stride, rounding, 8);
470                    interpolate8x8_avg2(dst+8, halfpel_h+8, halfpel_hv+8, stride, rounding, 8);
471                    interpolate8x8_avg2(dst+8*stride, halfpel_h+8*stride, halfpel_hv+8*stride, stride, rounding, 8);
472                    interpolate8x8_avg2(dst+8*stride+8, halfpel_h+8*stride+8, halfpel_hv+8*stride+8, stride, rounding, 8);
473                    break;
474    
475            case 7:
476                    interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
477                    interpolate8x8_avg2(halfpel_v, src+1, halfpel_h, stride, rounding, 9);
478                    interpolate8x8_avg2(halfpel_v+8, src+1 + 8, halfpel_h+8, stride, rounding, 9);
479                    interpolate8x8_avg2(halfpel_v+8*stride, src+1 + 8*stride, halfpel_h+8*stride, stride, rounding, 9);
480                    interpolate8x8_avg2(halfpel_v+8*stride+8, src+1+8*stride+8, halfpel_h+8*stride+8, stride, rounding, 9);
481    
482                    interpolate16x16_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
483                    interpolate8x8_avg2(dst, halfpel_hv, halfpel_v, stride, rounding, 8);
484                    interpolate8x8_avg2(dst+8, halfpel_hv+8, halfpel_v+8, stride, rounding, 8);
485                    interpolate8x8_avg2(dst+8*stride, halfpel_hv+8*stride, halfpel_v+8*stride, stride, rounding, 8);
486                    interpolate8x8_avg2(dst+8*stride+8, halfpel_hv+8*stride+8, halfpel_v+8*stride+8, stride, rounding, 8);
487                    break;
488    
489            case 8:
490                interpolate16x16_lowpass_v(dst, src, stride, rounding);
491                    break;
492    
493            case 9:
494                    interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
495                    interpolate8x8_avg2(halfpel_v, src, halfpel_h, stride, rounding, 9);
496                    interpolate8x8_avg2(halfpel_v+8, src + 8, halfpel_h+8, stride, rounding, 9);
497                    interpolate8x8_avg2(halfpel_v+8*stride, src + 8*stride, halfpel_h+8*stride, stride, rounding, 9);
498                    interpolate8x8_avg2(halfpel_v+8*stride+8, src+8*stride+8, halfpel_h+8*stride+8, stride, rounding, 9);
499                    interpolate16x16_lowpass_v(dst, halfpel_v, stride, rounding);
500                    break;
501    
502            case 10:
503                    interpolate16x16_lowpass_hv(dst, halfpel_h, src, stride, rounding);
504                    break;
505    
506            case 11:
507                    interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
508                    interpolate8x8_avg2(halfpel_v, src+1, halfpel_h, stride, rounding, 9);
509                    interpolate8x8_avg2(halfpel_v+8, src+1 + 8, halfpel_h+8, stride, rounding, 9);
510                    interpolate8x8_avg2(halfpel_v+8*stride, src+1 + 8*stride, halfpel_h+8*stride, stride, rounding, 9);
511                    interpolate8x8_avg2(halfpel_v+8*stride+8, src+1+8*stride+8, halfpel_h+8*stride+8, stride, rounding, 9);
512                    interpolate16x16_lowpass_v(dst, halfpel_v, stride, rounding);
513                    break;
514    
515            case 12:
516                    interpolate16x16_lowpass_v(halfpel_v, src, stride, rounding);
517                    interpolate8x8_avg2(dst, src+stride, halfpel_v, stride, rounding, 8);
518                    interpolate8x8_avg2(dst+8, src+stride+8, halfpel_v+8, stride, rounding, 8);
519                    interpolate8x8_avg2(dst+8*stride, src+stride+8*stride, halfpel_v+8*stride, stride, rounding, 8);
520                    interpolate8x8_avg2(dst+8*stride+8, src+stride+8*stride+8, halfpel_v+8*stride+8, stride, rounding, 8);
521                    break;
522    
523            case 13:
524                    interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
525                    interpolate8x8_avg2(halfpel_v, src, halfpel_h, stride, rounding, 9);
526                    interpolate8x8_avg2(halfpel_v+8, src + 8, halfpel_h+8, stride, rounding, 9);
527                    interpolate8x8_avg2(halfpel_v+8*stride, src + 8*stride, halfpel_h+8*stride, stride, rounding, 9);
528                    interpolate8x8_avg2(halfpel_v+8*stride+8, src+8*stride+8, halfpel_h+8*stride+8, stride, rounding, 9);
529    
530                    interpolate16x16_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
531                    interpolate8x8_avg2(dst, halfpel_hv, halfpel_v+stride, stride, rounding, 8);
532                    interpolate8x8_avg2(dst+8, halfpel_hv+8, halfpel_v+stride+8, stride, rounding, 8);
533                    interpolate8x8_avg2(dst+8*stride, halfpel_hv+8*stride, halfpel_v+stride+8*stride, stride, rounding, 8);
534                    interpolate8x8_avg2(dst+8*stride+8, halfpel_hv+8*stride+8, halfpel_v+stride+8*stride+8, stride, rounding, 8);
535                    break;
536    
537            case 14:
538                    interpolate16x16_lowpass_hv(halfpel_hv, halfpel_h, src, stride, rounding);
539                    interpolate8x8_avg2(dst, halfpel_h+stride, halfpel_hv, stride, rounding, 8);
540                    interpolate8x8_avg2(dst+8, halfpel_h+stride+8, halfpel_hv+8, stride, rounding, 8);
541                    interpolate8x8_avg2(dst+8*stride, halfpel_h+stride+8*stride, halfpel_hv+8*stride, stride, rounding, 8);
542                    interpolate8x8_avg2(dst+8*stride+8, halfpel_h+stride+8*stride+8, halfpel_hv+8*stride+8, stride, rounding, 8);
543                    break;
544    
545            case 15:
546                    interpolate16x16_lowpass_h(halfpel_h, src, stride, rounding);
547                    interpolate8x8_avg2(halfpel_v, src+1, halfpel_h, stride, rounding, 9);
548                    interpolate8x8_avg2(halfpel_v+8, src+1 + 8, halfpel_h+8, stride, rounding, 9);
549                    interpolate8x8_avg2(halfpel_v+8*stride, src+1 + 8*stride, halfpel_h+8*stride, stride, rounding, 9);
550                    interpolate8x8_avg2(halfpel_v+8*stride+8, src+1+8*stride+8, halfpel_h+8*stride+8, stride, rounding, 9);
551    
552                    interpolate16x16_lowpass_v(halfpel_hv, halfpel_v, stride, rounding);
553                    interpolate8x8_avg2(dst, halfpel_hv, halfpel_v+stride, stride, rounding, 8);
554                    interpolate8x8_avg2(dst+8, halfpel_hv+8, halfpel_v+stride+8, stride, rounding, 8);
555                    interpolate8x8_avg2(dst+8*stride, halfpel_hv+8*stride, halfpel_v+stride+8*stride, stride, rounding, 8);
556                    interpolate8x8_avg2(dst+8*stride+8, halfpel_hv+8*stride+8, halfpel_v+stride+8*stride+8, stride, rounding, 8);
557                    break;
558            }
559    }
560    
561    #endif

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.12

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