]> git.sesse.net Git - x264/blob - common/pixel.h
rename 'core/' to 'common/', which avoids conflicts with libtool
[x264] / common / pixel.h
1 /*****************************************************************************
2  * pixel.h: h264 encoder library
3  *****************************************************************************
4  * Copyright (C) 2003 Laurent Aimar
5  * $Id: pixel.h,v 1.1 2004/06/03 19:27:07 fenrir Exp $
6  *
7  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 #ifndef _PIXEL_H
25 #define _PIXEL_H 1
26
27 typedef int  (*x264_pixel_sad_t) ( uint8_t *, int, uint8_t *, int );
28 typedef int  (*x264_pixel_satd_t)( uint8_t *, int, uint8_t *, int );
29 typedef void (*x264_pixel_avg_t) ( uint8_t *, int, uint8_t *, int );
30
31 enum
32 {
33     PIXEL_16x16 = 0,
34     PIXEL_16x8  = 1,
35     PIXEL_8x16  = 2,
36     PIXEL_8x8   = 3,
37     PIXEL_8x4   = 4,
38     PIXEL_4x8   = 5,
39     PIXEL_4x4   = 6,
40 };
41
42 static const struct {
43     int w;
44     int h;
45 } x264_pixel_size[7] = {
46     { 16, 16 },
47     { 16,  8 }, {  8, 16 },
48     {  8,  8 },
49     {  8,  4 }, {  4,  8 },
50     {  4,  4 }
51 };
52
53 typedef struct
54 {
55     x264_pixel_sad_t  sad[7];
56     x264_pixel_satd_t satd[7];
57     x264_pixel_avg_t  avg[7];
58 } x264_pixel_function_t;
59
60 void x264_pixel_init( int cpu, x264_pixel_function_t *pixf );
61
62 #endif