1 /*
2  *  tc_defaults.h
3  *
4  *  Copyright (C) Thomas Oestreich - June 2001
5  *
6  *  This file is part of transcode, a video stream processing tool
7  *
8  *  transcode is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2, or (at your option)
11  *  any later version.
12  *
13  *  transcode is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with GNU Make; see the file COPYING.  If not, write to
20  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21  *
22  */
23 
24 #ifdef HAVE_CONFIG_H
25 #include "config.h"
26 #endif
27 
28 #include <limits.h>
29 
30 #ifndef TC_DEFAULTS_H
31 #define TC_DEFAULTS_H
32 
33 #define TC_DEFAULT_MOD_PATH "/usr/local/lib/transcode"
34 
35 #define TC_DEFAULT_IN_FILE  "/dev/zero"
36 #define TC_DEFAULT_OUT_FILE "/dev/null"
37 
38 // default PAL video size
39 #define PAL_W                  720
40 #define PAL_H                  576
41 #define BPP                     24
42 #define PAL_FPS                 25.0
43 #define MIN_FPS                  1.0
44 #define NTSC_FILM    ((double)(24000)/1001.0)
45 #define NTSC_VIDEO   ((double)(30000)/1001.0)
46 
47 //NTSC
48 #define NTSC_W                  720
49 #define NTSC_H                  480
50 
51 //new max frame size:
52 #define TC_MAX_V_FRAME_WIDTH     2500
53 #define TC_MAX_V_FRAME_HEIGHT    2000
54 
55 // max bytes per pixel
56 #define TC_MAX_V_BYTESPP        4
57 
58 // audio defaults
59 #define RATE         48000
60 #define BITS            16
61 #define CHANNELS         2
62 
63 #define SIZE_RGB_FRAME ((int) TC_MAX_V_FRAME_WIDTH*TC_MAX_V_FRAME_HEIGHT*(BPP/8))
64 #define SIZE_PCM_FRAME ((int) (RATE/MIN_FPS) * BITS/8 * CHANNELS * 3)
65 
66 #define TC_PAD_AUD_FRAMES 10
67 #define TC_MAX_SEEK_BYTES (1<<20)
68 
69 // DivX/MPEG-4 encoder defaults
70 #define VBITRATE            1800
71 #define VKEYFRAMES           250
72 #define VCRISPNESS           100
73 
74 #define VMULTIPASS             0
75 #define VQUALITY               5
76 
77 #define VMINQUANTIZER          2
78 #define VMAXQUANTIZER         31
79 
80 #define VQUANTIZER            10
81 
82 #define RC_PERIOD           2000
83 #define RC_REACTION_PERIOD    10
84 #define RC_REACTION_RATIO     20
85 
86 // Divx5 VBV (Video Bitrate Verifier)
87 // Home theatre profile and settings
88 #define DIVX5_VBV_PROFILE                 3
89 #define DIVX5_VBV_BITRATE     (4000000/400)
90 #define DIVX5_VBV_SIZE      (3145728/16384)
91 #define DIVX5_VBV_OCCUPANCY    (2359296/64)
92 
93 //----------------------------------
94 
95 #define ABITRATE       128
96 #define AQUALITY         5
97 #define AVBR             0
98 #define AMODE            0
99 
100 typedef enum tcdebugmode_ TCDebugMode;
101 enum tcdebugmode_ {
102     TC_QUIET   = 0,
103     TC_INFO    = 1,
104     TC_DEBUG   = 2,
105     TC_STATS   = 4,
106     TC_CLEANUP = 8,
107     TC_FLIST   = 16,
108     TC_SYNC    = 32,
109     TC_COUNTER = 64,
110     TC_PRIVATE = 128,
111     TC_THREADS = 256,
112     TC_WATCH   = 512,
113 };
114 
115 //import/export/filter frame buffer status flag
116 #define TC_NONE                  0
117 #define TC_VIDEO                 1
118 #define TC_AUDIO                 2
119 #define TC_SUBEX                 4
120 #define TC_RESERVED              8
121 #define TC_EXTRA                16
122 
123 #define TC_FILTER_INIT          16
124 #define TC_PRE_S_PROCESS        32
125 #define TC_PRE_M_PROCESS        64
126 #define TC_INT_M_PROCESS       128
127 #define TC_POST_M_PROCESS      256
128 #define TC_POST_S_PROCESS      512
129 #define TC_PREVIEW            1024
130 #define TC_FILTER_CLOSE       2048
131 #define TC_FILTER_GET_CONFIG  4096
132 
133 #define TC_IMPORT             8192
134 #define TC_EXPORT            16384
135 
136 #define TC_DELAY_MAX         40000
137 #define TC_DELAY_MIN         10000
138 
139 #define TC_DEFAULT_IMPORT_AUDIO "null"
140 #define TC_DEFAULT_IMPORT_VIDEO "null"
141 #define TC_DEFAULT_EXPORT_AUDIO "null"
142 #define TC_DEFAULT_EXPORT_VIDEO "null"
143 #define TC_DEFAULT_EXPORT_MPLEX "null"
144 
145 #define TC_FRAME_BUFFER        10
146 #define TC_FRAME_THREADS        1
147 #define TC_FRAME_THREADS_MAX   32
148 
149 #define TC_FRAME_FIRST          0
150 #define TC_FRAME_LAST     INT_MAX
151 
152 #define TC_LEAP_FRAME        1000
153 #define TC_MAX_AUD_TRACKS      32
154 
155 //--------------------------------------------------
156 
157 #define CODEC_NULL       0x0
158 
159 #define CODEC_RGB          1
160 #define CODEC_YUV          2
161 #define CODEC_MP4          4
162 #define CODEC_YUY2         8
163 #define CODEC_DV          16
164 #define CODEC_RAW         32
165 #define CODEC_RAW_RGB     64
166 #define CODEC_RAW_YUV    128
167 #define CODEC_YUV422     256
168 
169 #define CODEC_PCM     0x1
170 #define CODEC_AC3     0x2000
171 #define CODEC_MP2     0x50
172 #define CODEC_MP3     0x55
173 #define CODEC_DIVX    0x161
174 #define CODEC_IMA4    0x11
175 #define CODEC_LPCM    0x10001
176 #define CODEC_DTS     0x1000F     //??
177 #define CODEC_VORBIS  0xfffe
178 #define CODEC_VAG     0xfeed //me pizza
179 
180 #define TC_INFO_NO_DEMUX        1
181 #define TC_INFO_MPEG_PS         2
182 #define TC_INFO_MPEG_ES         4
183 #define TC_INFO_MPEG_PES        8
184 
185 #define TC_FRAME_DV_PAL     144000
186 #define TC_FRAME_DV_NTSC    120000
187 
188 #define TC_SUBTITLE_HDRMAGIC 0x00030001
189 
190 #define TC_DEFAULT_AAWEIGHT (1.0f/3.0f)
191 #define TC_DEFAULT_AABIAS   (0.5f)
192 
193 #define TC_A52_DRC_OFF    1
194 #define TC_A52_DEMUX      2
195 #define TC_A52_DOLBY_OFF  4
196 
197 #define AVI_FILE_LIMIT 2048
198 
199 #define M2V_REQUANT_FACTOR  1.00f
200 
201 /*
202  * flags used in modules for supporting export profiles (--export_prof)
203  * if one of those flag is set, then use the value provided by the user.
204  * otherwise use the ones the export modules suggests.
205  */
206 typedef enum tcexportattribute_ TCExportAttribute;
207 enum tcexportattribute_ {
208     TC_EXPORT_ATTRIBUTE_NONE     = (    0),
209     TC_EXPORT_ATTRIBUTE_VBITRATE = (1<< 1), /* -w */
210     TC_EXPORT_ATTRIBUTE_ABITRATE = (1<< 2), /* -b */
211     TC_EXPORT_ATTRIBUTE_FIELDS   = (1<< 3), /* --encode_fields */
212     TC_EXPORT_ATTRIBUTE_VMODULE  = (1<< 4), /* -y X,* */
213     TC_EXPORT_ATTRIBUTE_AMODULE  = (1<< 5), /* -y *,X */
214     TC_EXPORT_ATTRIBUTE_FRC      = (1<< 6), /* --export_fps *,X */
215     TC_EXPORT_ATTRIBUTE_FPS      = (1<< 7), /* --export_fps X,* */
216     TC_EXPORT_ATTRIBUTE_VCODEC   = (1<< 8), /* -F */
217     TC_EXPORT_ATTRIBUTE_ACODEC   = (1<< 9), /* -N */
218     TC_EXPORT_ATTRIBUTE_ARATE    = (1<<10), /* -E X,*,* */
219     TC_EXPORT_ATTRIBUTE_ABITS    = (1<<11), /* -E *,X,* */
220     TC_EXPORT_ATTRIBUTE_ACHANS   = (1<<12), /* -E *,*,X */
221     TC_EXPORT_ATTRIBUTE_ASR      = (1<<13), /* --export_asr */
222     TC_EXPORT_ATTRIBUTE_PAR      = (1<<14), /* --export_par */
223     TC_EXPORT_ATTRIBUTE_GOP      = (1<<15), /* key frames */
224 };
225 
226 #endif /* TC_DEFAULTS_H */
227