[svn] / branches / dev-api-4 / xvidcore / src / image / interpolate8x8.h Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/src/image/interpolate8x8.h

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

revision 332, Tue Jul 23 16:19:22 2002 UTC revision 333, Wed Jul 24 00:50:10 2002 UTC
# Line 30  Line 30 
30  INTERPOLATE8X8 interpolate8x8_halfpel_v_ia64;  INTERPOLATE8X8 interpolate8x8_halfpel_v_ia64;
31  INTERPOLATE8X8 interpolate8x8_halfpel_hv_ia64;  INTERPOLATE8X8 interpolate8x8_halfpel_hv_ia64;
32    
33    void interpolate8x8_lowpass_h(uint8_t *dst, uint8_t *src, int32_t dst_stride, int32_t src_stride, int32_t rounding);
34    void interpolate8x8_lowpass_v(uint8_t *dst, uint8_t *src, int32_t dst_stride, int32_t src_stride, int32_t rounding);
35    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);
36    void interpolate8x8_bilinear2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int32_t dst_stride, int32_t src_stride, int32_t rounding);
37    void interpolate8x8_bilinear4(uint8_t *dst, uint8_t *src1, uint8_t *src2, uint8_t *src3, uint8_t *src4, int32_t stride, int32_t rounding);
38    
39    void interpolate8x8_c(uint8_t * const dst,
40                                              const uint8_t * const src,
41                                              const uint32_t x,
42                                              const uint32_t y,
43                                              const uint32_t stride);
44    
45  static __inline void  static __inline void
46  interpolate8x8_switch(uint8_t * const cur,  interpolate8x8_switch(uint8_t * const cur,
47                                            const uint8_t * const refn,                                            const uint8_t * const refn,
# Line 78  Line 90 
90  }  }
91    
92    
93  void interpolate8x8_c(uint8_t * const dst,  static __inline void interpolate8x8_quarterpel(uint8_t * const cur,
94                                            const uint8_t * const src,                                       uint8_t * const refn,
95                                            const uint32_t x,                                       const uint32_t x, const uint32_t y,
96                                            const uint32_t y,                                           const int32_t dx,  const int dy,
97                                            const uint32_t stride);                                           const uint32_t stride,
98                                             const uint32_t rounding)
99    {
100            const int32_t xRef = x*4 + dx;
101            const int32_t yRef = y*4 + dy;
102    
103            uint8_t *src, *dst;
104            int32_t x_int, y_int, x_frac, y_frac;
105    
106            uint8_t halfpel_h[72];
107            uint8_t halfpel_v[64];
108            uint8_t halfpel_hv[64];
109    
110            x_int = xRef/4;
111            if (xRef < 0 && xRef % 4)
112                    x_int--;
113    
114            x_frac = xRef - (4*x_int);
115    
116            y_int  = yRef/4;
117            if (yRef < 0 && yRef % 4)
118                    y_int--;
119    
120            y_frac = yRef - (4*y_int);
121    
122            src = refn + y_int * stride + x_int;
123            dst = cur + y * stride + x;
124    
125            switch((y_frac << 2) | (x_frac)) {
126    
127            case 0:
128                    transfer8x8_copy(dst, src, stride);
129                    break;
130    
131            case 1:
132                    interpolate8x8_lowpass_h(halfpel_h, src, 8, stride, rounding);
133                    interpolate8x8_bilinear2(dst, src, halfpel_h, stride, stride, rounding);
134                    break;
135    
136            case 2:
137                interpolate8x8_lowpass_h(dst, src, stride, stride, rounding);
138                    break;
139    
140            case 3:
141                    interpolate8x8_lowpass_h(halfpel_h, src, 8, stride, rounding);
142                    interpolate8x8_bilinear2(dst, src+1, halfpel_h, stride, stride, rounding);
143                    break;
144    
145            case 4:
146                    interpolate8x8_lowpass_v(halfpel_v, src, 8, stride, rounding);
147                    interpolate8x8_bilinear2(dst, src, halfpel_v, stride, stride, rounding);
148                    break;
149    
150            case 5:
151                    interpolate8x8_lowpass_v(halfpel_v, src, 8, stride, rounding);
152                    interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);
153                    interpolate8x8_bilinear4(dst, src, halfpel_h, halfpel_v, halfpel_hv, stride, rounding);
154                    break;
155    
156            case 6:
157                    interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);
158                    interpolate8x8_bilinear2(dst, halfpel_h, halfpel_hv, stride, 8, 1-rounding);
159                    break;
160    
161            case 7:
162                    interpolate8x8_lowpass_v(halfpel_v, src+1, 8, stride, 16-rounding);
163                    interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);
164                    interpolate8x8_bilinear4(dst, src+1, halfpel_h, halfpel_v, halfpel_hv, stride, rounding);
165                    break;
166    
167            case 8:
168                interpolate8x8_lowpass_v(dst, src, stride, stride, rounding);
169                    break;
170    
171            case 9:
172                    interpolate8x8_lowpass_v(halfpel_v, src, 8, stride, 16-rounding);
173                    interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);
174                    interpolate8x8_bilinear2(dst, halfpel_v, halfpel_hv, stride, 8, rounding);
175                    break;
176    
177            case 10:
178                    interpolate8x8_lowpass_hv(dst, halfpel_h, src, stride, 8, stride, rounding);
179                    break;
180    
181            case 11:
182                    interpolate8x8_lowpass_v(halfpel_v, src+1, 8, stride, 16-rounding);
183                    interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);
184                    interpolate8x8_bilinear2(dst, halfpel_v, halfpel_hv, stride, 8, rounding);
185                    break;
186    
187            case 12:
188                    interpolate8x8_lowpass_v(halfpel_v, src, 8, stride, rounding);
189                    interpolate8x8_bilinear2(dst, src+stride, halfpel_v, stride, stride, rounding);
190                    break;
191    
192            case 13:
193                    interpolate8x8_lowpass_v(halfpel_v, src, 8, stride, rounding);
194                    interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);
195                    interpolate8x8_bilinear4(dst, src+stride, halfpel_h+8, halfpel_v, halfpel_hv, stride, rounding);
196                    break;
197    
198            case 14:
199                    interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);
200                    interpolate8x8_bilinear2(dst, halfpel_h+8, halfpel_hv, stride, 8, rounding);
201                    break;
202    
203            case 15:
204                    interpolate8x8_lowpass_v(halfpel_v, src+1, 8, stride, rounding);
205                    interpolate8x8_lowpass_hv(halfpel_hv, halfpel_h, src, 8, 8, stride, rounding);
206                    interpolate8x8_bilinear4(dst, src+stride+1, halfpel_h+8, halfpel_v, halfpel_hv, stride, rounding);
207                    break;
208            }
209    }

Legend:
Removed from v.332  
changed lines
  Added in v.333

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