gianni-rosato / svt-av1-psy

The Scalable Video Technology for AV1 (SVT-AV1 Encoder and Decoder) with perceptual enhancements for psychovisually optimal AV1 encoding
https://svt-av1-psy.com
BSD 3-Clause Clear License
259 stars 20 forks source link

[BUG] floating point exception with input size 8x8 and 4x4 #78

Closed Mr-Z-2697 closed 1 month ago

Mr-Z-2697 commented 1 month ago

Overview A clear and concise description of what the bug is.

Branch In which branch does the issue appear to be occurring?

Reproduction Steps to reproduce the behavior:

  1. trying to encode 8x8 or 4x4 video
  2. crash

Expected behavior Successfully produce valid bitstream.

Terminal Output

    ~/svt-av1-psy/Bi/Release    master  ffmpeg -v 0 -f lavfi -i color=s=8x8 -f yuv4mpegpipe - | ./SvtAv1EncApp -i - -b /dev/null
Svt[info]: -------------------------------------------
Svt[info]: SVT [version]:       SVT-AV1-PSY Encoder Lib v2.2.1-A
Svt[info]: SVT [build]  :       Clang 18.1.8     64 bit
Svt[info]: LIB Build date: Oct  8 2024 10:17:27
Svt[info]: -------------------------------------------
Svt[warn]: Instance 1: AQ mode 2 is unsupported with source dimensions (8 / 8), setting AQ mode to 0
Svt[warn]: Instance 1: Restoration Filtering is unsupported with source dimensions (8 / 8), disabling Restoration Filtering
Svt[warn]: TPL is disabled for aq_mode 0
Svt[info]: Number of logical cores available: 4
Svt[info]: Number of PPCS 41
Svt[info]: [asm level on system : up to avx512]
Svt[info]: [asm level selected : up to avx2]
Svt[info]: -------------------------------------------
Svt[info]: SVT [config]: main profile   tier (auto)     level (auto)
Svt[info]: SVT [config]: width / height / fps numerator / fps denominator               : 8 / 8 / 25 / 1
Svt[info]: SVT [config]: bit-depth / color format                                       : 8 / YUV420
Svt[info]: SVT [config]: preset / tune / pred struct                                    : 10 / SSIM / random access
Svt[info]: SVT [config]: gop size / mini-gop size / key-frame type                      : 161 / 32 / key frame
Svt[info]: SVT [config]: BRC mode / rate factor                                         : CRF / 35.00 
Svt[info]: SVT [config]: AQ mode / variance boost strength / octile / curve             : 0 / 2 / 6 / regular
Svt[info]: SVT [config]: Sharpness / QP scale compress strength / Frame low-luma bias   : 0 / 1 / 0
Svt[info]: SVT [config]: Temporal Filtering Strength                                    : 1
Svt[info]: -------------------------------------------
Encoding          zsh: exit 224                                ffmpeg -v 0 -f lavfi -i color=s=8x8 -f yuv4mpegpipe - | 
zsh: floating point exception (core dumped)  ./SvtAv1EncApp -i - -b /dev/null
    ~/svt-av1-psy/Bin/Release    master                                                                                      224|FPE ✘ 

Platform (please complete the following information):

Version String (please complete the following information):

Additional context / Relevant Files Also happens on Windows and AVX-512 enabled build (built using media-autobuild_suite) Windows says: INTEGER_DIVIDE_BY_ZERO_c0000094_SvtAv1EncApp.exe!Unknown

Mr-Z-2697 commented 1 month ago

Looks like the problem is this: https://github.com/gianni-rosato/svt-av1-psy/blob/e9b37c7b8f579b7501976e8d13a739256a988579/Source/Lib/Codec/pic_analysis_process.c#L1535-L1538

gianni-rosato commented 1 month ago

Thanks for the detailed issue report! We'll look into this ASAP.

juliobbv-p commented 1 month ago

@Mr-Z-2697 fix has been pushed to testing. Can you check it works?

Mr-Z-2697 commented 1 month ago

Thank you, it works.