fraunhoferhhi / vvenc

VVenC, the Fraunhofer Versatile Video Encoder
https://www.hhi.fraunhofer.de/en/departments/vca/technologies-and-solutions/h266-vvc.html
BSD 3-Clause Clear License
947 stars 170 forks source link

Incorrect bitrate report for neutral gray sequence #428

Open bart-kroon opened 4 days ago

bart-kroon commented 4 days ago

Hi all, I think I found a small bug. It occurred on my side with GCC 13.2.0 but not for PUT with GCC 11.4.0 (if they reported correctly).

I have a yuv420p10 file that has all samples uniformly 512. (Don't ask why.)

My simplified command-line is:

vvencFFapp -c my_config.cfg -i neutral_gray_video.yuv -b bitstream.bit \
   -q 19 -f 65 -fr 25 -s 1920x4640 --InputBitDepth 10 --OutputBitDepth 10

The output bitstream is 6849 B for 65 frames at 25 Hz. This is what VVenC reports:

vvencFFapp: VVenC, the Fraunhofer H.266/VVC Encoder, version 1.11.1 [Linux][GCC 13.2.0][64 bit][SIMD=AVX2]
vvencFFapp [info]: started @ Tue Oct  1 11:43:48 2024
vvenc [verbose]: Input File                             : out/G65/L03/RP0/TMIV_G65_L03_RP0_tex_c03_1920x4640_yuv420p10le.yuv
vvenc [verbose]: Bitstream File                         : out/G65/L03/RP1/TMIV_G65_L03_RP1_tex_c03.bit
vvenc [verbose]: Real Format                            : 1920x4640  yuv420p10  25 Hz  SDR  65 frames
vvenc [verbose]: Frames                                 : encode 65 frames
vvenc [verbose]: Internal format                        : 1920x4640  25 Hz  SDR
vvenc [verbose]: Threads                                : 0  (parallel frames: 0)
vvenc [verbose]: Rate control                           : QP 19
vvenc [verbose]: Perceptual optimization                : Disabled
vvenc [verbose]: Intra period (keyframe)                : 32
vvenc [verbose]: Decoding refresh type                  : CRA with POC 0 IDR
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                            : 65 frames
vvenc [verbose]: Profile                                : main_10
vvenc [verbose]: Level                                  : 5.2
vvenc [verbose]: CU size                                : 128
vvenc [verbose]: Max TB size                            : 64
vvenc [verbose]: Min CB size                            : 4
vvenc [verbose]: Motion search range                    : 384
vvenc [verbose]: QP                                     : 19
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:10, C:10)
vvenc [verbose]: MSB-extended bit depth                 : (Y:10, C:10)
vvenc [verbose]: Internal bit depth                     : (Y:10, C:10)
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: CTU128 QTMin44BTT32 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:1 AMVR:1 SMVD:3 LMCS:2 (Signal:SDR Opt:0) CIIP:1 MIP:1 AFFINE:2 (PROF:1, Type:1) MMVD:3 DisFracMMVD:1 SbTMVP:1 GPM:1 LFNST:1 MTS:0 ISP:1 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:2 PBIntraFast:1 AMaxBT:1 FastQtBtEnc:1 ContentBasedFastQtbt:0 FastMIP:0 FastIntraTools:0 IntraEstDecBit:1 FastLocalDualTree:1 IntegerET:0 FastSubPel:1 ReduceFilterME:0 QtbttExtraFast:2 FastTTSplit:5 IBCFastMethod:1 FIM:0 ALFSpeed:0 QuantThr:4 SelectiveRDQO:0
vvenc [verbose]: RATE CONTROL CFG: RateControl:0 QP:19 LookAhead:0 FirstPassMode:0
vvenc [verbose]: PARALLEL PROCESSING CFG: NumThreads:0 MaxParallelFrames:0 IFP:0 (IFPLines:0) WppBitEqual:0 WF:0

(...)

vvenc [info]: stats summary: frame= 65/65 avg_fps= 0.5 avg_bitrate= 21.07 kbps
vvenc [info]: stats summary: frame I:  3, kbps: 76.87, AvgQP: 16.00
vvenc [info]: stats summary: frame P:  0, kbps:   nan, AvgQP: nan
vvenc [info]: stats summary: frame B: 62, kbps: 18.37, AvgQP: 24.29

