x264vfw.h 2.91 KB
Newer Older
Laurent Aimar's avatar
Laurent Aimar committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef _X264_VFW_H
#define _X264_VFW_H

#include <stdlib.h>
#include <string.h>
#include <stdint.h>

#include <windows.h>
#include <vfw.h>

#include <x264.h>

#include "resource.h"

/* Name */
#define X264_NAME_L     L"x264"
#define X264_DESC_L     L"x264 - H264/AVC encoder"

/* Codec fcc */
#define FOURCC_X264 mmioFOURCC('X','2','6','4')

/* yuv 4:2:0 planar */
#define FOURCC_I420 mmioFOURCC('I','4','2','0')
#define FOURCC_IYUV mmioFOURCC('I','Y','U','V')
#define FOURCC_YV12 mmioFOURCC('Y','V','1','2')

/* yuv 4:2:2 packed */
#define FOURCC_YUY2 mmioFOURCC('Y','U','Y','2')
#define FOURCC_YUYV mmioFOURCC('Y','U','Y','V')

31
#define X264_WEBSITE    "http://videolan.org/x264.html"
Laurent Aimar's avatar
Laurent Aimar committed
32
33
34
35
36
37
38
39
40
41
42

/* CONFIG: vfw config
 */
typedef struct
{
    /********** ATTENTION **********/
    int mode;                   /* Vidomi directly accesses these vars */
    int bitrate;
    int desired_size;           /* please try to avoid modifications here */
    char stats[MAX_PATH];
    /*******************************/
43
44
    int i_2passbitrate;
    int i_pass;
Laurent Aimar's avatar
Laurent Aimar committed
45

46
47
    int b_fast1pass;    /* turns off some flags during 1st pass */    

Laurent Aimar's avatar
Laurent Aimar committed
48
49
    /* Our config */
    int i_refmax;
50
51
    int i_keyint_max;
    int i_keyint_min;
Laurent Aimar's avatar
Laurent Aimar committed
52
53
54
55
56
57
58
59
60

    int i_qp;
    int b_filter;

    int b_cabac;

    int b_i4x4;
    int b_psub16x16;
    int b_psub8x8;
61
62
63
64
65
66
67
68
    int b_bsub16x16;

    int i_bframe;
    int i_subpel_refine;
    int i_direct_mv_pred;

    int i_inloop_a;
    int i_inloop_b;
69
70
71
    
    int i_key_boost;
    int i_b_red;
72
    int i_curve_comp;
Laurent Aimar's avatar
Laurent Aimar committed
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117

    /* vfw interface */
    int b_save;
    /* fourcc used */
    char fcc[4+1];
    int  i_encoding_type;
} CONFIG;

/* CODEC: vfw codec instance
 */
typedef struct
{
    CONFIG config;

    /* handle */
    x264_t *h;

    /* XXX: needed ? */
    unsigned int fincr;
    unsigned int fbase;
} CODEC;

/* Compress functions */
LRESULT compress_query(CODEC *, BITMAPINFO *, BITMAPINFO *);
LRESULT compress_get_format(CODEC *, BITMAPINFO *, BITMAPINFO *);
LRESULT compress_get_size(CODEC *, BITMAPINFO *, BITMAPINFO *);
LRESULT compress_frames_info(CODEC *, ICCOMPRESSFRAMES *);
LRESULT compress_begin(CODEC *, BITMAPINFO *, BITMAPINFO *);
LRESULT compress_end(CODEC *);
LRESULT compress(CODEC *, ICCOMPRESS *);


/* config functions */
void config_reg_load( CONFIG * config );
void config_reg_save( CONFIG * config );


/* Dialog callbacks */
BOOL CALLBACK callback_about( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK callback_main ( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK callback_advanced( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );

/* Dll instance */
extern HINSTANCE g_hInst;

118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#if defined(_DEBUG)
#include <stdio.h> /* vsprintf */
#define DPRINTF_BUF_SZ  1024
static __inline void DPRINTF(char *fmt, ...)
{
    va_list args;
    char buf[DPRINTF_BUF_SZ];

    va_start(args, fmt);
    vsprintf(buf, fmt, args);
    OutputDebugString(buf);
}
#else
static __inline void DPRINTF(char *fmt, ...) { }
#endif


Laurent Aimar's avatar
Laurent Aimar committed
135
136
#endif