/* $Id: common.h,v 1.51 2005/11/04 13:09:40 titer Exp $
This file is part of the HandBrake source code.
- Homepage: <http://handbrake.m0k.org/>.
+ Homepage: <http://handbrake.fr/>.
It may be used under the terms of the GNU General Public License. */
#ifndef HB_COMMON_H
int amixdown;
};
-#define HB_ASPECT_BASE 9
#define HB_VIDEO_RATE_BASE 27000000
extern hb_rate_t hb_video_rates[];
width: must be a multiple of 16
height: must be a multiple of 16
keep_ratio: used by UIs
+ grayscale: black and white encoding
pixel_ratio: store pixel aspect ratio in the video
pixel_aspect_width: numerator for pixel aspect ratio
pixel_aspect_height: denominator for pixel aspect ratio
- maxWidth: keep width below this
- maxHeight: keep height below this */
-
+ modulus: set a number besides 16 for dimensions to be multiples of
+ maxWidth: keep width below this
+ maxHeight: keep height below this */
int crop[4];
int deinterlace;
hb_list_t * filters;
int pixel_aspect_width;
int pixel_aspect_height;
int modulus;
- int maxWidth;
- int maxHeight;
-
+ int maxWidth;
+ int maxHeight;
/* Video settings:
vcodec: output codec
vquality: output quality (0.0..1.0)
- if < 0.0 or > 1.0, bitrate is used instead
+ if < 0.0 or > 1.0, bitrate is used instead,
+ except with x264, to use its real QP/RF scale
vbitrate: output bitrate (kbps)
- pass: 0, 1 or 2 (or -1 for scan)
vrate, vrate_base: output framerate is vrate / vrate_base
- h264_level: boolean for whether or not we're encoding for iPod
+ vfr: boolean for variable frame rate detelecine
+ cfr: boolean to use constant frame rates instead of
+ passing through the source's frame durations.
+ pass: 0, 1 or 2 (or -1 for scan)
+ h264_level: vestigial boolean to decide if we're encoding for iPod
crf: boolean for whether to use constant rate factor with x264
x264opts: string of extra x264 options
areBframes: boolean to note if b-frames are included in x264opts */
int vbitrate;
int vrate;
int vrate_base;
+ int vfr;
+ int cfr;
int pass;
int h264_13;
int h264_level;
int crf;
char *x264opts;
int areBframes;
- int vfr;
/* List of audio settings. */
hb_list_t * list_audio;
subtitle: index in hb_title_t's subtitles list, starting
from 0. -1 means no subtitle */
int subtitle;
- int subtitleSmartAdjust;
+ int subtitleSmartAdjust;
/* Muxer settings
mux: output file format
#define HB_ACODEC_MPGA 0x001000
#define HB_ACODEC_LPCM 0x002000
#define HB_ACODEC_DCA 0x004000
+#define HB_ACODEC_FFMPEG 0x008000
/* Audio Mixdown */
/* define some masks, used to extract the various information from the HB_AMIXDOWN_XXXX values */
/* Input */
struct
{
- int track; /* Input track number */
- PRIVATE uint32_t codec; /* Input audio codec */
+ int track; /* Input track number */
+ PRIVATE uint32_t codec; /* Input audio codec */
+ PRIVATE uint32_t codec_param; /* per-codec config info */
PRIVATE int samplerate; /* Input sample rate (Hz) */
PRIVATE int bitrate; /* Input bitrate (kbps) */
PRIVATE int channel_layout;
PRIVATE int ac3; /* flags.ac3 is only set when the source audio format is HB_ACODEC_AC3 */
PRIVATE int dca; /* flags.dca is only set when the source audio format is HB_ACODEC_DCA */
} flags;
+#define AUDIO_F_DOLBY (1 << 31) /* set if source uses Dolby Surround */
struct
{
/* Exact duration (in 1/90000s) */
uint64_t duration;
+ double aspect; // aspect ratio for the title's video
+ double container_aspect; // aspect ratio from container (0 if none)
int width;
int height;
- int aspect;
+ int pixel_aspect_width;
+ int pixel_aspect_height;
int rate;
int rate_base;
int crop[4];
+ enum { HB_MPEG2_DEMUXER = 0, HB_NULL_DEMUXER } demuxer;
int detected_interlacing;
+ int video_id; /* demuxer stream id for video */
+ int video_codec; /* worker object id of video codec */
+ int video_codec_param; /* codec specific config */
+
+ const char *video_codec_name;
+ int video_bitrate;
+ const char *container_name;
+ int data_rate;
uint32_t palette[16];
} param;
};
+typedef struct hb_work_info_s
+{
+ const char *name;
+ int profile;
+ int level;
+ int bitrate;
+ int rate;
+ int rate_base;
+ int flags;
+ union {
+ struct { // info only valid for video decoders
+ int width;
+ int height;
+ int pixel_aspect_width;
+ int pixel_aspect_height;
+ double aspect;
+ };
+ struct { // info only valid for audio decoders
+ int channel_layout;
+ };
+ };
+} hb_work_info_t;
+
struct hb_work_object_s
{
int id;
int (* work) ( hb_work_object_t *, hb_buffer_t **,
hb_buffer_t ** );
void (* close) ( hb_work_object_t * );
+ /* the info entry point is used by scan to get bitstream information
+ * during a decode (i.e., it should only be called after at least one
+ * call to the 'work' entry point). currently it's only called for
+ * video streams & can be null for other work objects. */
+ int (* info) ( hb_work_object_t *, hb_work_info_t * );
+ /* the bitstream info entry point is used by scan to get bitstream
+ * information from a buffer. it doesn't have to be called during a
+ * decode (it can be called even if init & work haven't been).
+ * currently it's only called for audio streams & can be null for
+ * other work objects. */
+ int (* bsinfo) ( hb_work_object_t *, const hb_buffer_t *,
+ hb_work_info_t * );
hb_fifo_t * fifo_in;
hb_fifo_t * fifo_out;
hb_thread_t * thread;
volatile int * done;
+ int status;
+ int codec_param;
hb_work_object_t * next;
int thread_sleep_interval;
extern hb_work_object_t hb_deca52;
extern hb_work_object_t hb_decdca;
extern hb_work_object_t hb_decavcodec;
+extern hb_work_object_t hb_decavcodecv;
+extern hb_work_object_t hb_decavcodecvi;
+extern hb_work_object_t hb_decavcodecai;
extern hb_work_object_t hb_declpcm;
extern hb_work_object_t hb_encfaac;
extern hb_work_object_t hb_enclame;
extern hb_filter_object_t hb_filter_deinterlace;
extern hb_filter_object_t hb_filter_deblock;
extern hb_filter_object_t hb_filter_denoise;
+extern hb_filter_object_t hb_filter_decomb;
typedef void hb_error_handler_t( const char *errmsg );