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