Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ecm/ECM
  • seregin/ECM
  • XiangLi/ECM
  • ksuehring/ECM
  • Morris/ecm-7-0
  • leizhao/ECM
  • Dongcheol/ecm
  • ghaznavi/ECM
  • junyanhuo/ECM
  • Morris/jvet-ad-0202
  • Yasugi/jvet-ad-0105-aspect-1
  • jonatan/ECM
  • kevin625/ECM
  • astola/ECM
  • Yasugi/jvet-ae-0055
  • ghaznavi/jvet-ae-0100-bvgcccm
  • yyu2021/ECM
  • moonmo.koo/ECM
  • ihtseng/ECM
  • ghaznavi/bugfix-for-jvet-ae-0100-bvgcccm
  • FANZHEMING/jvet-af-0101
  • ghaznavi/jvet-ah-0076-obic
  • NicolasHorst/ecm
  • ghaznavi/harmonizing-dimd-based-transform-selection-functions
  • bordesp/ECM
  • pohan-lin/ECM
  • qinhongdong/ECM-MasterBranch
  • jvet-ahg-gcc/ECM
  • renan.utida/ECM-AhG15
  • mosenabdoli/ecm-14-0-timd-merge
  • FANZHEMING/jvet-aj-0079
  • lxw/ECM
  • mosenabdoli/ecm-resolve-aj0096-aj0061
  • mosenabdoli/ecm-resolve-aj-0096-aj-0061
  • yanning/ECM
  • ghaznavi/jvet-aj-0146-and-obic-interaction
  • frankplow/ECM
  • moonmo.koo/ecm-15-ahg-7
  • moonmo.koo/ecm-15-ahg-7-fix
  • ivash/ecm-master-branch
  • moonmo.koo/ecm-test
  • pgarus/ecm-ak
  • Myungoh/jvet-ak-0059-test-1-2-c
  • Myungoh/ecm-test-1-2-c
  • Myungoh/mdip-encoder-fix
  • Myungoh/fix-mdip-2
  • Myungoh/mdip-control-for-ahg-7-tests
  • wangguiqi/ECM
