[svn] / trunk / vfw / src / codec.h Repository:
ViewVC logotype

Annotation of /trunk/vfw/src/codec.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32 - (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 : 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 30 HANDLE stats1;
95 :     HANDLE stats2;
96 : Isibaar 3
97 :     int bytes1;
98 :     int bytes2;
99 :     int desired_bytes2;
100 :    
101 :     float movie_curve;
102 :     float credits_start_curve;
103 :     float credits_end_curve;
104 :    
105 :     double average_frame;
106 :     double curve_comp_scale;
107 :     int overflow;
108 :    
109 :     NNSTATS nns1;
110 :     NNSTATS nns2;
111 :     } TWOPASS;
112 :    
113 :    
114 :     typedef struct
115 :     {
116 :     // config
117 :     CONFIG config;
118 :    
119 :     // encore
120 :     void * ehandle;
121 :     int fincr;
122 :     int fbase;
123 :     int framenum;
124 :     int keyspacing;
125 :    
126 :     // encore 2pass
127 :     TWOPASS twopass;
128 :    
129 :     // decore
130 :     void * dhandle;
131 :     int dopt; // DEC_OPT_DECODE, DEC_OPT_DECODE_MS
132 :     } CODEC;
133 :    
134 :    
135 : h 30 int get_colorspace(BITMAPINFOHEADER *);
136 :    
137 : Isibaar 3 LRESULT compress_query(CODEC *, BITMAPINFO *, BITMAPINFO *);
138 :     LRESULT compress_get_format(CODEC *, BITMAPINFO *, BITMAPINFO *);
139 :     LRESULT compress_get_size(CODEC *, BITMAPINFO *, BITMAPINFO *);
140 :     LRESULT compress_frames_info(CODEC *, ICCOMPRESSFRAMES *);
141 :     LRESULT compress_begin(CODEC *, BITMAPINFO *, BITMAPINFO *);
142 :     LRESULT compress_end(CODEC *);
143 :     LRESULT compress(CODEC *, ICCOMPRESS *);
144 :    
145 :     LRESULT decompress_query(CODEC *, BITMAPINFO *, BITMAPINFO *);
146 :     LRESULT decompress_get_format(CODEC *, BITMAPINFO *, BITMAPINFO *);
147 :     LRESULT decompress_begin(CODEC *, BITMAPINFO *, BITMAPINFO *);
148 :     LRESULT decompress_end(CODEC *);
149 :     LRESULT decompress(CODEC *, ICDECOMPRESS *);
150 :    
151 :     int codec_2pass_init(CODEC *);
152 :     int codec_get_quant(CODEC *, XVID_ENC_FRAME *);
153 :     int codec_2pass_get_quant(CODEC *, XVID_ENC_FRAME *);
154 :     int codec_2pass_update(CODEC *, XVID_ENC_FRAME *, XVID_ENC_STATS *);
155 :     int codec_is_in_credits(CONFIG *, int);
156 :     int codec_get_vbr_quant(CONFIG *, int);
157 :    
158 :    
159 :     #endif /* _CODEC_H_ */

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4