1# New Input File Format is as follows
2# <ParameterName> = <ParameterValue> # Comment
3#
4# See configfile.h for a list of supported ParameterNames
5#
6# For bug reporting and known issues see:
7# https://ipbt.hhi.fraunhofer.de
8
9
10##########################################################################################
11# Files
12##########################################################################################
13InputFile             = "foreman_part_qcif_422.yuv"       # Input sequence
14InputHeaderLength     = 0      # If the inputfile has a header, state it's length in byte here
15StartFrame            = 0      # Start frame for encoding. (0-N)
16FramesToBeEncoded     = 3      # Number of frames to be coded
17FrameRate             = 30.0   # Frame Rate per second (0.1-100.0)
18SourceWidth           = 176    # Source frame width
19SourceHeight          = 144    # Source frame height
20SourceResize          = 0      # Resize source size for output
21OutputWidth           = 176    # Output frame width
22OutputHeight          = 144    # Output frame height
23ProcessInput          = 0      # Filter Input Sequence
24Interleaved           = 0      # 0: Planar input, 1: Packed input
25StandardRange         = 0      # 0: Standard range 1: Full range (RGB input)
26VideoCode             = 1      # Video codes for RGB ==> YUV conversions
27                               # 0 = NULL,
28                               # 1 = ITU_REC709,
29                               # 2 = CCIR_601,
30                               # 3 = FCC,
31                               # 4 = ITU_REC624BG,
32                               # 5 = SMPTE_170M,
33                               # 6 = SMPTE_240M,
34                               # 7 = SMPTE_260M,
35                               # 8 = ITU_REC709_EXACT
36
37TraceFile             = "trace_enc.txt"      # Trace file
38ReconFile             = "test_rec.yuv"       # Reconstruction YUV file
39OutputFile            = "test.264"           # Bitstream
40StatsFile             = "stats.dat"          # Coding statistics file
41
42##########################################################################################
43# Encoder Control
44##########################################################################################
45ProfileIDC            = 122 # Profile IDC (66=baseline, 77=main, 88=extended; FREXT Profiles: 100=High, 110=High 10, 122=High 4:2:2, 244=High 4:4:4, 44=CAVLC 4:4:4 Intra)
46IntraProfile          = 0   # Activate Intra Profile for FRExt (0: false, 1: true)
47                            # (e.g. ProfileIDC=110, IntraProfile=1  =>  High 10 Intra Profile)
48LevelIDC              = 40  # Level IDC   (e.g. 20 = level 2.0)
49
50IntraPeriod           = 0   # Period of I-pictures   (0=only first)
51IDRPeriod             = 0   # Period of IDR pictures (0=only first)
52AdaptiveIntraPeriod   = 1   # Adaptive intra period
53AdaptiveIDRPeriod     = 0   # Adaptive IDR period
54IntraDelay            = 0   # Intra (IDR) picture delay (i.e. coding structure of PPIPPP... )
55EnableIDRGOP          = 0   # Support for IDR closed GOPs (0: disabled, 1: enabled)
56EnableOpenGOP         = 0   # Support for open GOPs (0: disabled, 1: enabled)
57QPISlice              = 28  # Quant. param for I Slices (0-51)
58QPPSlice              = 28  # Quant. param for P Slices (0-51)
59FrameSkip             = 0   # Number of frames to be skipped in input (e.g 2 will code every third frame).
60                            # Note that this now excludes intermediate (i.e. B) coded pictures
61ChromaQPOffset        = 0   # Chroma QP offset (-51..51)
62
63DisableSubpelME       = 0   # Disable Subpixel Motion Estimation (0=off/default, 1=on)
64SearchRange           = 32  # Max search range
65
66MEDistortionFPel      = 0   # Select error metric for Full-Pel ME    (0: SAD, 1: SSE, 2: Hadamard SAD)
67MEDistortionHPel      = 2   # Select error metric for Half-Pel ME    (0: SAD, 1: SSE, 2: Hadamard SAD)
68MEDistortionQPel      = 2   # Select error metric for Quarter-Pel ME (0: SAD, 1: SSE, 2: Hadamard SAD)
69MDDistortion          = 2   # Select error metric for Mode Decision  (0: SAD, 1: SSE, 2: Hadamard SAD)
70SkipDeBlockNonRef     = 0   # Skip Deblocking (regardless of DFParametersFlag) for non-reference frames (0: off, 1: on)
71ChromaMCBuffer        = 1   # Calculate Color component interpolated values in advance and store them.
72                            # Provides a trade-off between memory and computational complexity
73                            # (0: disabled/default, 1: enabled)
74ChromaMEEnable        = 0   # Take into account Color component information during ME
75                            # (0: only first component/default,
76                            #  1: All Color components - Integer refinement only
77                            #  2: All Color components - All refinements)
78ChromaMEWeight        = 1   # Weighting for chroma components. This parameter should have a relationship with color format.
79
80NumberReferenceFrames = 5   # Number of previous frames used for inter motion search (0-16)
81
82PList0References      = 0   # P slice List 0 reference override (0 disable, N <= NumberReferenceFrames)
83Log2MaxFNumMinus4     = 0   # Sets log2_max_frame_num_minus4 (-1 : based on FramesToBeEncoded/Auto, >=0 : Log2MaxFNumMinus4)
84Log2MaxPOCLsbMinus4   = -1  # Sets log2_max_pic_order_cnt_lsb_minus4 (-1 : Auto, >=0 : Log2MaxPOCLsbMinus4)
85
86GenerateMultiplePPS   = 0   # Transmit multiple parameter sets. Currently parameters basically enable all WP modes (0: diabled, 1: enabled)
87ResendPPS             = 0   # Resend PPS (with pic_parameter_set_id 0) for every coded Frame/Field pair (0: disabled, 1: enabled)
88
89MbLineIntraUpdate     = 0   # Error robustness(extra intra macro block updates)(0=off, N: One GOB every N frames are intra coded)
90RandomIntraMBRefresh  = 0   # Forced intra MBs per picture
91
92##########################################################################################
93# PSlice Mode types
94##########################################################################################
95PSliceSkip            = 1   # P-Slice Skip mode consideration  (0=disable, 1=enable)
96PSliceSearch16x16     = 1   # P-Slice Inter block search 16x16 (0=disable, 1=enable)
97PSliceSearch16x8      = 1   # P-Slice Inter block search 16x8  (0=disable, 1=enable)
98PSliceSearch8x16      = 1   # P-Slice Inter block search  8x16 (0=disable, 1=enable)
99PSliceSearch8x8       = 1   # P-Slice Inter block search  8x8  (0=disable, 1=enable)
100PSliceSearch8x4       = 1   # P-Slice Inter block search  8x4  (0=disable, 1=enable)
101PSliceSearch4x8       = 1   # P-Slice Inter block search  4x8  (0=disable, 1=enable)
102PSliceSearch4x4       = 1   # P-Slice Inter block search  4x4  (0=disable, 1=enable)
103
104##########################################################################################
105# BSlice Mode types
106##########################################################################################
107
108BSliceDirect          = 1   # B-Slice Skip mode consideration  (0=disable, 1=enable)
109BSliceSearch16x16     = 1   # B-Slice Inter block search 16x16 (0=disable, 1=enable)
110BSliceSearch16x8      = 1   # B-Slice Inter block search 16x8  (0=disable, 1=enable)
111BSliceSearch8x16      = 1   # B-Slice Inter block search  8x16 (0=disable, 1=enable)
112BSliceSearch8x8       = 1   # B-Slice Inter block search  8x8  (0=disable, 1=enable)
113BSliceSearch8x4       = 1   # B-Slice Inter block search  8x4  (0=disable, 1=enable)
114BSliceSearch4x8       = 1   # B-Slice Inter block search  4x8  (0=disable, 1=enable)
115BSliceSearch4x4       = 1   # B-Slice Inter block search  4x4  (0=disable, 1=enable)
116
117BiPredSearch16x16     = 1   # B-Slice Bi-prediction block search 16x16 (0=disable, 1=enable)
118BiPredSearch16x8      = 1   # B-Slice Bi-prediction block search 16x8  (0=disable, 1=enable)
119BiPredSearch8x16      = 1   # B-Slice Bi-prediction block search 8x16  (0=disable, 1=enable)
120BiPredSearch8x8       = 0   # B-Slice Bi-prediction block search 8x8   (0=disable, 1=enable)
121
122DisableIntra4x4        = 0  # Disable Intra 4x4 modes
123DisableIntra16x16      = 0  # Disable Intra 16x16 modes
124DisableIntraInInter    = 0  # Disable Intra modes for inter slices
125IntraDisableInterOnly  = 0  # Apply Disabling Intra conditions only to Inter Slices (0:disable/default,1: enable)
126Intra4x4ParDisable     = 0  # Disable Vertical & Horizontal 4x4
127Intra4x4DiagDisable    = 0  # Disable Diagonal 45degree 4x4
128Intra4x4DirDisable     = 0  # Disable Other Diagonal 4x4
129Intra16x16ParDisable   = 0  # Disable Vertical & Horizontal 16x16
130Intra16x16PlaneDisable = 0  # Disable Planar 16x16
131ChromaIntraDisable     = 0  # Disable Intra Chroma modes other than DC
132EnableIPCM             = 1  # Enable IPCM macroblock mode
133
134DisposableP            = 0  # Enable Disposable P slices in the primary layer (0: disable/default, 1: enable)
135DispPQPOffset          = 0  # Quantizer offset for disposable P slices (0: default)
136
137PreferDispOrder        = 1  # Prefer display order when building the prediction structure as opposed to coding order (affects intra and IDR periodic insertion, among others)
138PreferPowerOfTwo       = 0  # Prefer prediction structures that have lengths expressed as powers of two
139FrmStructBufferLength  = 16 # Length of the frame structure unit buffer; it can be overriden for certain cases
140
141ChangeQPFrame          = 0  # Frame in display order from which to apply the Change QP offsets
142ChangeQPI              = 0  # Change QP offset value for I_SLICE
143ChangeQPP              = 0  # Change QP offset value for P_SLICE
144ChangeQPB              = 0  # Change QP offset value for B_SLICE
145ChangeQPSI             = 0  # Change QP offset value for SI_SLICE
146ChangeQPSP             = 0  # Change QP offset value for SP_SLICE
147
148##########################################################################################
149# B Slices
150##########################################################################################
151
152NumberBFrames          = 1  # Number of B coded frames inserted (0=not used)
153QPBSlice               = 30 # Quant. param for B slices (0-51)
154BRefPicQPOffset        = -1 # Quantization offset for reference B coded pictures (-51..51)
155DirectModeType         = 1  # Direct Mode Type (0:Temporal 1:Spatial)
156DirectInferenceFlag    = 1  # Direct Inference Flag (0: Disable 1: Enable)
157BList0References       = 0  # B slice List 0 reference override (0 disable, N <= NumberReferenceFrames)
158BList1References       = 1  # B slice List 1 reference override (0 disable, N <= NumberReferenceFrames)
159                            # 1 List1 reference is usually recommended for normal GOP Structures.
160                            # A larger value is usually more appropriate if a more flexible
161                            # structure is used (i.e. using HierarchicalCoding)
162
163BReferencePictures    =  0  # Referenced B coded pictures (0=off, 1=B references for secondary layer, 2=B references for primary layer)
164
165HierarchicalCoding      =  0  # B hierarchical coding (0= off, 1= 2 layers, 2= 2 full hierarchy, 3 = explicit)
166HierarchyLevelQPEnable  =  1  # Adjust QP based on hierarchy level (in increments of 1). Overrides BRefPicQPOffset behavior.(0=off, 1=on)
167ExplicitHierarchyFormat = "b1r0b3r0b2e2b0e2b4r2" # Explicit Enhancement GOP. Format is {FrameDisplay_orderReferenceQP}.
168                                                 # Valid values for reference type is r:reference, e:non reference.
169ReferenceReorder      =  1    # Reorder References according to Poc distance for HierarchicalCoding (0=off, 1=enable, 2=use when LowDelay is set)
170PocMemoryManagement   =  1    # Memory management based on Poc Distances for HierarchicalCoding (0=off, 1=on, 2=use when LowDelay is set)
171
172BiPredMotionEstimation = 1   # Enable Bipredictive based Motion Estimation (0:disabled, 1:enabled)
173BiPredMERefinements    = 3   # Bipredictive ME extra refinements (0: single, N: N extra refinements (1 default)
174BiPredMESearchRange    = 16  # Bipredictive ME Search range (8 default). Note that range is halved for every extra refinement.
175BiPredMESubPel         = 2   # Bipredictive ME Subpixel Consideration (0: disabled, 1: single level, 2: dual level)
176
177
178##########################################################################################
179# SP Frames
180##########################################################################################
181
182SPPicturePeriodicity  = 0                  # SP-Picture Periodicity (0=not used)
183QPSPSlice             = 36                 # Quant. param of SP-Slices for Prediction Error (0-51)
184QPSISlice             = 36                 # Quant. param of SI-Slices for Prediction Error (0-51)
185QPSP2Slice            = 35                 # Quant. param of SP/SI-Slices for Predicted Blocks (0-51)
186SI_FRAMES             = 0                  # SI frame encoding flag (0=not used, 1=used)
187SP_output             = 0                  # Controls whether coefficients will be output to encode switching SP frames (0=no, 1=yes)
188SP_output_name        = "low_quality.dat"  # Filename for SP output coefficients
189SP2_FRAMES            = 0                  # switching SP frame encoding flag (0=not used, 1=used)
190SP2_input_name1       = "high_quality.dat" # Filename for the first swithed bitstream coefficients
191SP2_input_name2       = "low_quality.dat"  # Filename for the second switched bitstream coefficients
192
193##########################################################################################
194# Output Control, NALs
195##########################################################################################
196
197SymbolMode             =  1  # Symbol mode (Entropy coding method: 0=UVLC, 1=CABAC)
198OutFileMode            =  0  # Output file mode, 0:Annex B, 1:RTP
199PartitionMode          =  0  # Partition Mode, 0: no DP, 1: 3 Partitions per Slice
200
201##########################################################################################
202# CABAC context initialization
203##########################################################################################
204
205ContextInitMethod        =  1     # Context init (0: fixed, 1: adaptive)
206FixedModelNumber         =  0     # model number for fixed decision for inter slices ( 0, 1, or 2 )
207
208##########################################################################################
209# Interlace Handling
210#########################################################################################
211
212PicInterlace             =  0     # Picture AFF    (0: frame coding, 1: field coding, 2:adaptive frame/field coding)
213MbInterlace              =  0     # Macroblock AFF (0: frame coding, 1: field coding, 2:adaptive frame/field coding, 3: frame MB-only AFF)
214IntraBottom              =  0     # Force Intra Bottom at GOP Period
215
216##########################################################################################
217# Weighted Prediction
218#########################################################################################
219
220WeightedPrediction       =  0     # P picture Weighted Prediction (0=off, 1=explicit mode)
221WeightedBiprediction     =  0     # B picture Weighted Prediciton (0=off, 1=explicit mode,  2=implicit mode)
222ChromaWeightSupport      =  1     # Enable consideration of weights for Chroma components
223UseWeightedReferenceME   =  1     # Use weighted reference for ME (0=off, 1=on)
224WPMethod                 =  1     # WP method (0: DC based, 1: LMS based)
225WPIterMC                 =  0     # Iterative Motion compensated based weighted prediction method
226EnhancedBWeightSupport   =  0     # Enhanced B Weight support (needs revisit if we wish to merge with WPMethod)
227WPMCPrecision            =  0     # Improved Motion Compensation Precision using WP based methods.
228                                  # Clones WP references with slightly modified rounding offsets (Requires RDPictureDecision and GenerateMultiplePPS) :
229                                  # 0: disabled (default)
230                                  # 1: Up to one additional coding pass. Ref0 is 0, ref1 is 0 with a -1 offset
231                                  # 2: Up to two additional coding passes. (1) Ref0 is 0, ref1 is 0 with a -1 offset, (1) Ref0 is 0 with a -1 offset, ref1 is 0
232WPMCPrecFullRef          =  0     # Increases the number of references in the reference picture lists to account
233                                  # for the lost reference slot when reordering is used during a coding pass in WPMCPrecision for reference replication.
234                                  # The number of references in non-reordered passes stays unchanged
235WPMCPrecBSlice           =  1     # 2: Apply rounding on every B slice. This efectively disables the evaluation of alternative QPs during RDPictureDecision.
236                                  # 1: Disable rounding for non-reference B slices. Non-reference B slices are evaluated for alternative QPs during RDPictureDecision.
237                                  # 0: Disable rounding for B slices.
238
239##########################################################################################
240# Picture based Multi-pass encoding
241#########################################################################################
242
243RDPictureDecision        =  0     # Perform multiple pass coding and make RD optimal decision among them
244RDPSliceBTest            =  0     # Perform Slice level RD decision between P and B slices.
245RDPictureMaxPassISlice   =  1     # Max number of coding passes for I slices, valid values [1,3], default is 1
246RDPictureMaxPassPSlice   =  2     # Max number of coding passes for P slices, valid values [1,6], default is 2
247RDPictureMaxPassBSlice   =  3     # Max number of coding passes for B slices, valid values [1,6], default is 3
248RDPictureFrameQPPSlice   =  0     # Perform additional frame level QP check (QP+/-1) for P slices, 0: disabled (default), 1: enabled
249RDPictureFrameQPBSlice   =  0     # Perform additional frame level QP check (QP+/-1) for B slices, 0: disabled, 1: enabled (default)
250RDPictureDeblocking      =  0     # Perform another coding pass to check non-deblocked picture, 0: disabled (default), 1: enabled
251RDPictureDirectMode      =  0     # Perform another coding pass to check the alternative direct mode for B slices, , 0: disabled (default), 1: enabled
252
253##########################################################################################
254# Deblocking filter parameters
255##########################################################################################
256
257DFParametersFlag         = 0      # Configure deblocking filter (0=parameters below ignored, 1=parameters sent)
258                                  # Note that for pictures with multiple slice types,
259                                  # only the type of the first slice will be considered.
260DFDisableRefISlice       = 0      # Disable deblocking filter in reference I coded pictures (0=Filter, 1=No Filter).
261DFAlphaRefISlice         = 0      # Reference I coded pictures Alpha offset div. 2, {-6, -5, ... 0, +1, .. +6}
262DFBetaRefISlice          = 0      # Reference I coded pictures Beta offset div. 2, {-6, -5, ... 0, +1, .. +6}
263DFDisableNRefISlice      = 0      # Disable deblocking filter in non reference I coded pictures (0=Filter, 1=No Filter).
264DFAlphaNRefISlice        = 0      # Non Reference I coded pictures Alpha offset div. 2, {-6, -5, ... 0, +1, .. +6}
265DFBetaNRefISlice         = 0      # Non Reference I coded pictures Beta offset div. 2, {-6, -5, ... 0, +1, .. +6}
266DFDisableRefPSlice       = 0      # Disable deblocking filter in reference P coded pictures (0=Filter, 1=No Filter).
267DFAlphaRefPSlice         = 0      # Reference P coded pictures Alpha offset div. 2, {-6, -5, ... 0, +1, .. +6}
268DFBetaRefPSlice          = 0      # Reference P coded pictures Beta offset div. 2, {-6, -5, ... 0, +1, .. +6}
269DFDisableNRefPSlice      = 0      # Disable deblocking filter in non reference P coded pictures (0=Filter, 1=No Filter).
270DFAlphaNRefPSlice        = 0      # Non Reference P coded pictures Alpha offset div. 2, {-6, -5, ... 0, +1, .. +6}
271DFBetaNRefPSlice         = 0      # Non Reference P coded pictures Beta offset div. 2, {-6, -5, ... 0, +1, .. +6}
272DFDisableRefBSlice       = 0      # Disable deblocking filter in reference B coded pictures (0=Filter, 1=No Filter).
273DFAlphaRefBSlice         = 0      # Reference B coded pictures Alpha offset div. 2, {-6, -5, ... 0, +1, .. +6}
274DFBetaRefBSlice          = 0      # Reference B coded pictures Beta offset div. 2, {-6, -5, ... 0, +1, .. +6}
275DFDisableNRefBSlice      = 0      # Disable deblocking filter in non reference B coded pictures (0=Filter, 1=No Filter).
276DFAlphaNRefBSlice        = 0      # Non Reference B coded pictures Alpha offset div. 2, {-6, -5, ... 0, +1, .. +6}
277DFBetaNRefBSlice         = 0      # Non Reference B coded pictures Beta offset div. 2, {-6, -5, ... 0, +1, .. +6}
278
279##########################################################################################
280# Error Resilience / Slices
281##########################################################################################
282
283SliceMode             =  0   # Slice mode (0=off 1=fixed #mb in slice 2=fixed #bytes in slice 3=use callback)
284SliceArgument         = 50   # Slice argument (Arguments to modes 1 and 2 above)
285
286num_slice_groups_minus1 = 0  # Number of Slice Groups Minus 1, 0 == no FMO, 1 == two slice groups, etc.
287slice_group_map_type    = 0  # 0:  Interleave, 1: Dispersed,    2: Foreground with left-over,
288                             # 3:  Box-out,    4: Raster Scan   5: Wipe
289                             # 6:  Explicit, slice_group_id read from SliceGroupConfigFileName
290slice_group_change_direction_flag = 0    # 0: box-out clockwise, raster scan or wipe right,
291                                         # 1: box-out counter clockwise, reverse raster scan or wipe left
292slice_group_change_rate_minus1    = 85   #
293SliceGroupConfigFileName          = "sg0conf.cfg"   # Used for slice_group_map_type 0, 2, 6
294
295UseRedundantPicture   = 0    # 0: not used, 1: enabled
296NumRedundantHierarchy = 1    # 0-4
297PrimaryGOPLength      = 10   # GOP length for redundant allocation (1-16)
298                             # NumberReferenceFrames must be no less than PrimaryGOPLength when redundant slice enabled
299NumRefPrimary         = 1    # Actually used number of references for primary slices (1-16)
300
301##########################################################################################
302# Search Range Restriction / RD Optimization
303##########################################################################################
304
305RestrictSearchRange    =  2  # restriction for (0: blocks and ref, 1: ref, 2: no restrictions)
306RDOptimization         =  1  # rd-optimized mode decision
307                             # 0: RD-off (Low complexity mode)
308                             # 1: RD-on (High complexity mode)
309                             # 2: RD-on (Fast high complexity mode - not work in FREX Profiles)
310                             # 3: with losses
311                             # 4: RD-on (High complexity mode) with negative skip bias
312I16RDOpt               =  0  # perform rd-optimized mode decision for Intra 16x16 MB
313                             # 0: SAD-based mode decision for Intra 16x16 MB
314                             # 1: RD-based mode decision for Intra 16x16 MB
315SubMBCodingState       =  1  # submacroblock coding state
316                             # 0: lowest complexity, do not store or reset coding state during sub-MB mode decision
317                             # 1: medium complexity, reset to master coding state (for current mode) during sub-MB mode decision
318                             # 2: highest complexity, store and reset coding state during sub-MB mode decision
319DistortionSSIM         =  0  # Compute SSIM distortion. (0: disabled/default, 1: enabled)
320DistortionMS_SSIM      =  0  # Compute Multiscale SSIM distortion. (0: disabled/default, 1: enabled)
321SSIMOverlapSize        =  8  # Overlap size to calculate SSIM distortion (1: pixel by pixel, 8: no overlap)
322DistortionYUVtoRGB     =  0  # Calculate distortion in RGB domain after conversion from YCbCr (0:off, 1:on)
323CtxAdptLagrangeMult    =  0  # Context Adaptive Lagrange Multiplier
324                             # 0: disabled (default)
325                             # 1: enabled (works best when RDOptimization=0)
326FastCrIntraDecision    =  1  # Fast Chroma intra mode decision (0:off, 1:on)
327DisableThresholding    =  0  # Disable Thresholding of Transform Coefficients (0:off, 1:on)
328DisableBSkipRDO        =  0  # Disable B Skip Mode consideration from RDO Mode decision (0:off, 1:on)
329BiasSkipRDO            =  0  # Negative Bias for Skip/DirectSkip modes (0: off, 1: on)
330ForceTrueRateRDO       =  0  # Force true rate (even zero values) during RDO process
331SkipIntraInInterSlices =  0  # Skips Intra mode checking in inter slices if certain mode decisions are satisfied (0: off, 1: on)
332WeightY                =  1  # Luma weight for RDO
333WeightCb               =  1  # Cb weight for RDO
334WeightCr               =  1  # Cr weight for RDO
335
336##########################################################################################
337# Explicit Lambda Usage
338##########################################################################################
339UseExplicitLambdaParams  =  0    # Use explicit lambda scaling parameters (0:disabled, 1:enable lambda weight, 2: use explicit lambda value)
340UpdateLambdaChromaME     =  0    # Update lambda given Chroma ME consideration
341FixedLambdaISlice        =  0.1  # Fixed Lambda value for I slices
342FixedLambdaPSlice        =  0.1  # Fixed Lambda value for P slices
343FixedLambdaBSlice        =  0.1  # Fixed Lambda value for B slices
344FixedLambdaRefBSlice     =  0.1  # Fixed Lambda value for Referenced B slices
345FixedLambdaSPSlice       =  0.1  # Fixed Lambda value for SP slices
346FixedLambdaSISlice       =  0.1  # Fixed Lambda value for SI slices
347
348LambdaWeightISlice       =  0.65 # scaling param for I slices. This will be used as a multiplier i.e. lambda=LambdaWeightISlice * 2^((QP-12)/3)
349LambdaWeightPSlice       =  0.68 # scaling param for P slices. This will be used as a multiplier i.e. lambda=LambdaWeightPSlice * 2^((QP-12)/3)
350LambdaWeightBSlice       =  0.68 # scaling param for B slices. This will be used as a multiplier i.e. lambda=LambdaWeightBSlice * 2^((QP-12)/3)
351LambdaWeightRefBSlice    =  0.68 # scaling param for Referenced B slices. This will be used as a multiplier i.e. lambda=LambdaWeightRefBSlice * 2^((QP-12)/3)
352LambdaWeightSPSlice      =  0.68 # scaling param for SP slices. This will be used as a multiplier i.e. lambda=LambdaWeightSPSlice * 2^((QP-12)/3)
353LambdaWeightSISlice      =  0.65 # scaling param for SI slices. This will be used as a multiplier i.e. lambda=LambdaWeightSISlice * 2^((QP-12)/3)
354
355LossRateA                =  5  # expected packet loss rate of the channel for the first partition, only valid if RDOptimization = 3
356LossRateB                =  0  # expected packet loss rate of the channel for the second partition, only valid if RDOptimization = 3
357LossRateC                =  0  # expected packet loss rate of the channel for the third partition, only valid if RDOptimization = 3
358FirstFrameCorrect        =  0  # If 1, the first frame is encoded under the assumption that it is always correctly received.
359NumberOfDecoders         = 30  # Numbers of decoders used to simulate the channel, only valid if RDOptimization = 3
360RestrictRefFrames        =  0  # Doesnt allow reference to areas that have been intra updated in a later frame.
361
362##########################################################################################
363# Additional Stuff
364#########################################################################################
365
366UseConstrainedIntraPred  =  0  # If 1, Inter pixels are not used for Intra macroblock prediction.
367
368NumberofLeakyBuckets     =  8                      # Number of Leaky Bucket values
369LeakyBucketRateFile      =  "leakybucketrate.cfg"  # File from which encoder derives rate values
370LeakyBucketParamFile     =  "leakybucketparam.cfg" # File where encoder stores leakybucketparams
371
372NumFramesInELayerSubSeq  = 0  # number of frames in the Enhanced Scalability Layer(0: no Enhanced Layer)
373
374SparePictureOption        =  0   # (0: no spare picture info, 1: spare picture available)
375SparePictureDetectionThr  =  6   # Threshold for spare reference pictures detection
376SparePicturePercentageThr = 92   # Threshold for the spare macroblock percentage
377
378PicOrderCntType           = 0    # (0: POC mode 0, 1: POC mode 1, 2: POC mode 2)
379
380########################################################################################
381#Rate control
382########################################################################################
383
384RateControlEnable       = 0     # 0 Disable, 1 Enable
385Bitrate                 = 45020 # Bitrate(bps)
386InitialQP               = 0     # Initial Quantization Parameter for the first I frame
387                                # InitialQp depends on two values: Bits Per Picture,
388                                # and the GOP length
389BasicUnit               = 0     # Number of MBs in the basic unit
390                                # should be a fraction of the total number
391                                # of MBs in a frame ("0" sets a BU equal to a frame)
392ChannelType             = 0     # type of channel( 1=time varying channel; 0=Constant channel)
393RCUpdateMode            = 0     # Rate Control type. Modes supported :
394                                # 0 = original JM rate control,
395                                # 1 = rate control that is applied to all frames regardless of the slice type,
396                                # 2 = original plus intelligent QP selection for I and B slices (including Hierarchical),
397                                # 3 = original + hybrid quadratic rate control for I and B slice using bit rate statistics
398                                #
399RCISliceBitRatio        = 1.0   # target ratio of bits for I-coded pictures compared to P-coded Pictures (for RCUpdateMode=3)
400RCBSliceBitRatio0       = 0.5   # target ratio of bits for B-coded pictures compared to P-coded Pictures - temporal level 0 (for RCUpdateMode=3)
401RCBSliceBitRatio1       = 0.25  # target ratio of bits for B-coded pictures compared to P-coded Pictures - temporal level 1 (for RCUpdateMode=3)
402RCBSliceBitRatio2       = 0.25  # target ratio of bits for B-coded pictures compared to P-coded Pictures - temporal level 2 (for RCUpdateMode=3)
403RCBSliceBitRatio3       = 0.25  # target ratio of bits for B-coded pictures compared to P-coded Pictures - temporal level 3 (for RCUpdateMode=3)
404RCBSliceBitRatio4       = 0.25  # target ratio of bits for B-coded pictures compared to P-coded Pictures - temporal level 4 (for RCUpdateMode=3)
405RCBoverPRatio           = 0.45  # ratio of bit rate usage of a B-coded picture over a P-coded picture for the SAME QP (for RCUpdateMode=3)
406RCIoverPRatio           = 3.80  # ratio of bit rate usage of an I-coded picture over a P-coded picture for the SAME QP (for RCUpdateMode=3)
407RCMinQPPSlice           =  8    # minimum P Slice QP value for rate control
408RCMaxQPPSlice           = 42    # maximum P Slice QP value for rate control
409RCMinQPBSlice           =  8    # minimum B Slice QP value for rate control
410RCMaxQPBSlice           = 42    # maximum B Slice QP value for rate control
411RCMinQPISlice           =  8    # minimum I Slice QP value for rate control
412RCMaxQPISlice           = 42    # maximum I Slice QP value for rate control
413RCMinQPSPSlice          =  8    # minimum SP Slice QP value for rate control
414RCMaxQPSPSlice          = 40    # maximum SP Slice QP value for rate control
415RCMinQPSISlice          =  8    # minimum SI Slice QP value for rate control
416RCMaxQPSISlice          = 42    # maximum SI Slice QP value for rate control
417RCMaxQPChange           =  4    # maximum QP change for frames of the base layer
418
419########################################################################################
420#Fast Mode Decision
421########################################################################################
422EarlySkipEnable         = 0     # Early skip detection (0: Disable 1: Enable)
423SelectiveIntraEnable    = 0     # Selective Intra mode decision (0: Disable 1: Enable)
424
425########################################################################################
426#FREXT stuff
427########################################################################################
428
429YUVFormat               = 2     # YUV format (0=4:0:0, 1=4:2:0, 2=4:2:2, 3=4:4:4)
430RGBInput                = 0     # 1=RGB input, 0=GBR or YUV input
431SeparateColourPlane     = 0     # 4:4:4 coding: 0=Common mode, 1=Independent mode
432SourceBitDepthLuma      = 8     # Source Bit Depth for Luma color component (8...14 bits)
433SourceBitDepthChroma    = 8     # Source Bit Depth for Chroma color components (8...14 bits)
434SourceBitDepthRescale   = 0     # Rescale bit depth of source for output (0: Disable 1: Enable)
435OutputBitDepthLuma      = 8     # Output Bit Depth for Luma color component (8...14 bits)
436OutputBitDepthChroma    = 8     # Output Bit Depth for Chroma color components (8...14 bits)
437
438CbQPOffset              = 0     # Chroma QP offset for Cb-part (-51..51)
439CrQPOffset              = 0     # Chroma QP offset for Cr-part (-51..51)
440Transform8x8Mode        = 1     # (0: only 4x4 transform, 1: allow using 8x8 transform additionally, 2: only 8x8 transform)
441ReportFrameStats        = 0     # (0:Disable Frame Statistics 1: Enable)
442DisplayEncParams        = 0     # (0:Disable Display of Encoder Params 1: Enable)
443Verbose                 = 1     # level of display verboseness
444                                # 0: short, 1: normal (default), 2: detailed, 3: detailed/nvb
445SkipGlobalStats         = 0     # Disable global stat accumulation  (Set to 1 to avoid bipred core dump)
446
447########################################################################################
448#Q-Matrix (FREXT)
449########################################################################################
450QmatrixFile              = "q_matrix.cfg"
451
452ScalingMatrixPresentFlag = 0    # Enable Q_Matrix  (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
453ScalingListPresentFlag0  = 3    # Intra4x4_Luma    (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
454ScalingListPresentFlag1  = 3    # Intra4x4_ChromaU (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
455ScalingListPresentFlag2  = 3    # Intra4x4_chromaV (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
456ScalingListPresentFlag3  = 3    # Inter4x4_Luma    (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
457ScalingListPresentFlag4  = 3    # Inter4x4_ChromaU (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
458ScalingListPresentFlag5  = 3    # Inter4x4_ChromaV (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
459ScalingListPresentFlag6  = 3    # Intra8x8_Luma    (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
460ScalingListPresentFlag7  = 3    # Inter8x8_Luma    (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
461ScalingListPresentFlag8  = 3    # Intra8x8_ChromaU for 4:4:4 (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
462ScalingListPresentFlag9  = 3    # Inter8x8_ChromaU for 4:4:4 (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
463ScalingListPresentFlag10 = 3    # Intra8x8_ChromaV for 4:4:4 (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
464ScalingListPresentFlag11 = 3    # Inter8x8_ChromaV for 4:4:4 (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
465
466########################################################################################
467#Rounding Offset control
468########################################################################################
469
470OffsetMatrixPresentFlag  = 1    # Enable Explicit Offset Quantization Matrices  (0: disable 1: enable)
471QOffsetMatrixFile        = "q_offset.cfg" # Explicit Quantization Matrices file
472
473AdaptiveRounding         = 1    # Enable Adaptive Rounding based on JVT-N011 (0: disable, 1: enable)
474AdaptRoundingFixed       = 1    # Enable Global Adaptive rounding for all qps (0: disable, 1: enable - default/old)
475AdaptRndPeriod           = 16   # Period in terms of MBs for updating rounding offsets.
476                                # 0 performs update at the picture level. Default is 16. 1 is as in JVT-N011.
477AdaptRndChroma           = 1    # Enables coefficient rounding adaptation for chroma
478
479AdaptRndWFactorIRef      = 4    # Adaptive Rounding Weight for I/SI slices in reference pictures /4096
480AdaptRndWFactorPRef      = 4    # Adaptive Rounding Weight for P/SP slices in reference pictures /4096
481AdaptRndWFactorBRef      = 4    # Adaptive Rounding Weight for B slices in reference pictures /4096
482AdaptRndWFactorINRef     = 4    # Adaptive Rounding Weight for I/SI slices in non reference pictures /4096
483AdaptRndWFactorPNRef     = 4    # Adaptive Rounding Weight for P/SP slices in non reference pictures /4096
484AdaptRndWFactorBNRef     = 4    # Adaptive Rounding Weight for B slices in non reference pictures /4096
485
486AdaptRndCrWFactorIRef    = 4    # Chroma Adaptive Rounding Weight for I/SI slices in reference pictures /4096
487AdaptRndCrWFactorPRef    = 4    # Chroma Adaptive Rounding Weight for P/SP slices in reference pictures /4096
488AdaptRndCrWFactorBRef    = 4    # Chroma Adaptive Rounding Weight for B slices in reference pictures /4096
489AdaptRndCrWFactorINRef   = 4    # Chroma Adaptive Rounding Weight for I/SI slices in non reference pictures /4096
490AdaptRndCrWFactorPNRef   = 4    # Chroma Adaptive Rounding Weight for P/SP slices in non reference pictures /4096
491AdaptRndCrWFactorBNRef   = 4    # Chroma Adaptive Rounding Weight for B slices in non reference pictures /4096
492
493################################################################
494# Rate Distortion Optimized Quantization
495################################################################
496UseRDOQuant              =  0 # Use Rate Distortion Optimized Quantization (0=disable, 1=enable)
497RDOQ_DC                  =  0 # Enable Rate Distortion Optimized Quantization for DC components (0=disable, 1=enable)
498RDOQ_CR                  =  0 # Enable Rate Distortion Optimized Quantization for Chroma components (0=disable, 1=enable)
499RDOQ_DC_CR               =  0 # Enable Rate Distortion Optimized Quantization for Chroma DC components (0=disable, 1=enable)
500RDOQ_QP_Num              =  1 # 1-9: Number of QP tested in RDO_Q (I/P/B slice)
501RDOQ_CP_Mode             =  1 # copy Mode from first QP tested
502RDOQ_CP_MV               =  1 # copy MV from first QP tested
503RDOQ_Fast                =  1 # Fast RDOQ decision method for multiple QPs
504
505########################################################################################
506#Lossless Coding (FREXT)
507########################################################################################
508
509LosslessCoding           = 0    # Enable lossless coding when qpprime_y is zero (0 Disabled, 1 Enabled)
510
511########################################################################################
512#Fast Motion Estimation Control Parameters
513########################################################################################
514
515SearchMode               = 0    # Motion estimation mode
516                                # -1 = Full Search
517                                #  0 = Fast Full Search (default)
518                                #  1 = UMHexagon Search
519                                #  2 = Simplified UMHexagon Search
520                                #  3 = Enhanced Predictive Zonal Search (EPZS)
521
522UMHexDSR                 = 1    # Use Search Range Prediction. Only for UMHexagonS method
523                                # (0:disable, 1:enabled/default)
524UMHexScale               = 3    # Use Scale_factor for different image sizes. Only for UMHexagonS method
525                                # (0:disable, 3:/default)
526                                # Increasing value can speed up Motion Search.
527
528EPZSPattern              = 2    # Select EPZS primary refinement pattern.
529                                # (0: small diamond, 1: square, 2: extended diamond/default,
530                                # 3: large diamond, 4: SBP Large Diamond,
531                                # 5: PMVFAST )
532EPZSDualRefinement       = 3    # Enables secondary refinement pattern.
533                                # (0:disabled, 1: small diamond, 2: square,
534                                # 3: extended diamond/default, 4: large diamond,
535                                # 5: SBP Large Diamond, 6: PMVFAST )
536EPZSFixedPredictors      = 2    # Enables Window based predictors
537                                # (0:disabled, 1: P only, 2: P and B/default)
538EPZSAggressiveWindow     = 0    # Use Aggressive Window pattern for EPZS (0: disabled, 1: enabled)
539EPZSTemporal             = 1    # Enables temporal predictors
540                                # (0: disabled, 1: enabled/default)
541EPZSSpatialMem           = 1    # Enables spatial memory predictors
542                                # (0: disabled, 1: enabled/default)
543EPZSBlockType            = 1    # Enables block type Predictors
544                                # (0: disabled, 1: enabled/default)
545EPZSMinThresScale        = 0    # Scaler for EPZS minimum threshold (0 default).
546                                # Increasing value can speed up encoding.
547EPZSMedThresScale        = 1    # Scaler for EPZS median threshold (1 default).
548                                # Increasing value can speed up encoding.
549EPZSMaxThresScale        = 2    # Scaler for EPZS maximum threshold (1 default).
550                                # Increasing value can speed up encoding.
551EPZSSubPelME             = 1    # EPZS Subpel ME consideration
552EPZSSubPelMEBiPred       = 1    # EPZS Subpel ME consideration for BiPred partitions
553EPZSSubPelThresScale     = 2    # EPZS Subpel ME Threshold scaler
554EPZSSubPelGrid           = 1    # Perform EPZS using a subpixel grid
555
556########################################################################################
557# SEI Parameters
558########################################################################################
559
560ToneMappingSEIPresentFlag = 0    # Enable Tone mapping SEI  (0 Not present, 1 Present)
561ToneMappingFile           = "ToneMapping.cfg"
562
563GenerateSEIMessage        = 0                    # Generate an SEI Text Message
564SEIMessageText            = "H.264/AVC Encoder"  # Text SEI Message
565
566UseMVLimits               = 0                    # Use MV Limits
567SetMVXLimit               = 512                  # Horizontal MV Limit (in integer units)
568SetMVYLimit               = 512                  # Vertical MV Limit (in integer units)
569
570########################################################################################
571# VUI Parameters
572########################################################################################
573# the variables below do not affect encoding and decoding
574# (many are dummy variables but others can be useful when supported by the decoder)
575
576EnableVUISupport                                = 0      # Enable VUI Parameters
577
578# display parameters
579VUI_aspect_ratio_info_present_flag              = 0
580VUI_aspect_ratio_idc                            = 1
581VUI_sar_width                                   = 0
582VUI_sar_height                                  = 0
583VUI_overscan_info_present_flag                  = 0
584VUI_overscan_appropriate_flag                   = 0
585VUI_video_signal_type_present_flag              = 0
586VUI_video_format                                = 5
587VUI_video_full_range_flag                       = 0
588VUI_colour_description_present_flag             = 0
589VUI_colour_primaries                            = 2
590VUI_transfer_characteristics                    = 2
591VUI_matrix_coefficients                         = 2
592VUI_chroma_location_info_present_flag           = 0
593VUI_chroma_sample_loc_type_top_field            = 0
594VUI_chroma_sample_loc_type_bottom_field         = 0
595VUI_timing_info_present_flag                    = 0
596VUI_num_units_in_tick                           = 1000
597VUI_time_scale                                  = 60000
598VUI_fixed_frame_rate_flag                       = 0
599
600# nal hrd parameters
601VUI_nal_hrd_parameters_present_flag             = 0
602VUI_nal_cpb_cnt_minus1                          = 0
603VUI_nal_bit_rate_scale                          = 0
604VUI_nal_cpb_size_scale                          = 0
605VUI_nal_bit_rate_value_minus1                   = 0
606VUI_nal_cpb_size_value_minus1                   = 0
607VUI_nal_vbr_cbr_flag                            = 0
608VUI_nal_initial_cpb_removal_delay_length_minus1 = 23
609VUI_nal_cpb_removal_delay_length_minus1         = 23
610VUI_nal_dpb_output_delay_length_minus1          = 23
611VUI_nal_time_offset_length                      = 24
612
613# vlc hrd parameters
614VUI_vcl_hrd_parameters_present_flag             = 0
615VUI_vcl_cpb_cnt_minus1                          = 0
616VUI_vcl_bit_rate_scale                          = 0
617VUI_vcl_cpb_size_scale                          = 0
618VUI_vcl_bit_rate_value_minus1                   = 0
619VUI_vcl_cpb_size_value_minus1                   = 0
620VUI_vcl_vbr_cbr_flag                            = 0
621VUI_vcl_initial_cpb_removal_delay_length_minus1 = 23
622VUI_vcl_cpb_removal_delay_length_minus1         = 23
623VUI_vcl_dpb_output_delay_length_minus1          = 23
624VUI_vcl_time_offset_length                      = 24
625VUI_low_delay_hrd_flag                          = 0
626
627# other parameters (i.e. bitsream restrictions)
628VUI_pic_struct_present_flag                     = 0
629VUI_bitstream_restriction_flag                  = 0
630VUI_motion_vectors_over_pic_boundaries_flag     = 1
631VUI_max_bytes_per_pic_denom                     = 0
632VUI_max_bits_per_mb_denom                       = 0
633VUI_log2_max_mv_length_vertical                 = 16
634VUI_log2_max_mv_length_horizontal               = 16
635VUI_num_reorder_frames                          = 16
636VUI_max_dec_frame_buffering                     = 16
637
638