##############################################################################
# Sample Config file for transcode + XviD
#
# You can copy it to your transcode's session working directory (./xvid.cfg)
# or into your home dir (~/.xvid.cfg) for all transcode sessions.
#
# Last Update : 2002-09-17
# Author : Edouard Gomez <ed dot gomez at wanadoo dot fr>
#-----------------------------------------------------------------------------
#
# This is a sample file to show you how to configure all XviD flags with the
# help of a xvid.cfg file in transcode's working directory.
#
# Quality tuning :
#
# If you want to use [qualityX] settings, run transcode with the X quality
# command line option (# transcode -Q X ... ) (X is a number)
#
# You can define whatever quality mode between 0 and 5 (included).
# Use the right flag constant names with the right flag and they should be
# recognized at runtime. You can have a list of known flags constants names
# reading the xvidcvs.h shipped with transcode or the xvid.h available on
# XviD cvs (http://cvs.xvid.org/cgi-bin/cvsweb.cgi/xvidcore/src/xvid.h)
#
# Variable Bitrate :
#
# The config section [vbr] describes all the settings of the 2pass 2nd pass
# bitrate allocator. Its tuning is very hard and defaults are good for most
# "Joe" users. You're warned that modifying this section could lead to serious
# quality loss.
#
# NB : These settings appeared to give good results for doom9's visitors.
#      Let's hope they will give good results to transcode's users as well.
#
##############################################################################

##############################################################################
# Addendum : you can also configure bframes here when building an
#            export_xvidcvs bframe "aware". I don't show the paremeters here
#            because B Frames are still beta and I don't want XviD being
#            flooded by bframes test feedback yet (except bugs).
##############################################################################

##############################################################################
# Quality 0
##############################################################################

[quality0]

init.cpu_flags = 0
frame.motion  = 0
frame.general =	XVID_MPEGQUANT

# You could tune these parameters too, but it's better using defaults
# (-1 means : let XviD set the default value)
#
# rc_reaction_delay_factor = -1
# param.rc_averaging_period = -1
# rc_buffer = -1 
# min_quantizer = 1
# max_quantizer = 31

##############################################################################
# Quality 1
##############################################################################

[quality1]

init.cpu_flags = 0
frame.motion  = PMV_EARLYSTOP16
frame.general = XVID_H263QUANT

##############################################################################
# Quality 2
##############################################################################

[quality2]

init.cpu_flags = 0
frame.motion  = PMV_EARLYSTOP16 PMV_HALFPELREFINE16
frame.general = XVID_H263QUANT XVID_HALFPEL

##############################################################################
# Quality 3
##############################################################################

[quality3]

init.cpu_flags = 0
frame.motion  = PMV_EARLYSTOP16 PMV_HALFPELREFINE16
frame.general = XVID_H263QUANT XVID_HALFPEL XVID_INTER4V

##############################################################################
# Quality 4
##############################################################################

[quality4]

init.cpu_flags = 0
frame.motion  = PMV_EARLYSTOP16 PMV_HALFPELREFINE16 PMV_EARLYSTOP8 PMV_HALFPELREFINE8
frame.general = XVID_H263QUANT XVID_HALFPEL XVID_INTER4V

##############################################################################
# Quality 5
##############################################################################

[quality5]

init.cpu_flags = 0
frame.motion  = PMV_EARLYSTOP16 PMV_HALFPELREFINE16 PMV_EXTSEARCH16 PMV_USESQUARES16 PMV_EARLYSTOP8 PMV_HALFPELREFINE8
frame.general = XVID_H263QUANT XVID_HALFPEL XVID_INTER4V

##############################################################################
# VBR SECTION must be defined as [vbr] (case sensitive)
#
# This vbr controler uses lot of parameters, here you have the default values
# but depending on what vbr options you use, parameters are ignored or not.
#
# The problem is I cannot show easily the dependancy between all options in
# a text file. This would be treated in a document... but i hate writing
# documentation.
#
# Feel free to contribute :-)
#
# These settings are the defaults and are good for a "lambda user".
#
##############################################################################

[vbr]

# credits management
credits_mode = VBR_CREDITS_MODE_RATE
credits_start = 0
credits_start_begin = 0
credits_start_end = 0
credits_end = 0
credits_end_begin = 0
credits_end_end = 0
credits_quant_ratio = 20
credits_fixed_quant = 20
credits_quant_i = 20
credits_quant_p = 20
credits_start_size = 0
credits_end_size = 0

# Keyframe boost
keyframe_boost = 0
kftreshold = 10
kfreduction = 30
min_key_interval = 1


# Normal curve treatment parameters
curve_compression_high = 25
curve_compression_low = 10

# Alt curve parameters
use_alt_curve = 1
alt_curve_type = VBR_ALT_CURVE_LINEAR 
alt_curve_low_dist = 90
alt_curve_high_dist = 500
alt_curve_min_rel_qual = 50
alt_curve_use_auto = 1
alt_curve_auto_str = 30
alt_curve_use_auto_bonus_bias = 1
alt_curve_bonus_bias = 50

# Payback parameters
bitrate_payback_method = VBR_PAYBACK_BIAS
bitrate_payback_delay = 250

# overflow options
twopass_twopass_max_bitrate = 687559000
twopass_max_overflow_improvement = 60
twopass_max_overflow_degradation = 60

# quantizers options
max_iquant = 31
min_iquant = 2
max_pquant = 31
min_pquant = 2
fixed_quant = 3


##############################################################################
#                                   EOF
##############################################################################
