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
|
/* linux/drivers/media/video/samsung/jpeg_v2/jpg_opr.h
*
* Copyright (c) 2010 Samsung Electronics Co., Ltd.
* http://www.samsung.com/
*
* Definition for Operation of Jpeg encoder/docoder
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __JPG_OPR_H__
#define __JPG_OPR_H__
#include <linux/interrupt.h>
extern void __iomem *s3c_jpeg_base;
extern int jpg_irq_reason;
/* debug macro */
#define JPG_DEBUG(fmt, ...) \
do { \
printk(KERN_DEBUG \
"%s: " fmt, __func__, ##__VA_ARGS__); \
} while (0)
#define JPG_WARN(fmt, ...) \
do { \
printk(KERN_WARNING \
fmt, ##__VA_ARGS__); \
} while (0)
#define JPG_ERROR(fmt, ...) \
do { \
printk(KERN_ERR \
"%s: " fmt, __func__, ##__VA_ARGS__); \
} while (0)
#ifdef CONFIG_VIDEO_JPEG_DEBUG
#define jpg_dbg(fmt, ...) JPG_DEBUG(fmt, ##__VA_ARGS__)
#else
#define jpg_dbg(fmt, ...)
#endif
#define jpg_warn(fmt, ...) JPG_WARN(fmt, ##__VA_ARGS__)
#define jpg_err(fmt, ...) JPG_ERROR(fmt, ##__VA_ARGS__)
extern wait_queue_head_t wait_queue_jpeg;
enum jpg_return_status {
JPG_FAIL,
JPG_SUCCESS,
OK_HD_PARSING,
ERR_HD_PARSING,
OK_ENC_OR_DEC,
ERR_ENC_OR_DEC,
ERR_UNKNOWN
};
enum image_type {
JPG_RGB16,
JPG_YCBYCR,
JPG_TYPE_UNKNOWN
};
enum sample_mode {
JPG_444,
JPG_422,
JPG_420,
JPG_400,
RESERVED1,
RESERVED2,
JPG_411,
JPG_SAMPLE_UNKNOWN
};
enum out_mode {
YCBCR_422,
YCBCR_420,
YCBCR_SAMPLE_UNKNOWN
};
enum in_mode {
JPG_MODESEL_YCBCR = 1,
JPG_MODESEL_RGB,
JPG_MODESEL_UNKNOWN
};
enum encode_type {
JPG_MAIN,
JPG_THUMBNAIL
};
enum image_quality_type {
JPG_QUALITY_LEVEL_1 = 0, /*high quality*/
JPG_QUALITY_LEVEL_2,
JPG_QUALITY_LEVEL_3,
JPG_QUALITY_LEVEL_4 /*low quality*/
};
struct jpg_dec_proc_param {
enum sample_mode sample_mode;
enum encode_type dec_type;
enum out_mode out_format;
unsigned int width;
unsigned int height;
unsigned int data_size;
unsigned int file_size;
};
struct jpg_enc_proc_param {
enum sample_mode sample_mode;
enum encode_type enc_type;
enum in_mode in_format;
enum image_quality_type quality;
unsigned int width;
unsigned int height;
unsigned int data_size;
unsigned int file_size;
};
struct jpg_args {
char *in_buf;
char *phy_in_buf;
int in_buf_size;
char *out_buf;
char *phy_out_buf;
int out_buf_size;
char *in_thumb_buf;
char *phy_in_thumb_buf;
int in_thumb_buf_size;
char *out_thumb_buf;
char *phy_out_thumb_buf;
int out_thumb_buf_size;
char *mapped_addr;
struct jpg_dec_proc_param *dec_param;
struct jpg_enc_proc_param *enc_param;
struct jpg_enc_proc_param *thumb_enc_param;
};
void reset_jpg(struct s5pc110_jpg_ctx *jpg_ctx);
enum jpg_return_status decode_jpg(struct s5pc110_jpg_ctx *jpg_ctx, \
struct jpg_dec_proc_param *dec_param);
enum jpg_return_status encode_jpg(struct s5pc110_jpg_ctx *jpg_ctx, \
struct jpg_enc_proc_param *enc_param);
enum jpg_return_status wait_for_interrupt(void);
enum sample_mode get_sample_type(struct s5pc110_jpg_ctx *jpg_ctx);
void get_xy(struct s5pc110_jpg_ctx *jpg_ctx, unsigned int *x, unsigned int *y);
unsigned int get_yuv_size(enum out_mode out_format, \
unsigned int width, unsigned int height);
#endif
|