]> git.sesse.net Git - x264/blob - vfw/x264vfw.h
VfW: expose option "Nth pass" (i.e. simultaneously read and update the multipass...
[x264] / vfw / x264vfw.h
1 #ifndef _X264_VFW_H
2 #define _X264_VFW_H
3
4 #include <stdlib.h>
5 #include <string.h>
6 #include <stdint.h>
7
8 #include <windows.h>
9 #include <vfw.h>
10
11 #include <x264.h>
12
13 #include "resource.h"
14
15 /* Name */
16 #define X264_NAME_L     L"x264"
17 #define X264_DESC_L     L"x264 - H264/AVC encoder"
18
19 /* Codec fcc */
20 #define FOURCC_X264 mmioFOURCC('X','2','6','4')
21
22 /* yuv 4:2:0 planar */
23 #define FOURCC_I420 mmioFOURCC('I','4','2','0')
24 #define FOURCC_IYUV mmioFOURCC('I','Y','U','V')
25 #define FOURCC_YV12 mmioFOURCC('Y','V','1','2')
26
27 /* yuv 4:2:2 packed */
28 #define FOURCC_YUY2 mmioFOURCC('Y','U','Y','2')
29 #define FOURCC_YUYV mmioFOURCC('Y','U','Y','V')
30
31 #define X264_WEBSITE    "http://videolan.org/x264.html"
32
33 /* CONFIG: vfw config
34  */
35 typedef struct
36 {
37     /********** ATTENTION **********/
38     int mode;                   /* Vidomi directly accesses these vars */
39     int bitrate;
40     int desired_size;           /* please try to avoid modifications here */
41     char stats[MAX_PATH];
42     /*******************************/
43     int i_2passbitrate;
44     int i_pass;
45
46     int b_fast1pass;    /* turns off some flags during 1st pass */    
47     int b_updatestats;  /* updates the statsfile during 2nd pass */
48
49     /* Our config */
50     int i_refmax;
51     int i_keyint_max;
52     int i_keyint_min;
53
54     int i_qp;
55     int b_filter;
56
57     int b_cabac;
58
59     int b_i4x4;
60     int b_psub16x16;
61     int b_psub8x8;
62     int b_bsub16x16;
63
64     int i_bframe;
65     int i_subpel_refine;
66     int i_direct_mv_pred;
67
68     int i_inloop_a;
69     int i_inloop_b;
70     
71     int i_key_boost;
72     int i_b_red;
73     int i_curve_comp;
74
75     /* vfw interface */
76     int b_save;
77     /* fourcc used */
78     char fcc[4+1];
79     int  i_encoding_type;
80 } CONFIG;
81
82 /* CODEC: vfw codec instance
83  */
84 typedef struct
85 {
86     CONFIG config;
87
88     /* handle */
89     x264_t *h;
90
91     /* XXX: needed ? */
92     unsigned int fincr;
93     unsigned int fbase;
94 } CODEC;
95
96 /* Compress functions */
97 LRESULT compress_query(CODEC *, BITMAPINFO *, BITMAPINFO *);
98 LRESULT compress_get_format(CODEC *, BITMAPINFO *, BITMAPINFO *);
99 LRESULT compress_get_size(CODEC *, BITMAPINFO *, BITMAPINFO *);
100 LRESULT compress_frames_info(CODEC *, ICCOMPRESSFRAMES *);
101 LRESULT compress_begin(CODEC *, BITMAPINFO *, BITMAPINFO *);
102 LRESULT compress_end(CODEC *);
103 LRESULT compress(CODEC *, ICCOMPRESS *);
104
105
106 /* config functions */
107 void config_reg_load( CONFIG * config );
108 void config_reg_save( CONFIG * config );
109
110
111 /* Dialog callbacks */
112 BOOL CALLBACK callback_about( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
113 BOOL CALLBACK callback_main ( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
114 BOOL CALLBACK callback_advanced( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
115
116 /* Dll instance */
117 extern HINSTANCE g_hInst;
118
119 #if defined(_DEBUG)
120 #include <stdio.h> /* vsprintf */
121 #define DPRINTF_BUF_SZ  1024
122 static __inline void DPRINTF(char *fmt, ...)
123 {
124     va_list args;
125     char buf[DPRINTF_BUF_SZ];
126
127     va_start(args, fmt);
128     vsprintf(buf, fmt, args);
129     OutputDebugString(buf);
130 }
131 #else
132 static __inline void DPRINTF(char *fmt, ...) { }
133 #endif
134
135
136 #endif
137