~ubuntu-branches/ubuntu/natty/x264/natty

« back to all changes in this revision

Viewing changes to vfw/x264vfw.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2006-02-14 12:51:13 UTC
  • Revision ID: james.westby@ubuntu.com-20060214125113-t2vdkiqgcctz9ndd
Tags: upstream-0.cvs20060210
ImportĀ upstreamĀ versionĀ 0.cvs20060210

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
} CONFIG;
 
104
 
 
105
/* CODEC: vfw codec instance
 
106
 */
 
107
typedef struct
 
108
{
 
109
    CONFIG config;
 
110
 
 
111
    /* handle */
 
112
    x264_t *h;
 
113
 
 
114
    /* error console handle */
 
115
    HWND *hCons;
 
116
 
 
117
    /* XXX: needed ? */
 
118
    unsigned int fincr;
 
119
    unsigned int fbase;
 
120
} CODEC;
 
121
 
 
122
/* Compress functions */
 
123
LRESULT compress_query(CODEC *, BITMAPINFO *, BITMAPINFO *);
 
124
LRESULT compress_get_format(CODEC *, BITMAPINFO *, BITMAPINFO *);
 
125
LRESULT compress_get_size(CODEC *, BITMAPINFO *, BITMAPINFO *);
 
126
LRESULT compress_frames_info(CODEC *, ICCOMPRESSFRAMES *);
 
127
LRESULT compress_begin(CODEC *, BITMAPINFO *, BITMAPINFO *);
 
128
LRESULT compress_end(CODEC *);
 
129
LRESULT compress(CODEC *, ICCOMPRESS *);
 
130
 
 
131
 
 
132
/* config functions */
 
133
void config_reg_load( CONFIG * config );
 
134
void config_reg_save( CONFIG * config );
 
135
static void tabs_enable_items( HWND hDlg, CONFIG * config );
 
136
static void tabs_update_items( HWND hDlg, CONFIG * config );
 
137
 
 
138
/* Dialog callbacks */
 
139
BOOL CALLBACK callback_main ( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
 
140
BOOL CALLBACK callback_tabs( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
 
141
BOOL CALLBACK callback_about( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
 
142
BOOL CALLBACK callback_err_console( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
 
143
 
 
144
/* Dll instance */
 
145
extern HINSTANCE g_hInst;
 
146
 
 
147
#if defined(_DEBUG)
 
148
#include <stdio.h> /* vsprintf */
 
149
#define DPRINTF_BUF_SZ  1024
 
150
static __inline void DPRINTF(char *fmt, ...)
 
151
{
 
152
    va_list args;
 
153
    char buf[DPRINTF_BUF_SZ];
 
154
 
 
155
    va_start(args, fmt);
 
156
    vsprintf(buf, fmt, args);
 
157
    OutputDebugString(buf);
 
158
}
 
159
#else
 
160
static __inline void DPRINTF(char *fmt, ...) { }
 
161
#endif
 
162
 
 
163
 
 
164
#endif
 
165