]> git.sesse.net Git - x264/blob - vfw/x264vfw.h
* encoder/ratecontrol.c: OS X support for exp2f and sqrtf.
[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     int i_frame_total;
50
51     /* Our config */
52     int i_refmax;
53     int i_keyint_max;
54     int i_keyint_min;
55     int i_scenecut_threshold;
56     int i_qp_min;
57     int i_qp_max;
58     int i_qp_step;
59
60     int i_qp;
61     int b_filter;
62
63     int b_cabac;
64
65     int b_i8x8;
66     int b_i4x4;
67     int b_psub16x16;
68     int b_psub8x8;
69     int b_bsub16x16;
70     int b_dct8x8;
71     int b_mixedref;
72
73     int i_bframe;
74     int i_subpel_refine;
75     int i_me_method;
76     int i_me_range;
77     int b_chroma_me;
78     int i_direct_mv_pred;
79     int i_threads;
80
81     int i_inloop_a;
82     int i_inloop_b;
83
84     int b_b_refs;
85     int b_b_wpred;
86     int i_bframe_bias;
87     int b_bframe_adaptive;
88
89     int i_key_boost;
90     int i_b_red;
91     int i_curve_comp;
92
93     int i_sar_width;
94     int i_sar_height;
95
96     int i_log_level;
97
98     /* vfw interface */
99     int b_save;
100     /* fourcc used */
101     char fcc[4+1];
102     int i_encoding_type;
103     int i_trellis;
104     int b_bidir_me;
105     int i_noise_reduction;
106 } CONFIG;
107
108 /* CODEC: vfw codec instance
109  */
110 typedef struct
111 {
112     CONFIG config;
113
114     /* handle */
115     x264_t *h;
116
117     /* error console handle */
118     HWND *hCons;
119
120     /* XXX: needed ? */
121     unsigned int fincr;
122     unsigned int fbase;
123 } CODEC;
124
125 /* Compress functions */
126 LRESULT compress_query(CODEC *, BITMAPINFO *, BITMAPINFO *);
127 LRESULT compress_get_format(CODEC *, BITMAPINFO *, BITMAPINFO *);
128 LRESULT compress_get_size(CODEC *, BITMAPINFO *, BITMAPINFO *);
129 LRESULT compress_frames_info(CODEC *, ICCOMPRESSFRAMES *);
130 LRESULT compress_begin(CODEC *, BITMAPINFO *, BITMAPINFO *);
131 LRESULT compress_end(CODEC *);
132 LRESULT compress(CODEC *, ICCOMPRESS *);
133
134
135 /* config functions */
136 void config_reg_load( CONFIG * config );
137 void config_reg_save( CONFIG * config );
138 static void tabs_enable_items( HWND hDlg, CONFIG * config );
139 static void tabs_update_items( HWND hDlg, CONFIG * config );
140
141 /* Dialog callbacks */
142 BOOL CALLBACK callback_main ( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
143 BOOL CALLBACK callback_tabs( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
144 BOOL CALLBACK callback_about( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
145 BOOL CALLBACK callback_err_console( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
146
147 /* Dll instance */
148 extern HINSTANCE g_hInst;
149
150 #if defined(_DEBUG)
151 #include <stdio.h> /* vsprintf */
152 #define DPRINTF_BUF_SZ  1024
153 static __inline void DPRINTF(char *fmt, ...)
154 {
155     va_list args;
156     char buf[DPRINTF_BUF_SZ];
157
158     va_start(args, fmt);
159     vsprintf(buf, fmt, args);
160     OutputDebugString(buf);
161 }
162 #else
163 static __inline void DPRINTF(char *fmt, ...) { }
164 #endif
165
166
167 #endif
168