Parent Directory | Revision Log
Revision 382 - (view) (download)
1 : | Isibaar | 3 | #ifndef _CODEC_H_ |
2 : | #define _CODEC_H_ | ||
3 : | |||
4 : | #include <windows.h> | ||
5 : | #include <vfw.h> | ||
6 : | #include "config.h" | ||
7 : | Isibaar | 382 | #include <xvid.h> |
8 : | Isibaar | 3 | |
9 : | h | 32 | #define DEBUG(X) |
10 : | // OutputDebugString(X) | ||
11 : | Foxer | 94 | #define DEBUG1(X,A) { char tmp[120]; wsprintf(tmp, "%s %i", (X), (A)); OutputDebugString(tmp); } |
12 : | Isibaar | 3 | #define DEBUG2(X,A,B) |
13 : | h | 30 | // { char tmp[120]; wsprintf(tmp, "%s %i %i", (X), (A), (B)); OutputDebugString(tmp); } |
14 : | Isibaar | 3 | #define DEBUG3(X,A,B,C) |
15 : | h | 30 | // { char tmp[120]; wsprintf(tmp, "%s %i %i %i", (X), (A), (B), (C)); OutputDebugString(tmp); } |
16 : | Isibaar | 3 | #define DEBUG4(X,A,B,C,D) |
17 : | h | 30 | // { char tmp[120]; wsprintf(tmp, "%s %i %i %i %i", (X), (A), (B), (C), (D)); OutputDebugString(tmp); } |
18 : | Isibaar | 3 | #define DEBUG5(X,A,B,C,D,E) |
19 : | h | 30 | // { char tmp[120]; wsprintf(tmp, "%s %i %i %i %i %i", (X), (A), (B), (C), (D), (E)); OutputDebugString(tmp); } |
20 : | Isibaar | 3 | #define DEBUGFOURCC(X,Y) |
21 : | h | 30 | // { char tmp[120]; wsprintf(tmp, "%s %c %c %c %c", (X), (Y)&0xff, ((Y)>>8)&0xff, ((Y)>>16)&0xff, ((Y)>>24)&0xff); OutputDebugString(tmp); } |
22 : | h | 61 | #define DEBUGERR(X) OutputDebugString(X) |
23 : | Isibaar | 3 | #define DEBUG2P(X) OutputDebugString(X) |
24 : | h | 30 | #define DEBUG1ST(A,B,C,D,E,F,G) { char tmp[120]; wsprintf(tmp, "1st-pass: size:%d total-kbytes:%d %s quant:%d %s kblocks:%d mblocks:%d", (A), (B), (C) ? "intra" : "inter", (D), (E), (F), (G)); OutputDebugString(tmp); } |
25 : | #define DEBUG2ND(A,B,C,D,E,F,G,H) { char tmp[120]; wsprintf(tmp, "2nd-pass: quant:%d %s %s stats1:%d scaled:%d actual:%d overflow:%d %s", (A), (B), (C) ? "intra" : "inter", (D), (E), (F), (G), (H) ? "credits" : "movie"); OutputDebugString(tmp); } | ||
26 : | Isibaar | 3 | |
27 : | |||
28 : | #define FOURCC_XVID mmioFOURCC('X','V','I','D') | ||
29 : | #define FOURCC_DIVX mmioFOURCC('D','I','V','X') | ||
30 : | h | 30 | #define FOURCC_DX50 mmioFOURCC('D','X','5','0') |
31 : | Isibaar | 3 | //#define FOURCC_DIV3 mmioFOURCC('D','I','V','3') |
32 : | //#define FOURCC_DIV4 mmioFOURCC('D','I','V','4') | ||
33 : | |||
34 : | /* yuyu 4:2:2 16bit, y-u-y-v, packed*/ | ||
35 : | #define FOURCC_YUYV mmioFOURCC('Y','U','Y','V') | ||
36 : | #define FOURCC_YUY2 mmioFOURCC('Y','U','Y','2') | ||
37 : | #define FOURCC_V422 mmioFOURCC('V','4','2','2') | ||
38 : | |||
39 : | /* yvyu 4:2:2 16bit, y-v-y-u, packed*/ | ||
40 : | #define FOURCC_YVYU mmioFOURCC('Y','V','Y','U') | ||
41 : | |||
42 : | /* uyvy 4:2:2 16bit, u-y-v-y, packed */ | ||
43 : | #define FOURCC_UYVY mmioFOURCC('U','Y','V','Y') | ||
44 : | |||
45 : | /* i420 y-u-v, planar */ | ||
46 : | #define FOURCC_I420 mmioFOURCC('I','4','2','0') | ||
47 : | #define FOURCC_IYUV mmioFOURCC('I','Y','U','V') | ||
48 : | |||
49 : | /* yv12 y-v-u, planar */ | ||
50 : | #define FOURCC_YV12 mmioFOURCC('Y','V','1','2') | ||
51 : | |||
52 : | |||
53 : | |||
54 : | #define XVID_NAME_L L"XVID" | ||
55 : | #define XVID_DESC_L L"XviD MPEG-4 Codec" | ||
56 : | |||
57 : | |||
58 : | #define NNSTATS_KEYFRAME (1<<31) | ||
59 : | |||
60 : | typedef struct | ||
61 : | { | ||
62 : | /* frame length (bytes) */ | ||
63 : | |||
64 : | DWORD bytes; | ||
65 : | |||
66 : | /* ignored & zero'd by gk | ||
67 : | xvid specific: dk_v = frame header bytes | ||
68 : | */ | ||
69 : | |||
70 : | int dk_v, dk_u, dk_y; | ||
71 : | int dd_v, dd_u, dd_y; | ||
72 : | int mk_u, mk_y; | ||
73 : | int md_u, md_y; | ||
74 : | |||
75 : | /* q used for this frame | ||
76 : | set bit 31 for keyframe */ | ||
77 : | |||
78 : | int quant; | ||
79 : | |||
80 : | /* key, motion, not-coded macroblocks */ | ||
81 : | |||
82 : | int kblk, mblk, ublk; | ||
83 : | |||
84 : | /* lum_noise is actually a double (as 8 bytes) | ||
85 : | for some reason msvc6.0 stores doubles as 12 bytes!? | ||
86 : | lum_noise is not used so it doesnt matter */ | ||
87 : | |||
88 : | float lum_noise[2]; | ||
89 : | } NNSTATS; | ||
90 : | |||
91 : | |||
92 : | typedef struct | ||
93 : | { | ||
94 : | h | 102 | HANDLE hints; |
95 : | h | 30 | HANDLE stats1; |
96 : | HANDLE stats2; | ||
97 : | Isibaar | 3 | |
98 : | h | 102 | void * hintstream; |
99 : | |||
100 : | Isibaar | 3 | int bytes1; |
101 : | int bytes2; | ||
102 : | int desired_bytes2; | ||
103 : | |||
104 : | Foxer | 342 | int keyframe_locations[20480]; |
105 : | h | 109 | int max_framesize; |
106 : | Foxer | 94 | double movie_curve; |
107 : | double credits_start_curve; | ||
108 : | double credits_end_curve; | ||
109 : | Isibaar | 3 | |
110 : | double average_frame; | ||
111 : | double curve_comp_scale; | ||
112 : | h | 61 | double curve_bias_bonus; |
113 : | double alt_curve_low; | ||
114 : | double alt_curve_high; | ||
115 : | double alt_curve_low_diff; | ||
116 : | double alt_curve_high_diff; | ||
117 : | double alt_curve_mid_qual; | ||
118 : | double alt_curve_qual_dev; | ||
119 : | Foxer | 342 | int overflow, KF_idx, KFoverflow, KFoverflow_partial; |
120 : | h | 105 | int quant_count[32]; |
121 : | Isibaar | 3 | |
122 : | NNSTATS nns1; | ||
123 : | NNSTATS nns2; | ||
124 : | } TWOPASS; | ||
125 : | |||
126 : | |||
127 : | typedef struct | ||
128 : | { | ||
129 : | // config | ||
130 : | CONFIG config; | ||
131 : | |||
132 : | // encore | ||
133 : | void * ehandle; | ||
134 : | int fincr; | ||
135 : | int fbase; | ||
136 : | int framenum; | ||
137 : | int keyspacing; | ||
138 : | |||
139 : | // encore 2pass | ||
140 : | TWOPASS twopass; | ||
141 : | |||
142 : | // decore | ||
143 : | void * dhandle; | ||
144 : | int dopt; // DEC_OPT_DECODE, DEC_OPT_DECODE_MS | ||
145 : | } CODEC; | ||
146 : | |||
147 : | |||
148 : | h | 30 | int get_colorspace(BITMAPINFOHEADER *); |
149 : | |||
150 : | Isibaar | 3 | LRESULT compress_query(CODEC *, BITMAPINFO *, BITMAPINFO *); |
151 : | LRESULT compress_get_format(CODEC *, BITMAPINFO *, BITMAPINFO *); | ||
152 : | LRESULT compress_get_size(CODEC *, BITMAPINFO *, BITMAPINFO *); | ||
153 : | LRESULT compress_frames_info(CODEC *, ICCOMPRESSFRAMES *); | ||
154 : | LRESULT compress_begin(CODEC *, BITMAPINFO *, BITMAPINFO *); | ||
155 : | LRESULT compress_end(CODEC *); | ||
156 : | LRESULT compress(CODEC *, ICCOMPRESS *); | ||
157 : | |||
158 : | LRESULT decompress_query(CODEC *, BITMAPINFO *, BITMAPINFO *); | ||
159 : | LRESULT decompress_get_format(CODEC *, BITMAPINFO *, BITMAPINFO *); | ||
160 : | LRESULT decompress_begin(CODEC *, BITMAPINFO *, BITMAPINFO *); | ||
161 : | LRESULT decompress_end(CODEC *); | ||
162 : | LRESULT decompress(CODEC *, ICDECOMPRESS *); | ||
163 : | |||
164 : | int codec_get_quant(CODEC *, XVID_ENC_FRAME *); | ||
165 : | int codec_is_in_credits(CONFIG *, int); | ||
166 : | Foxer | 362 | int codec_get_vbr_quant(CONFIG *, int); |
167 : | |||
168 : | // added by Koepi for greyscale credits | ||
169 : | chl | 361 | int check_greyscale_mode(CONFIG *, XVID_ENC_FRAME* , int); |
170 : | // end of koepi's additions | ||
171 : | Isibaar | 3 | |
172 : | #endif /* _CODEC_H_ */ |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |