Merge "Detect toolchain based on gcc -dumpmachine"
[profile/ivi/libvpx.git] / vp8 / common / vpxblit.h
1 /*
2  *  Copyright (c) 2010 The VP8 project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license 
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may 
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10
11
12 #ifndef VPXBLIT_H_INCL
13 #define VPXBLIT_H_INCL
14 /*==============================================================================
15                               Includes
16 ==============================================================================*/
17
18 /*==============================================================================
19                               Defines
20 ==============================================================================*/
21
22
23 #ifdef VPX_BIG_ENDIAN
24 #define BYTE_ZERO(X)    ((X & 0xFF000000) >> (24 - 2)   )
25 #define BYTE_ONE(X)     ((X & 0x00FF0000) >> (16 - 2)   )
26 #define BYTE_TWO(X)     ((X & 0x0000FF00) >> (8 - 2)    )
27 #define BYTE_THREE(X)   ((X & 0x000000FF) << (0 + 2)    )
28
29 #define BYTE_ZERO_UV(X) ((X & 0x0000FF00) >> (8 - 2)    )
30 #define BYTE_ONE_UV(X)  ((X & 0x000000FF) << (0 + 2)    )
31
32 #define REREFERENCE(X) (*((int *) &(X)))
33
34 #else
35
36 #define BYTE_THREE(X)   ((X & 0xFF000000) >> (24 - 2)   )
37 #define BYTE_TWO(X)     ((X & 0x00FF0000) >> (16 - 2)   )
38 #define BYTE_ONE(X)     ((X & 0x0000FF00) >> (8 - 2)    )
39 #define BYTE_ZERO(X)    ((X & 0x000000FF) << (0 + 2)    )
40
41 #define BYTE_ONE_UV(X) ((X & 0x0000FF00) >> (8 - 2) )
42 #define BYTE_ZERO_UV(X)     ((X & 0x000000FF) << (0 + 2)    )
43
44 #define REREFERENCE(X) (*((int *) &(X)))
45
46 #endif
47
48
49 /*==============================================================================
50                             Type Definitions
51 ==============================================================================*/
52 typedef struct  // YUV buffer configuration structure
53 {
54     int   y_width;
55     int   y_height;
56     int   y_stride;
57
58     int   uv_width;
59     int   uv_height;
60     int   uv_stride;
61
62     char *y_buffer;
63     char *u_buffer;
64     char *v_buffer;
65
66     char *uv_start;
67     int   uv_dst_area;
68     int   uv_used_area;
69
70 } VPX_BLIT_CONFIG;
71
72 typedef struct tx86_params
73 {
74     unsigned int pushed_registers[6];
75     unsigned int return_address;
76     unsigned int dst;
77     unsigned int scrn_pitch;
78     VPX_BLIT_CONFIG *buff_config;
79 } x86_params;
80
81 /*=============================================================================
82                                 Enums
83 ==============================================================================*/
84
85
86 /*==============================================================================
87                               Structures
88 ==============================================================================*/
89
90 /*==============================================================================
91                              Constants
92 ==============================================================================*/
93
94
95 /*==============================================================================
96                                Variables
97 ==============================================================================*/
98
99
100
101
102 /*==============================================================================
103                             Function Protoypes/MICROS
104 ==============================================================================*/
105 int vpx_get_size_of_pixel(unsigned int bd);
106 void *vpx_get_blitter(unsigned int bd);
107 void vpx_set_blit(void);
108 void vpx_destroy_blit(void);
109
110
111
112 #endif //VPXBLIT_H_INCL