48 results
Show changes
Showing
with 445 additions and 57 deletions
# Reference picture resampling CE settings for scaling ratio and number of encoded frames
RPR : 1
ScalingRatioHor : 1.5
ScalingRatioVer : 1.5
FractionNumFrames : 0.5
......
# Reference picture resampling CE settings for scaling ratio and number of encoded frames
RPR : 1
ScalingRatioHor : 2.0
ScalingRatioVer : 2.0
FractionNumFrames : 0.5
......
......@@ -111,6 +111,7 @@ FastLFNST : 1
# Encoder optimization tools
AffineAmvrEncOpt : 0
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -136,6 +136,7 @@ FastLocalDualTreeMode : 2
# Encoder optimization tools
AffineAmvrEncOpt : 0
MmvdDisNum : 6
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -90,7 +90,7 @@ TransformSkipLog2MaxSize : 5
SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON)
#=========== TemporalFilter =================
TemporalFilter : 0 # Enable/disable GOP Based Temporal Filter
TemporalFilter : 1 # Enable/disable GOP Based Temporal Filter
TemporalFilterFutureReference : 1 # Enable/disable reading future frames
TemporalFilterStrengthFrame8 : 0.95 # Enable filter at every 8th frame with given strength
TemporalFilterStrengthFrame16 : 1.5 # Enable filter at every 16th frame with given strength, longer intervals has higher priority
......@@ -172,6 +172,7 @@ ChromaTS : 1
# Encoder optimization tools
AffineAmvrEncOpt : 1
MmvdDisNum : 6
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -74,7 +74,7 @@ TransformSkipLog2MaxSize : 5
SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON)
#=========== TemporalFilter =================
TemporalFilter : 0 # Enable/disable GOP Based Temporal Filter
TemporalFilter : 1 # Enable/disable GOP Based Temporal Filter
TemporalFilterFutureReference : 1 # Enable/disable reading future frames
TemporalFilterStrengthFrame8 : 0.95 # Enable filter at every 8th frame with given strength
TemporalFilterStrengthFrame16 : 1.5 # Enable filter at every 16th frame with given strength, longer intervals has higher priority
......@@ -156,6 +156,8 @@ ChromaTS : 1
# Encoder optimization tools
AffineAmvrEncOpt : 1
MmvdDisNum : 6
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
#!/usr/bin/python
#!/usr/bin/python3
#
# cmake.py
#
......
#!/usr/bin/python
#!/usr/bin/python3
#
# cmake_docutil.py
#
......
#!/usr/bin/python
#!/usr/bin/python3
#
# cmakebuild_update.py
#
......
......@@ -873,6 +873,9 @@ function( _bb_query_system_info system_info_ )
endif()
elseif( CMAKE_HOST_APPLE )
set( _system_info "macosx" )
if( CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" )
set( _os_arch "arm64" )
endif()
if( NOT CMAKE_VERSION VERSION_LESS 3.10.0 )
# sw_vers -productVersion
cmake_host_system_information( RESULT _lsb_distro_version QUERY OS_RELEASE )
......@@ -973,7 +976,9 @@ function( _bb_get_platform_dir platform_dir_ )
set( _platform_dir "${CMAKE_SYSTEM_PROCESSOR}" )
endif()
else()
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
if( CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" )
set( _platform_dir "arm64" )
elseif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set( _platform_dir "x86_64" )
else()
set( _platform_dir "x86" )
......
No preview for this file type
......@@ -205,7 +205,7 @@ fontsize=\footnotesize}
\maketitle
\begin{abstract}
This document is a user manual describing usage of the VTM reference software
for the VVC project. It applies to version 9.2 of the software.
for the VVC project. It applies to version 10.0 of the software.
\end{abstract}
\tableofcontents
......@@ -886,6 +886,12 @@ Add Access Unit Delimiter NAL units between all Access Units.
Enable Picture Header to be signalled in Slice Header when encoding with single slice per picture.
\\
\Option{RPR} &
%\ShortOption{\None} &
\Default{true} &
Specifies the value of sps_ref_pic_resampling_enabled_flag.
\\
\Option{ScalingRatioHor} &
%\ShortOption{\None} &
\Default{1.0} &
......@@ -1049,37 +1055,37 @@ Specifies the value of 16 minus gci_sixteen_minus_max_bitdepth_constraint_idc
Specifies the value of 3 minus gci_three_minus_max_chroma_format_constraint_idc
\\
\Option{TrailConstraintFlag} &
\Option{NoTrailConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_trail_constraint_flag
\\
\Option{StsaConstraintFlag} &
\Option{NoStsaConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_stsa_constraint_flag
\\
\Option{RaslConstraintFlag} &
\Option{NoRaslConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_rasl_constraint_flag
\\
\Option{RadlConstraintFlag} &
\Option{NoRadlConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_radl_constraint_flag
\\
\Option{IdrConstraintFlag} &
\Option{NoIdrConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_idr_constraint_flag
\\
\Option{CraConstraintFlag} &
\Option{NoCraConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_cra_constraint_flag
......@@ -1091,7 +1097,7 @@ Specifies the value of gci_no_cra_constraint_flag
Specifies the value of gci_no_gdr_constraint_flag
\\
\Option{ApsConstraintFlag} &
\Option{NoApsConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_aps_constraint_flag
......@@ -1144,241 +1150,265 @@ Specifies the value of gci_no_subpic_info_constraint_flag
Specifies the value of gci_three_minus_max_log2_ctu_size_constraint_idc
\\
\Option{PartitionConstraintsOverrideConstraintFlag} &
\Option{NoPartitionConstraintsOverrideConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_partition_constraints_override_constraint_flag
\\
\Option{QtbttDualTreeIntraConstraintFlag} &
\Option{NoMttConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_mtt_constraint_flag
\\
\Option{NoQtbttDualTreeIntraConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_qtbtt_dual_tree_intra_constraint_flag
\\
\Option{PaletteConstraintFlag} &
\Option{NoPaletteConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_palette_constraint_flag
\\
\Option{IbcConstraintFlag} &
\Option{NoIbcConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_ibc_constraint_flag
\\
\Option{IspConstraintFlag} &
\Option{NoIspConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_isp_constraint_flag
\\
\Option{MrlConstraintFlag} &
\Option{NoMrlConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_mrl_constraint_flag
\\
\Option{MipConstraintFlag} &
\Option{NoMipConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_mip_constraint_flag
\\
\Option{CclmConstraintFlag} &
\Option{NoCclmConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_cclm_constraint_flag
\\
\Option{NoRprConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_ref_pic_resampling_constraint_flag
\\
\Option{NoResChangeInClvsConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_res_change_in_clvs_constraint_flag
\\
\Option{RefWraparoundConstraintFlag} &
\Option{NoWeightedPredictionConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_weighted_prediction_constraint_flag
\\
\Option{NoRefWraparoundConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_ref_wraparound_constraint_flag
\\
\Option{TemporalMvpConstraintFlag} &
\Option{NoTemporalMvpConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_temporal_mvp_constraint_flag
\\
\Option{SbtmvpConstraintFlag} &
\Option{NoSbtmvpConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_sbtmvp_constraint_flag
\\
\Option{AmvrConstraintFlag} &
\Option{NoAmvrConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_amvr_constraint_flag
\\
\Option{SmvdConstraintFlag} &
\Option{NoSmvdConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_smvd_constraint_flag
\\
\Option{BdofConstraintFlag} &
\Option{NoBdofConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_bdof_constraint_flag
\\
\Option{DmvrConstraintFlag} &
\Option{NoDmvrConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_dmvr_constraint_flag
\\
\Option{MmvdConstraintFlag} &
\Option{NoMmvdConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_mmvd_constraint_flag
\\
\Option{AffineMotionConstraintFlag} &
\Option{NoAffineMotionConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_affine_motion_constraint_flag
\\
\Option{ProfConstraintFlag} &
\Option{NoProfConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_prof_constraint_flag
\\
\Option{BcwConstraintFlag} &
\Option{NoBcwConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_bcw_constraint_flag
\\
\Option{CiipConstraintFlag} &
\Option{NoCiipConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_ciip_constraint_flag
\\
\Option{GpmConstraintFlag} &
\Option{NoGpmConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_gpm_constraint_flag
\\
\Option{TransformSkipConstraintFlag} &
\Option{NoTransformSkipConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_transform_skip_constraint_flag
\\
\Option{LumaTransformSize64ConstraintFlag} &
\Option{NoLumaTransformSize64ConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_luma_transform_size_64_constraint_flag
\\
\Option{BDPCMConstraintFlag} &
\Option{NoBDPCMConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_bdpcm_constraint_flag
\\
\Option{MtsConstraintFlag} &
\Option{NoMtsConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_mts_constraint_flag
\\
\Option{LfnstConstraintFlag} &
\Option{NoLfnstConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_lfnst_constraint_flag
\\
\Option{JointCbCrConstraintFlag} &
\Option{NoJointCbCrConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_joint_cbcr_constraint_flag
\\
\Option{SbtConstraintFlag} &
\Option{NoSbtConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_sbt_constraint_flag
\\
\Option{ActConstraintFlag} &
\Option{NoActConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_act_constraint_flag
\\
\Option{ExplicitScaleListConstraintFlag} &
\Option{NoExplicitScaleListConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_explicit_scaling_list_constraint_flag
\\
\Option{DepQuantConstraintFlag} &
\Option{NoChromaQpOffsetConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gic_no_chroma_qp_offset_constraint_flag
\\
\Option{NoDepQuantConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_dep_quant_constraint_flag
\\
\Option{SignDataHidingConstraintFlag} &
\Option{NoSignDataHidingConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_sign_data_hiding_constraint_flag
\\
\Option{QpDeltaConstraintFlag} &
\Option{NoQpDeltaConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_cu_qp_delta_constraint_flag
\\
\Option{SaoConstraintFlag} &
\Option{NoSaoConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_sao_constraint_flag
\\
\Option{AlfConstraintFlag} &
\Option{NoAlfConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_alf_constraint_flag
\\
\Option{CCAlfConstraintFlag} &
\Option{NoCCAlfConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_ccalf_constraint_flag
\\
\Option{LmcsConstraintFlag} &
\Option{NoLmcsConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_lmcs_constraint_flag
\\
\Option{LadfConstraintFlag} &
\Option{NoLadfConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_ladf_constraint_flag
\\
\Option{VirtualBoundaryConstraintFlag} &
\Option{NoVirtualBoundaryConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_virtual_boundaries_constraint_flag
......@@ -2145,6 +2175,11 @@ For Cb component with BT.2020 container use 1.14; for BT.709 material and 1.04 f
For Cr component with BT.2020 container use 1.79; for BT.709 material and 1.39 for P3 material.
\\
\Option{BIM} &
\Default{false} &
Enable or disable Block Importance Mapping, QP adaptation depending on estimated propagation of reference samples. Depends on future and past reference frames configured for temporal filter.
\\
\Option{SliceChromaQPOffsetPeriodicity} &
\Default{0} &
Defines the periodicity for inter slices that use the slice-level chroma QP offsets, as defined by SliceCbQpOffsetIntraOrPeriodic and SliceCrQpOffsetIntraOrPeriodic. A value of 0 disables the periodicity. It is intended to be used in low-delay configurations where an regular intra period is not defined.
......
#!/usr/bin/python
import sys, os, subprocess
if len( sys.argv ) < 3:
print( "Usage: decodeAndEstimateRate_parallel.py exePath bitstreamFile outputDirectory" )
sys.exit()
if not os.path.isfile( sys.argv[2] ):
print( "Error: Could not open bitstreamFile: '" + sys.argv[2] + "'" )
sys.exit(-1)
workDir = os.path.abspath( os.getcwd() )
outDir = sys.argv[3]
binDir = sys.argv[1]
if not os.path.isdir( outDir ):
print( "Error: outputDirectory doesn't exist." )
sys.exit(-1)
xmlFile = "CabacBits_data.xml"
binFile = "CabacBits_data.bin"
if os.path.isfile( os.path.join(binDir, xmlFile) ):
print( "Error: CabacBits_data.xml already exists." )
sys.exit(-1)
if os.path.isfile( os.path.join(binDir, binFile) ):
print( "Error: CabacBits_data.bin already exists." )
sys.exit(-1)
logDir = sys.argv[2].strip(".bin") + ".log"
f = open(logDir, "w")
subprocess.call( [ os.path.join( binDir, 'DecoderAppStatic' ), '-b', sys.argv[2] ], cwd=binDir, stdout=f )
command = os.path.join( binDir, 'RateEstimatorStatic' )
command += " " + os.path.join( binDir, xmlFile) + " " + os.path.join( binDir, binFile) + " " + outDir
os.system(command)
os.remove( os.path.join(binDir, xmlFile) )
os.remove( os.path.join(binDir, binFile) )
#!/bin/sh
SCRIPTPATH=$(pwd)
echo $SCRIPTPATH
cd $SCRIPTPATH/str/
bins=(*.bin)
cd ../
for bin in "${bins[@]}"; do
file=$(echo "${bin}" | cut -d "." -f 1)
cd info
mkdir $file
cd ../
python decodeAndEstimateRate.py $SCRIPTPATH $SCRIPTPATH/str/$bin $SCRIPTPATH/info/$file
echo "$file done"
done
python selectParameters.py $SCRIPTPATH/info
\ No newline at end of file
#!/usr/bin/python
from __future__ import division
from __future__ import print_function
import sys, os
#from __builtin__ import False
BITS_SHIFT = 30
shiftIdxList = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13 ]
rateIdxList = [ 4, 11, 18, 25, 32]
if len( sys.argv ) != 2:
print( "Usage: selectParameters.py ratesDirectory" )
sys.exit()
if not os.path.isdir( sys.argv[1] ):
print( "Error: Could not access ratesDirectory: '" + sys.argv[2] + "'" )
sys.exit(-1)
def checkSeqFoldersAndGetCtxList( sfPath, sf ):
if len( sf ) == 0:
print( "Error: Could not find any seqence folders." )
sys.exit(-1)
print( "Checking consistency of 'CabacBits_data_index.txt' files in %d folders..." % len( sf ) )
firstSeqLines = None
seqBits = []
for s in sf:
idxFile = os.path.join( sfPath, s, "CabacBits_data_index.txt" )
if not os.path.isfile( idxFile ):
print( "Error: Could not access index file: '" + idxFile + "'" )
sys.exit(-1)
with open( idxFile, "rt" ) as f:
sfLines = [ x.rstrip() for x in f.readlines() ]
seqBits.append( int( sfLines[0] ) )
sfLines = sfLines[1:]
if firstSeqLines is None:
firstSeqLines = sfLines
else:
if sfLines != firstSeqLines:
print( "Error: CabacBits_data_index.txt file in folder '%s' doesn't contain the same list of ctx files in the same order as in folder '%s'." % (s, sf[0]) )
sys.exit(-1)
print( "Success." )
return firstSeqLines, seqBits
seqFolders = [x for x in os.listdir( sys.argv[1] ) if os.path.isdir( os.path.join( sys.argv[1], x ) ) ]
ctxList, seqBits = checkSeqFoldersAndGetCtxList( sys.argv[1], seqFolders )
def parseCtxFile( ctxFileName, numInits, sequenceBits, bits ):
try:
with open( ctxFileName, "rt" ) as f:
ctx = [ x.rstrip() for x in f.readlines() ]
except:
print( "Could not access ctx file: %s", f )
sys.exit(-1)
runIdx = 0
initBitsList = False
if len( bits ) == 0:
initBitsList = True
for initType in range( 3 ):
if initBitsList:
bits.append([])
for ws in range( 13 ):
if initBitsList:
bits[initType].append([])
for adaRate in range (5):
if initBitsList:
bits[initType][ws].append([])
initBits = [x for x in ctx[runIdx].split( ',' ) ]
if initBits[-1].strip() == '':
initBits = initBits[:-1]
initBits = [int(x) for x in initBits ]
if numInits is None:
numInits = len( initBits )
print( "Found %d init value candidates." % numInits )
else:
if numInits != len( initBits ):
print( "Error: File '%s' seems inconsistent." % ctxFileName )
sys.exit(-1)
if initBitsList:
bits[initType][ws][adaRate] = [(x << (BITS_SHIFT-15)) // sequenceBits for x in initBits]
else:
bits[initType][ws][adaRate] = [bits[initType][ws][adaRate][i] + (x << (BITS_SHIFT-15)) // sequenceBits for i, x in enumerate(initBits)]
runIdx += 1
if initType < 2 and ctx[runIdx] != "":
print( "Unexpected nonempty line between two blocks of bit rates." )
sys.exit(-1)
else:
runIdx += 1
offset = [x for x in ctx[runIdx].split( ',' ) ]
offset0 = int(offset[0])
offset1 = int(offset[1])
initB = int(offset[2])
rateB = int(offset[3])
weightB = int(offset[4])
initP = int(offset[5])
rateP = int(offset[6])
weightP = int(offset[7])
initI = int(offset[8])
rateI = int(offset[9])
weightI = int(offset[10])
return numInits, bits, offset0, offset1, initB, rateB, weightB, initP, rateP, weightP, initI, rateI, weightI
lastCtxName = None
ctxArray = []
allCtx = []
numInits = None
for ctxFile in ctxList:
ctxBits = []
#input()
for i, seq in enumerate( seqFolders ):
ctxFn = os.path.join( sys.argv[1], seq, ctxFile )
numInits, ctxBits, offset0, offset1, initB, rateB, weightB, initP, rateP, weightP, initI, rateI, weightI = parseCtxFile( ctxFn, numInits, seqBits[i], ctxBits )
print( "Processing %s" % ctxFile )
#print("ctxBits ", ctxBits)
# create new array
_, _, ctxName, _ = ctxFile.split( "_" )
if ctxName != lastCtxName and lastCtxName is not None:
allCtx.append( [ lastCtxName, zip( *ctxArray ) ] )
ctxArray = []
lastCtxName = ctxName
bestBits = 0
bestLine = []
minInit = []
minInitIdx = []
for sliceTypeIdx, sliceType in enumerate(ctxBits):
minInit.append([])
minInitIdx.append([])
for wsIdx, ws in enumerate(sliceType):
minInit[sliceTypeIdx].append([])
minInitIdx[sliceTypeIdx].append([])
for adaRateIdx, adaRate in enumerate(ws):
minInit[sliceTypeIdx][wsIdx].append(min(adaRate))
minInitIdx[sliceTypeIdx][wsIdx].append( adaRate.index( min(adaRate) ) )
#print("\n")
#print("minInit", minInit)
#print("\n")
#print("minInitIdx", minInitIdx)
# decide adaptive rate for each window size
minAdaRate = []
minAdaRateIdx = []
for sliceTypeIdx, sliceType in enumerate( minInit ):
minAdaRate.append([])
minAdaRateIdx.append([])
for wsIdx, ws in enumerate(sliceType):
minAdaRate[sliceTypeIdx].append( min(ws) )
minAdaRateIdx[sliceTypeIdx].append( ws.index( min(ws) ) )
#print("\n")
#print("minAdaRate", minAdaRate)
#print("\n")
#print("minAdaRateIdx", minAdaRateIdx)
# decide window size for each sliceType
currLine = []
totalBits = 0
for sliceTypeIdx, sliceType in enumerate( minAdaRate ):
f_minWs = min( sliceType )
f_minWsIdx = sliceType.index( f_minWs )
f_minAdaRateIdx = minAdaRateIdx[sliceTypeIdx][f_minWsIdx]
f_minInitIdx = minInitIdx[sliceTypeIdx][f_minWsIdx][f_minAdaRateIdx]
#print("f_minWs", f_minWs)
#print("f_minWsIdx", f_minWsIdx)
#print("f_minAdaRateIdx", f_minAdaRateIdx)
#print("f_minInitIdx", f_minInitIdx)
totalBits += f_minWs
if sliceTypeIdx == 0:
if f_minWs <= 0:
currLine.append(-1)
currLine.append(-1)
currLine.append(-1)
else:
currLine.append( f_minInitIdx )
currLine.append( shiftIdxList[f_minWsIdx] )
currLine.append( rateIdxList[f_minAdaRateIdx] )
elif sliceTypeIdx == 1:
currLine.append(initP)
currLine.append(rateP)
currLine.append(weightP)
elif sliceTypeIdx == 2:
currLine.append(initB)
currLine.append(rateB)
currLine.append(weightB)
currLine.append( offset0 )
currLine.append( offset1 )
#print("\n")
#print("currLine", currLine)
#print("totalBits", totalBits)
#print("\n")
#print("bestLine", bestLine)
#print("bestBits", bestBits)
ctxArray.append( currLine )
if ctxFile == ctxList[-1]:
allCtx.append( [ lastCtxName, zip( *ctxArray ) ] )
indent = ""
for name, [ I, WS_I, ADA_I, P, WS_P, ADA_P, B, WS_B, ADA_B, OFF0, OFF1 ] in allCtx:
I = "".join( [ "%3d, " % x if x >= 0 else "CNU, " for x in I ] )
P = "".join( [ "%3d, " % x if x >= 0 else "CNU, " for x in P ] )
B = "".join( [ "%3d, " % x if x >= 0 else "CNU, " for x in B ] )
WS_I = "".join( [ "%3d, " % x if x >= 0 else "DWS, " for x in WS_I ] )
WS_P = "".join( [ "%3d, " % x if x >= 0 else "DWS, " for x in WS_P ] )
WS_B = "".join( [ "%3d, " % x if x >= 0 else "DWS, " for x in WS_B ] )
ADA_I = "".join( [ "%3d, " % x if x >= 0 else "DWE, " for x in ADA_I ] )
ADA_P = "".join( [ "%3d, " % x if x >= 0 else "DWE, " for x in ADA_P ] )
ADA_B = "".join( [ "%3d, " % x if x >= 0 else "DWE, " for x in ADA_B ] )
OFF0 = "".join( [ "%3d, " % x if x >= 0 else "DWO, " for x in OFF0 ] )
OFF1 = "".join( [ "%3d, " % x if x >= 0 else "DWO, " for x in OFF1 ] )
nameParts = name.split( "[" )
if len( nameParts ) > 1:
if( nameParts[1] == "0]" ):
if indent != "":
print( "};\n")
print( "const CtxSet ContextSetCfg::%s[] = " % nameParts[0] )
print( "{" )
indent = " "
print( "%sContextSetCfg::addCtxSet" % indent )
else:
if indent != "":
print( "};\n")
indent = ""
print( "const CtxSet ContextSetCfg::%s = ContextSetCfg::addCtxSet" % name )
print( "%s({" % indent );
print( "%s { %s}," % (indent, B ) )
print( "%s { %s}," % (indent, P ) )
print( "%s { %s}," % (indent, I ) )
print( "%s { %s}," % (indent, WS_B) )
print( "%s { %s}," % (indent, WS_P) )
print( "%s { %s}," % (indent, WS_I) )
print( "%s { %s}," % (indent, ADA_B) )
print( "%s { %s}," % (indent, ADA_P) )
print( "%s { %s}," % (indent, ADA_I) )
print( "%s { %s}," % (indent, OFF0) )
print( "%s { %s}," % (indent, OFF1) )
#print( "%s { %s}," % (indent, WS) )
print( "%s})%s" % ( indent, ";\n" if indent == "" else "," ) )
if indent != "":
print( "};\n")
......@@ -3,7 +3,7 @@
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
*
* Copyright (c) 2010-2020, ITU/ISO/IEC
* Copyright (c) 2010-2023, ITU/ISO/IEC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
......@@ -100,7 +100,11 @@ void BitstreamExtractorApp::xPrintSubPicInfo (PPS *pps)
void BitstreamExtractorApp::xReadPicHeader(InputNALUnit &nalu)
{
m_hlSynaxReader.setBitstream(&nalu.getBitstream());
#if EMBEDDED_APS
m_hlSynaxReader.parsePictureHeader( &m_picHeader, &m_parameterSetManager, true, nalu.m_temporalId, nalu.m_nuhLayerId, m_accessUnitApsNals );
#else
m_hlSynaxReader.parsePictureHeader(&m_picHeader, &m_parameterSetManager, true);
#endif
m_picHeader.setValid();
}
......@@ -115,7 +119,11 @@ Slice BitstreamExtractorApp::xParseSliceHeader(InputNALUnit &nalu)
slice.setNalUnitLayerId(nalu.m_nuhLayerId);
slice.setTLayer(nalu.m_temporalId);
#if EMBEDDED_APS
m_hlSynaxReader.parseSliceHeader( &slice, &m_picHeader, &m_parameterSetManager, m_prevTid0Poc, m_prevPicPOC, nalu.m_nuhLayerId, m_accessUnitApsNals );
#else
m_hlSynaxReader.parseSliceHeader(&slice, &m_picHeader, &m_parameterSetManager, m_prevTid0Poc, m_prevPicPOC);
#endif
return slice;
}
......@@ -497,7 +505,6 @@ uint32_t BitstreamExtractorApp::decode()
bitstreamFileIn.clear();
bitstreamFileIn.seekg( 0, std::ios::beg );
int unitCnt = 0;
bool lastSliceWritten= false; // stores status of previous slice for associated filler data NAL units
VPS *vpsIdZero = new VPS();
......@@ -691,7 +698,11 @@ uint32_t BitstreamExtractorApp::decode()
{
APS* aps = new APS();
m_hlSynaxReader.setBitstream( &nalu.getBitstream() );
#if EMBEDDED_APS
m_hlSynaxReader.parseAPS( aps, true );
#else
m_hlSynaxReader.parseAPS( aps );
#endif
msg (VERBOSE, "APS Info: APS ID = %d Type = %d Layer = %d\n", aps->getAPSId(), aps->getAPSType(), nalu.m_nuhLayerId);
int apsId = aps->getAPSId();
int apsType = aps->getAPSType();
......@@ -790,7 +801,6 @@ uint32_t BitstreamExtractorApp::decode()
writeInpuNalUnitToStream = lastSliceWritten;
}
}
unitCnt++;
if( writeInpuNalUnitToStream )
{
......
......@@ -3,7 +3,7 @@
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
*
* Copyright (c) 2010-2020, ITU/ISO/IEC
* Copyright (c) 2010-2023, ITU/ISO/IEC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
......@@ -107,6 +107,10 @@ protected:
std::vector<int> m_updatedVPSList;
std::vector<int> m_updatedSPSList;
std::vector<int> m_updatedPPSList;
#if EMBEDDED_APS
std::vector<int> m_accessUnitApsNals;
#endif
};
#endif // __BITSTREAMEXTRACTORAPP__
......