ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvs/xvidcore/src/image/interpolate8x8.h
Revision: 1.2
Committed: Fri May 3 00:45:10 2002 UTC (22 years, 5 months ago) by chenm001
Content type: text/plain
Branch: MAIN
Changes since 1.1: +6 -0 lines
Log Message:
add B-frame decode support

File Contents

# User Rev Content
1 Isibaar 1.1 #include "../utils/mem_transfer.h"
2    
3     typedef void (INTERPOLATE8X8)(uint8_t * const dst,
4     const uint8_t * const src,
5     const uint32_t stride,
6     const uint32_t rounding);
7     typedef INTERPOLATE8X8 * INTERPOLATE8X8_PTR;
8    
9     extern INTERPOLATE8X8_PTR interpolate8x8_halfpel_h;
10     extern INTERPOLATE8X8_PTR interpolate8x8_halfpel_v;
11     extern INTERPOLATE8X8_PTR interpolate8x8_halfpel_hv;
12    
13     INTERPOLATE8X8 interpolate8x8_halfpel_h_c;
14     INTERPOLATE8X8 interpolate8x8_halfpel_v_c;
15     INTERPOLATE8X8 interpolate8x8_halfpel_hv_c;
16    
17     INTERPOLATE8X8 interpolate8x8_halfpel_h_mmx;
18     INTERPOLATE8X8 interpolate8x8_halfpel_v_mmx;
19     INTERPOLATE8X8 interpolate8x8_halfpel_hv_mmx;
20    
21     INTERPOLATE8X8 interpolate8x8_halfpel_h_xmm;
22     INTERPOLATE8X8 interpolate8x8_halfpel_v_xmm;
23     INTERPOLATE8X8 interpolate8x8_halfpel_hv_xmm;
24    
25     INTERPOLATE8X8 interpolate8x8_halfpel_h_3dn;
26     INTERPOLATE8X8 interpolate8x8_halfpel_v_3dn;
27     INTERPOLATE8X8 interpolate8x8_halfpel_hv_3dn;
28    
29     static __inline void interpolate8x8_switch(uint8_t * const cur,
30     const uint8_t * const refn,
31     const uint32_t x, const uint32_t y,
32     const int32_t dx, const int dy,
33     const uint32_t stride,
34     const uint32_t rounding)
35     {
36     int32_t ddx, ddy;
37    
38     switch ( ((dx&1)<<1) + (dy&1) ) // ((dx%2)?2:0)+((dy%2)?1:0)
39     {
40     case 0 :
41     ddx = dx/2;
42     ddy = dy/2;
43     transfer8x8_copy(cur + y*stride + x, refn + (y+ddy)*stride + x + ddx, stride);
44     break;
45    
46     case 1 :
47     ddx = dx/2;
48     ddy = (dy-1)/2;
49     interpolate8x8_halfpel_v(cur + y*stride + x,
50     refn + (y+ddy)*stride + x + ddx, stride, rounding);
51     break;
52    
53     case 2 :
54     ddx = (dx-1)/2;
55     ddy = dy/2;
56     interpolate8x8_halfpel_h(cur + y*stride + x,
57     refn + (y+ddy)*stride + x + ddx, stride, rounding);
58     break;
59    
60     default :
61     ddx = (dx-1)/2;
62     ddy = (dy-1)/2;
63     interpolate8x8_halfpel_hv(cur + y*stride + x,
64     refn + (y+ddy)*stride + x + ddx, stride, rounding);
65     break;
66     }
67     }
68 chenm001 1.2
69    
70     void interpolate8x8_c(uint8_t * const dst,
71     const uint8_t * const src,
72     const uint32_t x, const uint32_t y,
73     const uint32_t stride);