-
Notifications
You must be signed in to change notification settings - Fork 24
/
libjpegqs.h
61 lines (51 loc) · 1.3 KB
/
libjpegqs.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
/*
* Copyright (C) 2020-2023 Ilya Kurdyukov
*
* JPEG Quant Smooth API definitions
*/
#ifndef JPEGQS_H
#define JPEGQS_H
#ifdef __cplusplus
extern "C" {
#endif
enum {
JPEGQS_ITER_MAX = 100,
JPEGQS_DIAGONALS = 1,
JPEGQS_JOINT_YUV = 2,
JPEGQS_UPSAMPLE_UV = 4,
JPEGQS_LOW_QUALITY = 8,
JPEGQS_NO_REBALANCE = 16,
JPEGQS_NO_REBALANCE_UV = 32,
JPEGQS_TRANSCODE = 64,
JPEGQS_FLAGS_MASK = 0x7f,
JPEGQS_CPU_SHIFT = 12,
JPEGQS_CPU_MASK = 15,
JPEGQS_INFO_SHIFT = 16,
JPEGQS_INFO_COMP1 = 1 << JPEGQS_INFO_SHIFT,
JPEGQS_INFO_QUANT = 2 << JPEGQS_INFO_SHIFT,
JPEGQS_INFO_COMP2 = 4 << JPEGQS_INFO_SHIFT,
JPEGQS_INFO_TIME = 8 << JPEGQS_INFO_SHIFT,
JPEGQS_INFO_CPU = 16 << JPEGQS_INFO_SHIFT
};
#ifndef JPEGQS_ATTR
#define JPEGQS_ATTR
#endif
#define JPEGQS_VERSION "1.20230818"
#define JPEGQS_COPYRIGHT "Copyright (C) 2020-2023 Ilya Kurdyukov"
typedef struct {
int flags, niter, threads, progprec;
void *userdata;
int (*progress)(void *data, int cur, int max);
} jpegqs_control_t;
JPEGQS_ATTR
int do_quantsmooth(j_decompress_ptr srcinfo, jvirt_barray_ptr *coef_arrays, jpegqs_control_t *opts);
#ifndef TRANSCODE_ONLY
JPEGQS_ATTR
boolean jpegqs_start_decompress(j_decompress_ptr cinfo, jpegqs_control_t *opts);
JPEGQS_ATTR
boolean jpegqs_finish_decompress(j_decompress_ptr cinfo);
#endif
#ifdef __cplusplus
}
#endif
#endif