6 |
#include "config.h" |
#include "config.h" |
7 |
#include "xvid.h" |
#include "xvid.h" |
8 |
|
|
9 |
|
#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 |
#define DEBUG(X) |
#define DEBUG(X) |
19 |
// OutputDebugString(X) |
#define DEBUG1(X,A) { char tmp[120]; wsprintf(tmp, "%s %i", (X), (A)); OutputDebugString(tmp); } |
|
#define DEBUG1(X,A) |
|
|
// { char tmp[120]; wsprintf(tmp, "%s %i", (X), (A)); OutputDebugString(tmp); } |
|
20 |
#define DEBUG2(X,A,B) |
#define DEBUG2(X,A,B) |
|
// { char tmp[120]; wsprintf(tmp, "%s %i %i", (X), (A), (B)); OutputDebugString(tmp); } |
|
21 |
#define DEBUG3(X,A,B,C) |
#define DEBUG3(X,A,B,C) |
|
// { char tmp[120]; wsprintf(tmp, "%s %i %i %i", (X), (A), (B), (C)); OutputDebugString(tmp); } |
|
22 |
#define DEBUG4(X,A,B,C,D) |
#define DEBUG4(X,A,B,C,D) |
|
// { char tmp[120]; wsprintf(tmp, "%s %i %i %i %i", (X), (A), (B), (C), (D)); OutputDebugString(tmp); } |
|
23 |
#define DEBUG5(X,A,B,C,D,E) |
#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); } |
|
24 |
#define DEBUGFOURCC(X,Y) |
#define DEBUGFOURCC(X,Y) |
25 |
// { char tmp[120]; wsprintf(tmp, "%s %c %c %c %c", (X), (Y)&0xff, ((Y)>>8)&0xff, ((Y)>>16)&0xff, ((Y)>>24)&0xff); OutputDebugString(tmp); } |
#endif |
26 |
|
|
27 |
|
|
28 |
|
#define DEBUGERR(X) OutputDebugString(X) |
29 |
#define DEBUG2P(X) OutputDebugString(X) |
#define DEBUG2P(X) OutputDebugString(X) |
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); } |
#define DEBUG1ST(A,B,C,D,E,F,G) { char tmp[140]; wsprintf(tmp, "1st-pass: size:%d total-kbytes:%d %s quant:%d %s kblocks:%d mblocks:%d", (A), (B), (C), (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); } |
#define DEBUG2ND(A,B,C,D,E,F,G,H) { char tmp[140]; wsprintf(tmp, "2nd-pass: quant:%d %s %s stats1:%d scaled:%d actual:%d overflow:%d %s", (A), (B), (C), (D), (E), (F), (G), (H) ? "credits" : "movie"); OutputDebugString(tmp); } |
32 |
|
|
33 |
|
|
34 |
#define FOURCC_XVID mmioFOURCC('X','V','I','D') |
#define FOURCC_XVID mmioFOURCC('X','V','I','D') |
40 |
/* yuyu 4:2:2 16bit, y-u-y-v, packed*/ |
/* yuyu 4:2:2 16bit, y-u-y-v, packed*/ |
41 |
#define FOURCC_YUYV mmioFOURCC('Y','U','Y','V') |
#define FOURCC_YUYV mmioFOURCC('Y','U','Y','V') |
42 |
#define FOURCC_YUY2 mmioFOURCC('Y','U','Y','2') |
#define FOURCC_YUY2 mmioFOURCC('Y','U','Y','2') |
|
#define FOURCC_V422 mmioFOURCC('V','4','2','2') |
|
43 |
|
|
44 |
/* yvyu 4:2:2 16bit, y-v-y-u, packed*/ |
/* yvyu 4:2:2 16bit, y-v-y-u, packed*/ |
45 |
#define FOURCC_YVYU mmioFOURCC('Y','V','Y','U') |
#define FOURCC_YVYU mmioFOURCC('Y','V','Y','U') |
61 |
|
|
62 |
|
|
63 |
#define NNSTATS_KEYFRAME (1<<31) |
#define NNSTATS_KEYFRAME (1<<31) |
64 |
|
#define NNSTATS_BFRAME (1<<30) |
65 |
|
#define NNSTATS_SKIPFRAME (1<<29) |
66 |
|
#define NNSTATS_PADFRAME (1<<28) |
67 |
|
#define NNSTATS_DELAYFRAME (1<<27) |
68 |
|
|
69 |
typedef struct |
typedef struct |
70 |
{ |
{ |
100 |
|
|
101 |
typedef struct |
typedef struct |
102 |
{ |
{ |
103 |
|
HANDLE hints; |
104 |
HANDLE stats1; |
HANDLE stats1; |
105 |
HANDLE stats2; |
HANDLE stats2; |
106 |
|
|
107 |
|
void * hintstream; |
108 |
|
|
109 |
int bytes1; |
int bytes1; |
110 |
int bytes2; |
int bytes2; |
111 |
int desired_bytes2; |
int desired_bytes2; |
112 |
|
|
113 |
float movie_curve; |
int keyframe_locations[20480]; |
114 |
float credits_start_curve; |
int max_framesize; |
115 |
float credits_end_curve; |
int minbsize, minpsize, minisize; |
116 |
|
double movie_curve; |
117 |
|
double credits_start_curve; |
118 |
|
double credits_end_curve; |
119 |
|
|
120 |
double average_frame; |
double average_pframe; |
121 |
|
double average_bframe; |
122 |
double curve_comp_scale; |
double curve_comp_scale; |
123 |
int overflow; |
double curve_bias_bonus; |
124 |
|
double alt_curve_low; |
125 |
|
double alt_curve_high; |
126 |
|
double alt_curve_low_diff; |
127 |
|
double alt_curve_high_diff; |
128 |
|
double alt_curve_mid_qual; |
129 |
|
double alt_curve_qual_dev; |
130 |
|
int overflow, KF_idx, KFoverflow, KFoverflow_partial; |
131 |
|
int quant_count[32]; |
132 |
|
|
133 |
NNSTATS nns1; |
NNSTATS nns1; |
134 |
NNSTATS nns2; |
NNSTATS nns2; |
135 |
|
|
136 |
|
NNSTATS* nns1_array; |
137 |
|
NNSTATS* nns2_array; |
138 |
|
int nns_array_size; |
139 |
|
int nns_array_length; |
140 |
|
int nns_array_pos; |
141 |
} TWOPASS; |
} TWOPASS; |
142 |
|
|
143 |
|
|
178 |
LRESULT decompress_end(CODEC *); |
LRESULT decompress_end(CODEC *); |
179 |
LRESULT decompress(CODEC *, ICDECOMPRESS *); |
LRESULT decompress(CODEC *, ICDECOMPRESS *); |
180 |
|
|
|
int codec_2pass_init(CODEC *); |
|
181 |
int codec_get_quant(CODEC *, XVID_ENC_FRAME *); |
int codec_get_quant(CODEC *, XVID_ENC_FRAME *); |
|
int codec_2pass_get_quant(CODEC *, XVID_ENC_FRAME *); |
|
|
int codec_2pass_update(CODEC *, XVID_ENC_FRAME *, XVID_ENC_STATS *); |
|
182 |
int codec_is_in_credits(CONFIG *, int); |
int codec_is_in_credits(CONFIG *, int); |
183 |
int codec_get_vbr_quant(CONFIG *, int); |
int codec_get_vbr_quant(CONFIG *, int); |
184 |
|
|
185 |
|
// added by Koepi for greyscale credits |
186 |
|
int check_greyscale_mode(CONFIG *, XVID_ENC_FRAME* , int); |
187 |
|
// end of koepi's additions |
188 |
|
|
189 |
#endif /* _CODEC_H_ */ |
#endif /* _CODEC_H_ */ |