--- trunk/vfw/src/codec.h 2002/03/23 06:58:56 61 +++ branches/dev-api-3/vfw/src/codec.h 2002/11/19 13:23:17 660 @@ -6,24 +6,29 @@ #include "config.h" #include "xvid.h" +#if defined(_DEBUG) +#define DEBUG(X) OutputDebugString(X) +#define DEBUG1(X,A) { char tmp[120]; wsprintf(tmp, "%s %i", (X), (A)); OutputDebugString(tmp); } +#define DEBUG2(X,A,B) { char tmp[120]; wsprintf(tmp, "%s %i %i", (X), (A), (B)); OutputDebugString(tmp); } +#define DEBUG3(X,A,B,C) { char tmp[120]; wsprintf(tmp, "%s %i %i %i", (X), (A), (B), (C)); OutputDebugString(tmp); } +#define DEBUG4(X,A,B,C,D) { char tmp[120]; wsprintf(tmp, "%s %i %i %i %i", (X), (A), (B), (C), (D)); OutputDebugString(tmp); } +#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); } +#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); } +#else #define DEBUG(X) -// 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); } #define DEBUG2(X,A,B) -// { char tmp[120]; wsprintf(tmp, "%s %i %i", (X), (A), (B)); OutputDebugString(tmp); } #define DEBUG3(X,A,B,C) -// { char tmp[120]; wsprintf(tmp, "%s %i %i %i", (X), (A), (B), (C)); OutputDebugString(tmp); } #define DEBUG4(X,A,B,C,D) -// { char tmp[120]; wsprintf(tmp, "%s %i %i %i %i", (X), (A), (B), (C), (D)); OutputDebugString(tmp); } #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); } #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); } +#endif + + #define DEBUGERR(X) OutputDebugString(X) #define DEBUG2P(X) OutputDebugString(X) -#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 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 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); } +#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); } #define FOURCC_XVID mmioFOURCC('X','V','I','D') @@ -35,7 +40,6 @@ /* yuyu 4:2:2 16bit, y-u-y-v, packed*/ #define FOURCC_YUYV mmioFOURCC('Y','U','Y','V') #define FOURCC_YUY2 mmioFOURCC('Y','U','Y','2') -#define FOURCC_V422 mmioFOURCC('V','4','2','2') /* yvyu 4:2:2 16bit, y-v-y-u, packed*/ #define FOURCC_YVYU mmioFOURCC('Y','V','Y','U') @@ -57,6 +61,10 @@ #define NNSTATS_KEYFRAME (1<<31) +#define NNSTATS_BFRAME (1<<30) +#define NNSTATS_SKIPFRAME (1<<29) +#define NNSTATS_PADFRAME (1<<28) +#define NNSTATS_DELAYFRAME (1<<27) typedef struct { @@ -92,18 +100,25 @@ typedef struct { + HANDLE hints; HANDLE stats1; HANDLE stats2; + void * hintstream; + int bytes1; int bytes2; int desired_bytes2; - float movie_curve; - float credits_start_curve; - float credits_end_curve; + int keyframe_locations[20480]; + int max_framesize; + int minbsize, minpsize, minisize; + double movie_curve; + double credits_start_curve; + double credits_end_curve; - double average_frame; + double average_pframe; + double average_bframe; double curve_comp_scale; double curve_bias_bonus; double alt_curve_low; @@ -112,10 +127,17 @@ double alt_curve_high_diff; double alt_curve_mid_qual; double alt_curve_qual_dev; - int overflow; + int overflow, KF_idx, KFoverflow, KFoverflow_partial; + int quant_count[32]; NNSTATS nns1; NNSTATS nns2; + + NNSTATS* nns1_array; + NNSTATS* nns2_array; + int nns_array_size; + int nns_array_length; + int nns_array_pos; } TWOPASS; @@ -156,12 +178,12 @@ LRESULT decompress_end(CODEC *); LRESULT decompress(CODEC *, ICDECOMPRESS *); -int codec_2pass_init(CODEC *); 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 *); int codec_is_in_credits(CONFIG *, int); int codec_get_vbr_quant(CONFIG *, int); +// added by Koepi for greyscale credits +int check_greyscale_mode(CONFIG *, XVID_ENC_FRAME* , int); +// end of koepi's additions #endif /* _CODEC_H_ */ \ No newline at end of file