1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
/*
* Copyright (C) 2012 Spreadtrum Communications Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _SPRD_SCALE_H_
#define _SPRD_SCALE_H_
enum scale_fmt_e {
SCALE_YUV422 = 0,
SCALE_YUV420,
SCALE_YUV400,
SCALE_YUV420_3FRAME,
SCALE_RGB565,
SCALE_RGB888,
SCALE_FTM_MAX
};
enum scale_data_endian_e {
SCALE_ENDIAN_BIG = 0,
SCALE_ENDIAN_LITTLE,
SCALE_ENDIAN_HALFBIG,
SCALE_ENDIAN_HALFLITTLE,
SCALE_ENDIAN_MAX
};
enum scale_mode_e {
SCALE_MODE_NORMAL = 0,
SCALE_MODE_SLICE,
SCALE_MODE_SLICE_READDR,
SCALE_MODE_MAX
};
enum scale_process_e {
SCALE_PROCESS_SUCCESS = 0,
SCALE_PROCESS_EXIT = -1,
SCALE_PROCESS_SYS_BUSY = -2,
SCALE_PROCESS_MAX = 0xFF
};
struct scale_size_t {
uint32_t w;
uint32_t h;
};
struct scale_rect_t {
uint32_t x;
uint32_t y;
uint32_t w;
uint32_t h;
};
struct scale_addr_t {
uint32_t yaddr;
uint32_t uaddr;
uint32_t vaddr;
};
struct scale_endian_sel_t {
uint8_t y_endian;
uint8_t uv_endian;
uint8_t reserved0;
uint8_t reserved1;
};
struct scale_slice_param_t {
uint32_t slice_height;
struct scale_rect_t input_rect;
struct scale_addr_t input_addr;
struct scale_addr_t output_addr;
};
struct scale_frame_param_t {
struct scale_size_t input_size;
struct scale_rect_t input_rect;
enum scale_fmt_e input_format;
struct scale_addr_t input_addr;
struct scale_endian_sel_t input_endian;
struct scale_size_t output_size;
enum scale_fmt_e output_format;
struct scale_addr_t output_addr;
struct scale_endian_sel_t output_endian;
enum scale_mode_e scale_mode;
uint32_t slice_height;
void *coeff_addr;
};
struct scale_frame_info_t {
uint32_t type;
uint32_t lock;
uint32_t flags;
uint32_t fid;
uint32_t width;
uint32_t height;
uint32_t height_uv;
uint32_t yaddr;
uint32_t uaddr;
uint32_t vaddr;
struct scale_endian_sel_t endian;
enum scale_process_e scale_result;
};
#define SCALE_IO_MAGIC 'S'
#define SCALE_IO_START _IOW(SCALE_IO_MAGIC, 0, struct scale_frame_param_t)
#define SCALE_IO_CONTINUE _IOW(SCALE_IO_MAGIC, 1, struct scale_slice_param_t)
#define SCALE_IO_DONE _IOW(SCALE_IO_MAGIC, 2, struct scale_slice_param_t)
#endif
|