-
Notifications
You must be signed in to change notification settings - Fork 114
/
ADM_xvid4.h
100 lines (87 loc) · 3.67 KB
/
ADM_xvid4.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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
/***************************************************************************
\fn xvid4Encoder
\brief Internal handling of video encoders
-------------------
copyright : (C) 2002/2010 by mean/gruntster
email : fixounet@free.fr
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef ADM_xvid4_H
#define ADM_xvid4_H
#include "ADM_coreVideoEncoder.h"
#include "ADM_encoderConf.h"
#include "xvid4_encoder.h"
#include "xvid.h"
#define XVID_DEFAULT_CONF \
{ \
{ \
COMPRESS_CQ, /*COMPRESSION_MODE mode */ \
2, /* uint32_t qz /// Quantizer */ \
1500, /*uint32_t bitrate /// In kb/s */ \
700, /*uint32_t finalsize /// In ? */ \
1500, /*uint32_t avg_bitrate /// avg_bitrate is in kb/s!! */ \
ADM_ENC_CAP_CBR+ADM_ENC_CAP_CQ+ADM_ENC_CAP_2PASS+ADM_ENC_CAP_2PASS_BR+ADM_ENC_CAP_GLOBAL+ADM_ENC_CAP_SAME \
}, \
XVID_PROFILE_AS_L4, /* Profile */ \
3, /* rdMode */ \
3, /* MotionEstimation */ \
0, /* cqmMode */ \
1, /* arMode */ \
2, /* MaxBframe */ \
200, /* MaxKeyInterval */ \
99, /* nbThreads */ \
2, /* Qmin */\
25, /* Qmax */\
true, /* rdOnBframe */ \
true, /*bool:hqAcPred */ \
true, /*bool:optimizeChrome */ \
true, /* Trellis */ \
true, /* UseXvidFCC */ \
false, /* enableFrameDrop */ \
50 /* frameDropRatio */ \
}
/**
\class xvid4Encoder
\brief Xvid4 mpeg4 encoder
*/
class xvid4Encoder : public ADM_coreVideoEncoder
{
protected:
void *handle;
int plane;
bool globalHeader;
bool preAmble (ADMImage * in);
bool postAmble (ADMBitstream * out,xvid_enc_stats_t *stat,int size);
bool query(void);
bool setupPass(void);
xvid_plugin_single_t single;
xvid_plugin_2pass1_t pass1;
xvid_plugin_2pass2_t pass2;
xvid_enc_frame_t xvid_enc_frame;
xvid_enc_stats_t xvid_enc_stats;
xvid_enc_plugin_t plugins[7];
uint32_t frameNum;
uint32_t currentRef;
uint32_t backRef;
uint32_t fwdRef;
uint32_t refIndex;
std::string logFile;
int pass;
public:
xvid4Encoder(ADM_coreVideoFilter *src,bool globalHeader);
virtual ~xvid4Encoder();
virtual bool setup(void);
virtual bool encode (ADMBitstream * out);
virtual const char *getFourcc(void);
virtual bool isDualPass(void) ;
static int hook (void *handle, int opt, void *param1, void *param2);
bool setPassAndLogFile(int pass,const char *name);
};
#endif