[Mp4-tech] [H.264] JM 10.1 fully compliant to specs?
Alejandro Moya
almomo1 gmail.com
Fri Jan 27 13:05:52 EST 2006
Hi again!
I have just coded a QCIF sequence with "lencod.exe" (JM 10.1) and when
analyzing the decoding process with ldecod.exe (JM 10.1) I realized that one
slice had QPy = 52, as *pic_init_qp_minus26 *at active picture header was 0
and *slice_qp_delta* coded in the slice header was 26, so *QPy = 26 +
pic_init_qp_minus26 + slice_qp_delta = 52* (equation 7-16); that value
exceeds the limit the maximum range [0, 51] imposed just below that equation
in the standard. JM decoder ignores that constraint and keeps decoding the
first macroblocks, as they are skipped; but anyway... shouldn't be JM
encoder fully compatible and output all syntax values limited as the
standard states, although they aren't use in the decoding process?
Here it is "encoder.cfg" I used to encode:
# New Input File Format is as follows
# <ParameterName> = <ParameterValue> # Comment
#
# See configfile.h for a list of supported ParameterNames
##########################################################################################
# Files
##########################################################################################
InputFile = "one.yuv" # Input sequence
InputHeaderLength = 0 # If the inputfile has a header, state it's
length in byte here
StartFrame = 3000 # Start frame for encoding. (0-N)
FramesToBeEncoded = 500 # Number of frames to be coded
FrameRate = 25.0 # Frame Rate per second (0.1-100.0)
SourceWidth = 176 # Frame width
SourceHeight = 144 # Frame height
TraceFile = "trace_enc.txt"
ReconFile = "one_rec.yuv"
OutputFile = "one.264"
##########################################################################################
# Encoder Control
##########################################################################################
ProfileIDC = 77 # Profile IDC (66=baseline, 77=main,
88=extended; FREXT Profiles: 100=High, 110=High 10, 122=High 4:2:2, 144=High
4:4:4, for params see below)
LevelIDC = 40 # Level IDC (e.g. 20 = level 2.0)
IntraPeriod = 0 # Period of I-Frames (0=only first)
EnableOpenGOP = 0 # Support for open GOPs (0: disabled, 1:
enabled)
IDRIntraEnable = 0 # Force IDR Intra (0=disable 1=enable)
QPISlice = 28 # Quant. param for I Slices (0-51)
QPPSlice = 28 # Quant. param for P Slices (0-51)
FrameSkip = 0 # Number of frames to be skipped in input (e.g 2
will code every third frame)
ChromaQPOffset = 0 # Chroma QP offset (-51..51)
UseHadamard = 1 # Hadamard transform (0=not used, 1=used for all
subpel positions, 2=use only for qpel)
DisableSubpelME = 1 # Disable Subpixel Motion Estimation
(0=off/default, 1=on)
SearchRange = 64 # Max search range
NumberReferenceFrames = 8 # Number of previous frames used for inter
motion search (1-16)
PList0References = 0 # P slice List 0 reference override (0 disable,
N <= NumberReferenceFrames)
Log2MaxFNumMinus4 = 0 # Sets log2_max_frame_num_minus4 (-1 : based on
FramesToBeEncoded/Auto, >=0 : Log2MaxFNumMinus4)
Log2MaxPOCLsbMinus4 = -1 # Sets log2_max_pic_order_cnt_lsb_minus4 (-1 :
Auto, >=0 : Log2MaxPOCLsbMinus4)
GenerateMultiplePPS = 0 # Transmit multiple parameter sets. Currently
parameters basically enable all WP modes (0: diabled, 1: enabled)
ResendPPS = 0 # Resend PPS (with pic_parameter_set_id 0) for
every coded Frame/Field pair (0: disabled, 1: enabled)
MbLineIntraUpdate = 0 # Error robustness(extra intra macro block
updates)(0=off, N: One GOB every N frames are intra coded)
RandomIntraMBRefresh = 0 # Forced intra MBs per picture
InterSearch16x16 = 1 # Inter block search 16x16 (0=disable, 1=enable)
InterSearch16x8 = 1 # Inter block search 16x8 (0=disable, 1=enable)
InterSearch8x16 = 1 # Inter block search 8x16 (0=disable, 1=enable)
InterSearch8x8 = 1 # Inter block search 8x8 (0=disable, 1=enable)
InterSearch8x4 = 1 # Inter block search 8x4 (0=disable, 1=enable)
InterSearch4x8 = 1 # Inter block search 4x8 (0=disable, 1=enable)
InterSearch4x4 = 1 # Inter block search 4x4 (0=disable, 1=enable)
IntraDisableInterOnly = 0 # Apply Disabling Intra conditions only to Inter
Slices (0:disable/default,1: enable)
Intra4x4ParDisable = 0 # Disable Vertical & Horizontal 4x4
Intra4x4DiagDisable = 0 # Disable Diagonal 45degree 4x4
Intra4x4DirDisable = 0 # Disable Other Diagonal 4x4
Intra16x16ParDisable = 0 # Disable Vertical & Horizontal 16x16
Intra16x16PlaneDisable = 0 # Disable Planar 16x16
ChromaIntraDisable = 0 # Disable Intra Chroma modes other than DC
DisposableP = 0 # Enable Disposable P slices in the primary
layer (0: disable/default, 1: enable)
DispPQPOffset = 0 # Quantizer offset for disposable P slices (0:
default)
##########################################################################################
# B Slices
##########################################################################################
NumberBFrames = 0 # Number of B coded frames inserted (0=not
used)
QPBSlice = 30 # Quant. param for B slices (0-51)
BRefPicQPOffset = 0 # Quantization offset for reference B coded
pictures (-51..51)
DirectModeType = 1 # Direct Mode Type (0:Temporal 1:Spatial)
DirectInferenceFlag = 1 # Direct Inference Flag (0: Disable 1: Enable)
BList0References = 0 # B slice List 0 reference override (0 disable,
N <= NumberReferenceFrames)
BList1References = 1 # B slice List 1 reference override (0 disable,
N <= NumberReferenceFrames)
# 1 List1 reference is usually recommended for
normal GOP Structures.
# A larger value is usually more appropriate if
a more flexible
# structure is used (i.e. using PyramidCoding)
BReferencePictures = 0 # Referenced B coded pictures (0=off, 1=on)
PyramidCoding = 0 # B pyramid (0= off, 1= 2 layers, 2= 2 full
pyramid, 3 = explicit)
PyramidLevelQPEnable = 1 # Adjust QP based on Pyramid Level (in
increments of 1). Overrides BRefPicQPOffset behavior.(0=off, 1=on)
ExplicitPyramidFormat = "b2r28b0e30b1e30b3e30b4e30" # Explicit Enhancement
GOP. Format is {FrameDisplay_orderReferenceQP}.
# Valid values for
reference type is r:reference, e:non reference.
PyramidRefReorder = 1 # Reorder References according to Poc distance
for PyramidCoding (0=off, 1=enable)
PocMemoryManagement = 1 # Memory management based on Poc Distances for
PyramidCoding (0=off, 1=on)
BiPredMotionEstimation = 0 # Enable Bipredictive based Motion Estimation
(0:disabled, 1:enabled)
BiPredMERefinements = 3 # Bipredictive ME extra refinements (0: single,
N: N extra refinements (1 default)
BiPredMESearchRange = 16 # Bipredictive ME Search range (8 default).
Note that range is halved for every extra refinement.
BiPredMESubPel = 1 # Bipredictive ME Subpixel Consideration (0:
disabled, 1: single level, 2: dual level)
##########################################################################################
# SP Frames
##########################################################################################
SPPicturePeriodicity = 0 # SP-Picture Periodicity (0=not used)
QPSPSlice = 28 # Quant. param of SP-Slices for Prediction Error
(0-51)
QPSP2Slice = 27 # Quant. param of SP-Slices for Predicted Blocks
(0-51)
##########################################################################################
# Output Control, NALs
##########################################################################################
SymbolMode = 1 # Symbol mode (Entropy coding method: 0=UVLC,
1=CABAC)
OutFileMode = 0 # Output file mode, 0:Annex B, 1:RTP
PartitionMode = 0 # Partition Mode, 0: no DP, 1: 3 Partitions per
Slice
##########################################################################################
# CABAC context initialization
##########################################################################################
ContextInitMethod = 1 # Context init (0: fixed, 1: adaptive)
FixedModelNumber = 0 # model number for fixed decision for
inter slices ( 0, 1, or 2 )
##########################################################################################
# Interlace Handling
#########################################################################################
PicInterlace = 0 # Picture AFF (0: frame coding, 1:
field coding, 2:adaptive frame/field coding)
MbInterlace = 0 # Macroblock AFF (0: frame coding, 1:
field coding, 2:adaptive frame/field coding)
IntraBottom = 0 # Force Intra Bottom at GOP Period
##########################################################################################
# Weighted Prediction
#########################################################################################
WeightedPrediction = 0 # P picture Weighted Prediction (0=off,
1=explicit mode)
WeightedBiprediction = 0 # B picture Weighted Prediciton (0=off,
1=explicit mode, 2=implicit mode)
UseWeightedReferenceME = 0 # Use weighted reference for ME (0=off,
1=on)
##########################################################################################
# Picture based Multi-pass encoding
#########################################################################################
RDPictureDecision = 1 # Perform RD optimal decision between
different coded picture versions.
# If GenerateMultiplePPS is enabled then
this will test different WP methods.
# Otherwise it will test QP +-1 (0:
disabled, 1: enabled)
RDPictureIntra = 1 # Perform RD optimal decision also for
intra coded pictures (0: disabled (default), 1: enabled).
RDPSliceWeightOnly = 1 # Only consider Weighted Prediction for P
slices in Picture RD decision. (0: disabled, 1: enabled (default))
RDBSliceWeightOnly = 0 # Only consider Weighted Prediction for B
slices in Picture RD decision. (0: disabled (default), 1: enabled )
##########################################################################################
# Loop filter parameters
##########################################################################################
LoopFilterParametersFlag = 1 # Configure loop filter (0=parameter below
ingored, 1=parameters sent)
LoopFilterDisable = 1 # Disable loop filter in slice header
(0=Filter, 1=No Filter)
LoopFilterAlphaC0Offset = 0 # Alpha & C0 offset div. 2, {-6, -5, ...
0, +1, .. +6}
LoopFilterBetaOffset = 0 # Beta offset div. 2, {-6, -5, ... 0, +1,
.. +6}
##########################################################################################
# Error Resilience / Slices
##########################################################################################
SliceMode = 0 # Slice mode (0=off 1=fixed #mb in slice
2=fixed #bytes in slice 3=use callback)
SliceArgument = 50 # Slice argument (Arguments to modes 1 and 2
above)
num_slice_groups_minus1 = 0 # Number of Slice Groups Minus 1, 0 == no FMO,
1 == two slice groups, etc.
slice_group_map_type = 0 # 0: Interleave, 1: Dispersed, 2:
Foreground with left-over,
# 3: Box-out, 4: Raster Scan 5: Wipe
# 6: Explicit, slice_group_id read from
SliceGroupConfigFileName
slice_group_change_direction_flag = 0 # 0: box-out clockwise, raster scan
or wipe right,
# 1: box-out counter clockwise,
reverse raster scan or wipe left
slice_group_change_rate_minus1 = 85 #
SliceGroupConfigFileName = "sg0conf.cfg" # Used for
slice_group_map_type 0, 2, 6
UseRedundantSlice = 0 # 0: not used, 1: one redundant slice used for
each slice (other modes not supported yet)
##########################################################################################
# Search Range Restriction / RD Optimization
##########################################################################################
RestrictSearchRange = 2 # restriction for (0: blocks and ref, 1: ref, 2:
no restrictions)
RDOptimization = 1 # rd-optimized mode decision
# 0: RD-off (Low complexity mode)
# 1: RD-on (High complexity mode)
# 2: RD-on (Fast high complexity mode - not work
in FREX Profiles)
# 3: with losses
DisableThresholding = 0 # Disable Thresholding of Transform Coefficients
(0:off, 1:on)
DisableBSkipRDO = 0 # Disable B Skip Mode consideration from RDO Mode
decision (0:off, 1:on)
SkipIntraInInterSlices = 0 # Skips Intra mode checking in inter slices if
certain mode decisions are satisfied (0: off, 1: on)
# Explicit Lambda Usage
UseExplicitLambdaParams = 0 # Use explicit lambda scaling parameters
(0:disabled, 1:enabled)
LambdaWeightIslice = 0.65 # scaling param for I slices. This will be
used as a multiplier i.e. lambda=LambdaWeightISlice * 2^((QP-12)/3)
LambdaWeightPslice = 0.68 # scaling param for P slices. This will be
used as a multiplier i.e. lambda=LambdaWeightPSlice * 2^((QP-12)/3)
LambdaWeightBslice = 2.00 # scaling param for B slices. This will be
used as a multiplier i.e. lambda=LambdaWeightBSlice * 2^((QP-12)/3)
LambdaWeightRefBslice = 1.50 # scaling param for Referenced B slices.
This will be used as a multiplier i.e. lambda=LambdaWeightRefBSlice *
2^((QP-12)/3)
LambdaWeightSPslice = 1.50 # scaling param for SP slices. This will be
used as a multiplier i.e. lambda=LambdaWeightSPSlice * 2^((QP-12)/3)
LambdaWeightSIslice = 0.65 # scaling param for SI slices. This will be
used as a multiplier i.e. lambda=LambdaWeightSISlice * 2^((QP-12)/3)
LossRateA = 10 # expected packet loss rate of the channel for
the first partition, only valid if RDOptimization = 2
LossRateB = 0 # expected packet loss rate of the channel for
the second partition, only valid if RDOptimization = 2
LossRateC = 0 # expected packet loss rate of the channel for
the third partition, only valid if RDOptimization = 2
NumberOfDecoders = 30 # Numbers of decoders used to simulate the
channel, only valid if RDOptimization = 2
RestrictRefFrames = 0 # Doesnt allow reference to areas that have been
intra updated in a later frame.
##########################################################################################
# Additional Stuff
#########################################################################################
UseConstrainedIntraPred = 0 # If 1, Inter pixels are not used for Intra
macroblock prediction.
LastFrameNumber = 0 # Last frame number that have to be coded (0:
no effect)
ChangeQPI = 16 # QP (I-slices) for second part of sequence
(0-51)
ChangeQPP = 16 # QP (P-slices) for second part of sequence
(0-51)
ChangeQPB = 18 # QP (B-slices) for second part of sequence
(0-51)
ChangeQPBSRefOffset = 2 # QP offset (stored B-slices) for second
part of sequence (-51..51)
ChangeQPStart = 0 # Frame no. for second part of sequence (0:
no second part)
NumberofLeakyBuckets = 8 # Number of Leaky Bucket
values
LeakyBucketRateFile = "leakybucketrate.cfg" # File from which encoder
derives rate values
LeakyBucketParamFile = "leakybucketparam.cfg" # File where encoder
stores leakybucketparams
NumberFramesInEnhancementLayerSubSequence = 0 # number of frames in the
Enhanced Scalability Layer(0: no Enhanced Layer)
NumberOfFrameInSecondIGOP = 0 # Number of frames to be
coded in the second IGOP
SparePictureOption = 0 # (0: no spare picture info, 1: spare
picture available)
SparePictureDetectionThr = 6 # Threshold for spare reference pictures
detection
SparePicturePercentageThr = 92 # Threshold for the spare macroblock
percentage
PicOrderCntType = 0 # (0: POC mode 0, 1: POC mode 1, 2: POC
mode 2)
########################################################################################
#Rate control
########################################################################################
RateControlEnable = 1 # 0 Disable, 1 Enable
Bitrate = 50000 # Bitrate(bps)
InitialQP = 24 # Initial Quantization Parameter for the
first I frame
# InitialQp depends on two values: Bits Per
Picture,
# and the GOP length
BasicUnit = 11 # Number of MBs in the basic unit
# should be a fractor of the total number
# of MBs in a frame
ChannelType = 0 # type of channel( 1=time varying channel;
0=Constant channel)
########################################################################################
#Fast Mode Decision
########################################################################################
EarlySkipEnable = 0 # Early skip detection (0: Disable 1:
Enable)
SelectiveIntraEnable = 1 # Selective Intra mode decision (0: Disable
1: Enable)
########################################################################################
#FREXT stuff
########################################################################################
YUVFormat = 1 # YUV format (0=4:0:0, 1=4:2:0, 2=4:2:2,
3=4:4:4)
RGBInput = 0 # 1=RGB input, 0=GBR or YUV input
BitDepthLuma = 8 # Bit Depth for Luminance (8...12 bits)
BitDepthChroma = 8 # Bit Depth for Chrominance (8...12 bits)
CbQPOffset = 0 # Chroma QP offset for Cb-part (-51..51)
CrQPOffset = 0 # Chroma QP offset for Cr-part (-51..51)
Transform8x8Mode = 0 # (0: only 4x4 transform, 1: allow using 8x8
transform additionally, 2: only 8x8 transform)
ResidueTransformFlag = 0 # (0: no residue color transform 1: apply
residue color transform)
ReportFrameStats = 0 # (0:Disable Frame Statistics 1: Enable)
DisplayEncParams = 0 # (0:Disable Display of Encoder Params 1:
Enable)
Verbose = 1 # level of display verboseness (0:short,
1:normal, 2:detailed)
########################################################################################
#Q-Matrix (FREXT)
########################################################################################
QmatrixFile = "q_matrix.cfg"
ScalingMatrixPresentFlag = 0 # Enable Q_Matrix (0 Not present, 1 Present
in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
ScalingListPresentFlag0 = 3 # Intra4x4_Luma (0 Not present, 1 Present
in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
ScalingListPresentFlag1 = 3 # Intra4x4_ChromaU (0 Not present, 1 Present
in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
ScalingListPresentFlag2 = 3 # Intra4x4_chromaV (0 Not present, 1 Present
in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
ScalingListPresentFlag3 = 3 # Inter4x4_Luma (0 Not present, 1 Present
in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
ScalingListPresentFlag4 = 3 # Inter4x4_ChromaU (0 Not present, 1 Present
in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
ScalingListPresentFlag5 = 3 # Inter4x4_ChromaV (0 Not present, 1 Present
in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
ScalingListPresentFlag6 = 3 # Intra8x8_Luma (0 Not present, 1 Present
in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
ScalingListPresentFlag7 = 3 # Inter8x8_Luma (0 Not present, 1 Present
in SPS, 2 Present in PPS, 3 Present in both SPS & PPS)
########################################################################################
#Rounding Offset control
########################################################################################
OffsetMatrixPresentFlag = 0 # Enable Explicit Offset Quantization
Matrices (0: disable 1: enable)
QOffsetMatrixFile = "q_offset.cfg" # Explicit Quantization Matrices
file
AdaptiveRounding = 0 # Enable Adaptive Rounding based on JVT-N011
(0: disable, 1: enable)
AdaptRndPeriod = 1 # Period in terms of MBs for updating
rounding offsets.
# 0 performs update at the picture level.
Default is 16. 1 is as in JVT-N011.
AdaptRndChroma = 0 # Enables coefficient rounding adaptation
for chroma
AdaptRndWFactorIRef = 4 # Adaptive Rounding Weight for I/SI slices
in reference pictures /4096
AdaptRndWFactorPRef = 4 # Adaptive Rounding Weight for P/SP slices
in reference pictures /4096
AdaptRndWFactorBRef = 4 # Adaptive Rounding Weight for B slices in
reference pictures /4096
AdaptRndWFactorINRef = 4 # Adaptive Rounding Weight for I/SI slices
in non reference pictures /4096
AdaptRndWFactorPNRef = 4 # Adaptive Rounding Weight for P/SP slices
in non reference pictures /4096
AdaptRndWFactorBNRef = 4 # Adaptive Rounding Weight for B slices in
non reference pictures /4096
########################################################################################
#Lossless Coding (FREXT)
########################################################################################
QPPrimeYZeroTransformBypassFlag = 0 # Enable lossless coding when
qpprime_y is zero (0 Disabled, 1 Enabled)
########################################################################################
#Fast Motion Estimation Control Parameters
########################################################################################
UseFME = 0 # Use fast motion estimation
(0=disable/default, 1=UMHexagonS,
# 2=Simplified UMHexagonS, 3=EPZS patterns)
EPZSPattern = 2 # Select EPZS primary refinement pattern.
# (0: small diamond, 1: square, 2: extended
diamond/default,
# 3: large diamond)
EPZSDualRefinement = 3 # Enables secondary refinement pattern.
# (0:disabled, 1: small diamond, 2: square,
# 3: extended diamond/default, 4: large
diamond)
EPZSFixedPredictors = 2 # Enables Window based predictors
# (0:disabled, 1: P only, 2: P and
B/default)
EPZSTemporal = 1 # Enables temporal predictors
# (0: disabled, 1:
enabled/default)
EPZSSpatialMem = 1 # Enables spatial memory predictors
# (0: disabled, 1: enabled/default)
EPZSMinThresScale = 0 # Scaler for EPZS minimum threshold (0
default).
# Increasing value can speed up encoding.
EPZSMedThresScale = 1 # Scaler for EPZS median threshold (1
default).
# Increasing value can speed up encoding.
EPZSMaxThresScale = 1 # Scaler for EPZS maximum threshold (1
default).
# Increasing value can speed up encoding.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/mp4-tech/attachments/20060127/645b7667/attachment-0001.html
More information about the Mp4-tech
mailing list