fraunhoferhhi/vvenc

" --Log2MaxTbSize 5" setting result Segment fault

Closed this issue · 7 comments

totang commented

Release version has the issue while Debug version hasn't in Linux platform

command and log:

release-static> vvencapp --fps 30 --InternalBitDepth 8 -ip 180 -i foreman_cif.yuv -b test.266 -o test_encdec_recon.yuv -s 352x288 -f 180 -q 30 -f 5 --preset slow --CTUSize 64 --Log2MaxTbSize 5
Segmentation fault

I just tested it real quick, and of course "it works for me". Address sanitizer thinks all is fine as well.

Which exact version are you using, what compiler, what system?

One issue in your command line: you call the vvencapp and use vvencFFapp parametrization. This should not cause segfault tho, but just a bunch of parameter errors.

totang commented

So the issue can be closed?

Btw. both of your logs refer to VVenC v1.7.0. If the issue does not occur in the newest version I would consider it fixed.

totang commented

Yes,please。

This 720p sequence reproduces the issue :

vvencFFapp --fps 30 --InternalBitDepth 8 -ip 180 --preset slow -t 8 -i FourPeople_1280x720_60.yuv -b FourPeople_1280x720_60_at_qp2_T415.266 -o test_encdec_recon.yuv -s 1280x720 -f 180 -q 2 --CTUSize 64 --Log2MaxTbSize 5
vvencFFapp: Fraunhofer VVC Encoder ver. 1.9.1 [Linux][GCC 9.3.0][64 bit][SIMD=AVX2]
vvencFFapp [info]: started @ Mon Oct 30 02:50:32 2023
vvenc [verbose]: Input File : FourPeople_1280x720_60.yuv
vvenc [verbose]: Bitstream File : FourPeople_1280x720_60_at_qp2_T415.266
vvenc [verbose]: Real Format : 1280x720 yuv420p 30 Hz SDR 600 frames
vvenc [verbose]: Frames : encode 180 frames
vvenc [verbose]: Internal format : 1280x720 30 Hz SDR
vvenc [verbose]: Threads : 8 (parallel frames: 4)
vvenc [verbose]: Rate control : QP 2
vvenc [verbose]: Perceptual optimization : Disabled
vvenc [verbose]: Intra period (keyframe) : 180
vvenc [verbose]: Decoding refresh type : CRA
vvenc [verbose]: Sequence PSNR output : Linear average only
vvenc [verbose]: Hexadecimal PSNR output : Disabled
vvenc [verbose]: Sequence MSE output : Disabled
vvenc [verbose]: Frame MSE output : Disabled
vvenc [verbose]: Cabac-zero-word-padding : Enabled
vvenc [verbose]: Frame index : 180 frames
vvenc [verbose]: Profile : main_10
vvenc [verbose]: Level : 3.1
vvenc [verbose]: CU size : 64
vvenc [verbose]: Max TB size : 32
vvenc [verbose]: Min CB size : 4
vvenc [verbose]: Motion search range : 384
vvenc [verbose]: QP : 2
vvenc [verbose]: Max dQP signaling subdiv : 0
vvenc [verbose]: Cb QP Offset (dual tree) : 0 (0)
vvenc [verbose]: Cr QP Offset (dual tree) : 0 (0)
vvenc [verbose]: GOP size : 32
vvenc [verbose]: PicReordering : 1
vvenc [verbose]: Input bit depth : (Y:8, C:8)
vvenc [verbose]: MSB-extended bit depth : (Y:8, C:8)
vvenc [verbose]: Internal bit depth : (Y:8, C:8)
vvenc [verbose]: cu_chroma_qp_offset_subdiv : -1
vvenc [verbose]: log2_sao_offset_scale_luma : 0
vvenc [verbose]: log2_sao_offset_scale_chroma : 0
vvenc [verbose]: Cost function: : Lossy coding

vvenc [verbose]: CODING TOOL CFG: CTU64 QTMin33BTT32 IBD:0 SAO:1 ALF:1 (NonLinLuma:0 NonLinChr:0) CCALF:1 Tiles:1x1 Slices:1 WPP:0 WPP-Substreams:1 TMVP:1 DQ:1 SDH:0 CST:1 BDOF:1 DMVR:1 MTSImplicit:1 SBT:1 JCbCr:1 CabacInitPresent:0 AMVR:1 SMVD:3 LMCS:2 (Signal:SDR Opt:0) CIIP:1 MIP:1 AFFINE:3 (PROF:1, Type:1) MMVD:3 DisFracMMVD:1 SbTMVP:1 GPM:1 LFNST:1 MTS:0 ISP:3 TS:2 TSLog2MaxSize:5 useChromaTS:0 BDPCM:2 IBC:2 BCW:2
vvenc [verbose]: ENC. ALG. CFG: QPA:0 HAD:1 RDQ:1 RDQTS:1 ASR:1 MinSearchWindow:96 EDO:2 MCTF:2 BIM:1
vvenc [verbose]: PRE-ANALYSIS CFG: STA:1 LeadFrames:0 TrailFrames:0
vvenc [verbose]: FAST TOOL CFG: ECU:0 FEN:3 FDM:1 FastSearch:4 (SCC:2) LCTUFast:1 FastMrg:3 PBIntraFast:1 AMaxBT:0 FastQtBtEnc:1 ContentBasedFastQtbt:1 FastMIP:0 FastIntraTools:0 IntraEstDecBit:1 FastLocalDualTree:1 IntegerET:0 FastSubPel:1 ReduceFilterME:2 QtbttExtraFast:2 FastTTSplit:5 IBCFastMethod:1 FIM:0 ALFSpeed:0 QuantThr:4 SelectiveRDQO:0
vvenc [verbose]: RATE CONTROL CFG: RateControl:0 QP:2 LookAhead:0 FirstPassMode:0
vvenc [verbose]: PARALLEL PROCESSING CFG: NumThreads:8 MaxParallelFrames:4 FppLinesSynchro:0 WppBitEqual:1 WF:0

POC 0 TId: 0 ( IDR_N_LP, I-SLICE, QP 0, TF 4) 4006640 bits [Y 97.3623 dB U 89.9947 dB V 90.9638 dB] [ET 51 ] [L0 ] [L1 ]
POC 32 TId: 0 ( TRAIL, B-SLICE, QP 1, TF 4) 3814944 bits [Y 83.0050 dB U 77.4743 dB V 77.1018 dB] [ET 32 ] [L0 0 ] [L1 0 ]
Segmentation fault

The problem is with a condition in the EncModeCtrl.cpp:

    if( lumaArea.width > cs.sps->getMaxTbSize() || lumaArea.height > cs.sps->getMaxTbSize() )
    {
      return false;
    }

This condition breaks chroma search in local dual tree before a suitable encoding can be found. Thus, later on in deblocking, the block does not have a suitable neighbor for chroma channel. This has been changed from the following (initially intended to properly handle local dual tree):

    // if this is removed, the IntraSearch::xIntraCodingLumaQT needs to be adapted to support Intra TU split
    // also isXXAvailable in IntraPrediction.cpp need to be fixed to check availability within the same CU without isDecomp
    if( lumaArea.width > cs.sps->getMaxTbSize() || lumaArea.height > cs.sps->getMaxTbSize() )
    {
      return false;
    }

The change has been motivated by allowing MaxTrSize to be variable, but obviously it does not work with local dual tree, which was not caught in the inital testing.

Will further review and fix asap. This might require some work though.