-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathencoder_type.h
191 lines (155 loc) · 4.55 KB
/
encoder_type.h
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#ifndef __H264__ENCODE__LIB__TYPE__H__
#define __H264__ENCODE__LIB__TYPE__H__
#include <linux/types.h>
typedef void * __hdle;
#define ByteIOContext FILE
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define esFSYS_fopen fopen
#define esFSYS_fclose fclose
#define esFSYS_fseek fseek
#define esFSYS_fread fread
#define esFSYS_fwrite fwrite
#define esFSYS_ftell ftell
#define esMEMS_Pfree(a, b) free(a)
#define esMEMS_Palloc(a, b) malloc(a*1024)
#define ctm_fwrite fwrite
#define MALLOC malloc
#define FREE free
#define MEMCPY memcpy
#define MEMSET memset
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define CLIP3(low,high,x) MIN( MAX(low,x), high )
#define FLOOR(x) ((x) >= 0 ? (int)(x) : (int)((x)-1))
#define ABS(x) ((x) >= 0 ? (x) : -(x))
typedef struct SIZE_t
{
int src_width;
int src_height;
int width;
int height;
}SIZE;
typedef struct VIDEO_ENCODE_FORMAT
{
unsigned int codec_type;
int width;
int height;
unsigned int frame_rate;
int color_format;
int color_space;
int qp_max; // 40
int qp_min; // 20
int avg_bit_rate; // average bit rate
// int max_bit_rate; // maximum bit rate
int maxKeyInterval;
//define private information for video decode
// unsigned int video_bs_src; // video bitstream source
// void *private_inf; // video bitstream private information pointer
// int priv_inf_len; // video bitstream private information length
// star add
unsigned char profileIdc;
unsigned char levelIdc;
unsigned int src_width;
unsigned int src_height;
int scale_factor;
double focal_length;
unsigned int quality; // for jpeg encoder
unsigned int orientation; // for jpeg encoder
// gps exif
unsigned char enable_gps;
double gps_latitude; //input
double gps_longitude; //input
long gps_altitude;
long gps_timestamp;
char gps_processing_method[100];
int whitebalance;
unsigned int thumb_width;
unsigned int thumb_height;
unsigned int ratioThreahold;
unsigned char CameraMake[64];//for the cameraMake name
unsigned char CameraModel[64];//for the cameraMode
unsigned char DateTime[21];//for the data and time
unsigned char picEncmode; //0 for frame encoding 1: for field encoding 2:field used for frame encoding
} __video_encode_format_t;
typedef struct crop_para
{
unsigned char crop_img_enable; //for enable the crop image
unsigned int start_x; //for crop image start position
unsigned int start_y; //for crop image start position
unsigned int crop_pic_width; //for crop image size of width
unsigned int crop_pic_height; //for crop image size of height
}__video_crop_crop_para_t;
typedef struct crop_enc_para
{
unsigned char crop_img_enable;
unsigned int start_crop_mb_x;
unsigned int start_crop_mb_y;
unsigned int crop_pic_width_mb;
unsigned int crop_pic_height_mb;
}crop_enc_para_t;
typedef struct enc_extradata_t //don't touch it, because it also defined in type_camera.h
{
char *data;
int length;
}enc_extradata_t;
typedef enum
{
BT601 = 0,
BT709,
YCC,
VXYCC
}__cs_mode_t;
typedef enum __PIXEL_YUVFMT /* pixel format(yuv) */
{
PIXEL_YUV444 = 0x10, /* only used in scaler framebuffer */
PIXEL_YUV422,
PIXEL_YUV420,
PIXEL_YUV411,
PIXEL_CSIRGB,
PIXEL_OTHERFMT,
PIXEL_YVU420,
PIXEL_YVU422,
PIXEL_TILE_32X32,
PIXEL_CSIARGB,
PIXEL_CSIRGBA,
PIXEL_CSIABGR,
PIXEL_CSIBGRA
}__pixel_yuvfmt_t;
typedef enum
{
M_ENCODE = 0,
M_ISP_THUMB,
M_ENCODE_ISP_THUMB,
M_UNSUPPORT,
} __venc_output_mod_t;
typedef enum __COLOR_SPACE
{
COLOR_SPACE_BT601,
COLOR_SPACE_BT709,
COLOR_SPACE_,
}__color_space_t;
typedef struct _media_file_inf_t
{
// video
int nHeight;
int nWidth;
int uVideoFrmRate;
int create_time;
int maxKeyInterval;
// audio
int channels;
int bits_per_sample;
int frame_size;
int sample_rate;
int audio_encode_type;
int geo_available;
int latitudex10000;
int longitudex10000;
int rotate_degree;
}_media_file_inf_t;
#endif // __H264__ENCODE__LIB__TYPE__H__