Repository navigation
Conversation
lusoris
force-pushed
the
fix/float-ms-ssim-min-dimension
branch
2 times, most recently
from
October 2, 2026 05:23
1f688cc to
2c28b8f
Compare
… init compute_ms_ssim() halves the frame SCALES - 1 times and needs at least GAUSSIAN_LEN pixels in both dimensions at every scale. A smaller frame (176x144, QCIF) therefore failed in every extract() call with "error: scale below 1x1!" and only a generic "problem with feature extractor" warning. Check the size in init() instead, with the minimum derived from the existing macros (GAUSSIAN_LEN << (SCALES - 1) = 176), and log the frame size and the minimum. Frames of 176x176 and above are unchanged. Add a test_feature_extractor case: init fails for 176x144, 175x176 and 176x175 and succeeds for 176x176. Co-Authored-By: Claude Opus 5.5 <[email protected]>
lusoris
force-pushed
the
fix/float-ms-ssim-min-dimension
branch
from
October 2, 2026 18:43
2c28b8f to
81a0f88
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
float_ms_ssimcannot score a frame below 176 pixels in either dimension. It fails in everyextract()call witherror: scale below 1x1!and a generic warning, instead of saying why at init. This moves the check toinit()and names the limit. Addresses #1414.Cause
float_ms_ssimcallscompute_ms_ssim()with default arguments:SCALES= 5 (iqa/ssim_tools.h) and the 11-tap Gaussian window (GAUSSIAN_LEN).compute_ms_ssim()(ms_ssim.c, "make sure we won't scale below 1x1") halves width and height with integer division and needs at leastGAUSSIAN_LENpixels in both dimensions at each of the 5 scales. The smallest frame is thereforeGAUSSIAN_LEN << (SCALES - 1)= 176 in both dimensions.init()did not check this, so the failure came at the first frame.Reproducer
Master
6ec23e8f2(reproduced there; the code is unchanged in 9e48141), release build, 176x144 (QCIF-sized) 4:2:0 input:meson setup build libvmaf --buildtype release ninja -C build build/tools/vmaf -r q176x144.yuv -d q176x144.yuv -w 176 -h 144 -p 420 -b 8 \ --feature float_ms_ssim -q --json -o out.jsonerror: scale below 1x1!,problem with feature extractor "float_ms_ssim" at index 0, exit 1libvmaf ERROR float_ms_ssim: frame 176x144 is below the 176x176 minimum for 5-scale MS-SSIM, exit 234 (-EINVAL)Fix
init()returns-EINVALand logs the frame size and the minimum whenworhis belowGAUSSIAN_LEN << (SCALES - 1). The constant comes from the two existing macros (float_ms_ssim.cnow includesiqa/ssim_tools.h, asssim.candms_ssim.cdo), so it follows if either changes.This does not fall back to fewer scales for small frames: that would change what the number means. It also does not make small frames work; the report asks whether to reduce the number of levels or to reject, and this takes the second option. If a reduced-scale mode is preferred, that is a separate change.
The process exit status for the failing run changes from 1 to 234 (
-EINVALas an unsigned byte), because the error frominit()is now whatvmafreturns.Tests
New
test_float_ms_ssim_minimum_dimensioninlibvmaf/test/test_feature_extractor.c: init fails with-EINVALfor 176x144, 175x176 and 176x175, and succeeds for 176x176. Against master'sfloat_ms_ssim.cwith the new test, the case fails ("float_ms_ssim init should reject a frame below 176 in either dimension"); with this changetest_feature_extractorpasses 5/5.Validation
x86-64 Linux, GCC 16.2.1, on master
9e48141b. Rebased on master 9e48141 (2026-10-02).meson test(-Denable_float=true -Denable_checkasm=true): 25/25 on master, 25/25 here.-Db_sanitize=address,undefined -Db_lto=falsebuild: 22 pass and 3 fail on master, 22 pass and 3 fail here;test_predictandtest_pic_preallocationfail on LeakSanitizer reports andcheckasmaborts on aheap-buffer-overflowinadm_dwt2_16(integer_adm.c:2603on master), on both, and this change does not touch them.--feature float_ms_ssimadded (1920x1080 and 576x324, all above the minimum), give identical per-frame and pooled output on master and on this branch, with the default CPU dispatch and with SIMD masked off. No golden assertion changes.The workflow run on this PR needs a maintainer's approval.