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