vvenc [info]:   Total Frames |   Bitrate     Y-PSNR    U-PSNR    V-PSNR    YUV-PSNR   Y-Lossless  U-Lossless  V-Lossless
vvenc [info]:    913354032           0.0000    0.0000    0.0000    0.0000    0.0004          65          65          65

vvencFFapp [info]: finished @ Tue Oct  1 11:45:55 2024
vvencFFapp [info]: Total Time:      117.130 sec. [user]      126.451 sec. [elapsed]

Note the number of frames, the special character and the bit rate.

adziembowski commented 4 days ago

Our log, GCC 11.4.0 below. The same size of the bitstream file, different special character, different (and negative) number of frames in the log.


vvencFFapp [info]: started @ Fri Sep 27 15:14:20 2024
vvenc [verbose]: Input File                             : G65/L03/TMIV_G65_L03_tex_c03_1920x4640_yuv420p10le_QP0.yuv
vvenc [verbose]: Bitstream File                         : G65/L03/bit/TMIV_G65_L03_tex_c03_1920x4640_yuv420p10le_QP1.bit
vvenc [verbose]: Real Format                            : 1920x4640  yuv420p10  25 Hz  SDR  65 frames
vvenc [verbose]: Frames                                 : encode 65 frames 
vvenc [verbose]: Internal format                        : 1920x4640  25 Hz  SDR
vvenc [verbose]: Threads                                : 0  (parallel frames: 0)
vvenc [verbose]: Rate control                           : QP 19
vvenc [verbose]: Perceptual optimization                : Disabled
vvenc [verbose]: Intra period (keyframe)                : 32
vvenc [verbose]: Decoding refresh type                  : CRA with POC 0 IDR
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                            : 65 frames
vvenc [verbose]: Profile                                : main_10
vvenc [verbose]: Level                                  : 5.2
vvenc [verbose]: CU size                                : 128
vvenc [verbose]: Max TB size                            : 64
vvenc [verbose]: Min CB size                            : 4
vvenc [verbose]: Motion search range                    : 384
vvenc [verbose]: QP                                     : 19
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:10, C:10)
vvenc [verbose]: MSB-extended bit depth                 : (Y:10, C:10)
vvenc [verbose]: Internal bit depth                     : (Y:10, C:10)
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: CTU128 QTMin44BTT32 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:1 AMVR:1 SMVD:3 LMCS:2 (Signal:SDR Opt:0) CIIP:1 MIP:1 AFFINE:2 (PROF:1, Type:1) MMVD:3 DisFracMMVD:1 SbTMVP:1 GPM:1 LFNST:1 MTS:0 ISP:1 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:2 PBIntraFast:1 AMaxBT:1 FastQtBtEnc:1 ContentBasedFastQtbt:0 FastMIP:0 FastIntraTools:0 IntraEstDecBit:1 FastLocalDualTree:1 IntegerET:0 FastSubPel:1 ReduceFilterME:0 QtbttExtraFast:2 FastTTSplit:5 IBCFastMethod:1 FIM:0 ALFSpeed:0 QuantThr:4 SelectiveRDQO:0 
vvenc [verbose]: RATE CONTROL CFG: RateControl:0 QP:19 LookAhead:0 FirstPassMode:0 
vvenc [verbose]: PARALLEL PROCESSING CFG: NumThreads:0 MaxParallelFrames:0 IFP:0 (IFPLines:0) WppBitEqual:0 WF:0 

(...)

vvenc [info]: stats summary: frame= 65/65 avg_fps= 0.3 avg_bitrate= 21.07 kbps
vvenc [info]: stats summary: frame I:  3, kbps: 76.87, AvgQP: 16.00
vvenc [info]: stats summary: frame P:  0, kbps:   nan, AvgQP: nan
vvenc [info]: stats summary: frame B: 62, kbps: 18.37, AvgQP: 24.29

vvenc [info]:   Total Frames |   Bitrate     Y-PSNR    U-PSNR    V-PSNR    YUV-PSNR   Y-Lossless  U-Lossless  V-Lossless
vvenc [info]:    -1864331344    À       0.0000    0.0000    0.0000    0.0000    0.0004          65          65          65

vvencFFapp [info]: finished @ Fri Sep 27 15:17:31 2024
vvencFFapp [info]: Total Time:      102.032 sec. [user]      190.257 sec. [elapsed]```