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