]> git.sesse.net Git - x264/blob - common/x86/pixel.h
Update file headers throughout x264
[x264] / common / x86 / pixel.h
1 /*****************************************************************************
2  * pixel.h: h264 encoder library
3  *****************************************************************************
4  * Copyright (C) 2003-2008 x264 project
5  *
6  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
7  *          Loren Merritt <lorenm@u.washington.edu>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 #ifndef X264_I386_PIXEL_H
25 #define X264_I386_PIXEL_H
26
27 #define DECL_PIXELS( ret, name, suffix, args ) \
28     ret x264_pixel_##name##_16x16_##suffix args;\
29     ret x264_pixel_##name##_16x8_##suffix args;\
30     ret x264_pixel_##name##_8x16_##suffix args;\
31     ret x264_pixel_##name##_8x8_##suffix args;\
32     ret x264_pixel_##name##_8x4_##suffix args;\
33     ret x264_pixel_##name##_4x8_##suffix args;\
34     ret x264_pixel_##name##_4x4_##suffix args;\
35
36 #define DECL_X1( name, suffix ) \
37     DECL_PIXELS( int, name, suffix, ( uint8_t *, int, uint8_t *, int ) )
38
39 #define DECL_X4( name, suffix ) \
40     DECL_PIXELS( void, name##_x3, suffix, ( uint8_t *, uint8_t *, uint8_t *, uint8_t *, int, int * ) )\
41     DECL_PIXELS( void, name##_x4, suffix, ( uint8_t *, uint8_t *, uint8_t *, uint8_t *, uint8_t *, int, int * ) )
42
43 DECL_X1( sad, mmxext )
44 DECL_X1( sad, sse2 )
45 DECL_X1( sad, sse3 )
46 DECL_X4( sad, mmxext )
47 DECL_X4( sad, sse2 )
48 DECL_X4( sad, sse3 )
49 DECL_X1( ssd, mmx )
50 DECL_X1( ssd, sse2 )
51 DECL_X1( satd, mmxext )
52 DECL_X1( satd, sse2 )
53 DECL_X1( satd, ssse3 )
54 DECL_X1( satd, ssse3_phadd )
55 DECL_X1( sa8d, mmxext )
56 DECL_X1( sa8d, sse2 )
57 DECL_X1( sa8d, ssse3 )
58 DECL_X1( sad, cache32_mmxext );
59 DECL_X1( sad, cache64_mmxext );
60 DECL_X1( sad, cache64_sse2 );
61 DECL_X1( sad, cache64_ssse3 );
62 DECL_X4( sad, cache32_mmxext );
63 DECL_X4( sad, cache64_mmxext );
64 DECL_X4( sad, cache64_sse2 );
65 DECL_X4( sad, cache64_ssse3 );
66
67 #undef DECL_PIXELS
68 #undef DECL_X1
69 #undef DECL_X4
70
71 void x264_intra_satd_x3_4x4_mmxext( uint8_t *, uint8_t *, int * );
72 void x264_intra_satd_x3_4x4_ssse3( uint8_t *, uint8_t *, int * );
73 void x264_intra_satd_x3_8x8c_mmxext( uint8_t *, uint8_t *, int * );
74 void x264_intra_satd_x3_8x8c_ssse3( uint8_t *, uint8_t *, int * );
75 void x264_intra_satd_x3_16x16_mmxext( uint8_t *, uint8_t *, int * );
76 void x264_intra_satd_x3_16x16_ssse3( uint8_t *, uint8_t *, int * );
77 void x264_intra_sa8d_x3_8x8_mmxext( uint8_t *, uint8_t *, int * );
78 void x264_intra_sa8d_x3_8x8_sse2( uint8_t *, uint8_t *, int * );
79 void x264_intra_sa8d_x3_8x8_ssse3( uint8_t *, uint8_t *, int * );
80 void x264_intra_sa8d_x3_8x8_core_mmxext( uint8_t *, int16_t [2][8], int * );
81 void x264_intra_sa8d_x3_8x8_core_sse2( uint8_t *, int16_t [2][8], int * );
82 void x264_intra_sa8d_x3_8x8_core_ssse3( uint8_t *, int16_t [2][8], int * );
83
84 void x264_pixel_ssim_4x4x2_core_mmxext( const uint8_t *pix1, int stride1,
85                                         const uint8_t *pix2, int stride2, int sums[2][4] );
86 void x264_pixel_ssim_4x4x2_core_sse2( const uint8_t *pix1, int stride1,
87                                       const uint8_t *pix2, int stride2, int sums[2][4] );
88 float x264_pixel_ssim_end4_sse2( int sum0[5][4], int sum1[5][4], int width );
89
90 #define DECL_ADS( size, suffix ) \
91 int x264_pixel_ads##size##_##suffix( int enc_dc[size], uint16_t *sums, int delta,\
92                                      uint16_t *cost_mvx, int16_t *mvs, int width, int thresh );
93 DECL_ADS( 4, mmxext )
94 DECL_ADS( 2, mmxext )
95 DECL_ADS( 1, mmxext )
96 DECL_ADS( 4, sse2 )
97 DECL_ADS( 2, sse2 )
98 DECL_ADS( 1, sse2 )
99 DECL_ADS( 4, ssse3 )
100 DECL_ADS( 2, ssse3 )
101 DECL_ADS( 1, ssse3 )
102 #undef DECL_ADS
103
104 #endif