1 /*****************************************************************************
2 * pixel.h: h264 encoder library
3 *****************************************************************************
4 * Copyright (C) 2003-2008 x264 project
6 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
7 * Loren Merritt <lorenm@u.washington.edu>
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.
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.
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 *****************************************************************************/
24 #ifndef X264_I386_PIXEL_H
25 #define X264_I386_PIXEL_H
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;\
36 #define DECL_X1( name, suffix ) \
37 DECL_PIXELS( int, name, suffix, ( uint8_t *, int, uint8_t *, int ) )
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 * ) )
43 DECL_X1( sad, mmxext )
46 DECL_X4( sad, mmxext )
51 DECL_X1( satd, mmxext )
53 DECL_X1( satd, ssse3 )
54 DECL_X1( satd, ssse3_phadd )
55 DECL_X1( sa8d, mmxext )
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 );
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 * );
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 );
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 );