[FFmpeg-trac] #10495(avfilter:new): Optimized (x86 assembly) version of vf_ssim works incorrectly for some video inputs
FFmpeg
trac at avcodec.org
Mon Jul 31 13:16:57 EEST 2023
#10495: Optimized (x86 assembly) version of vf_ssim works incorrectly for some
video inputs
----------------------------------+--------------------------------------
Reporter: Evgeny | Type: defect
Status: new | Priority: normal
Component: avfilter | Version: git-master
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
----------------------------------+--------------------------------------
Summary of the bug:
Optimized assembly implementation of vf_sim is expected to behave
identically to unoptimized (C-code) implementation, i.e. same metrics
should be reported for the same input videos. However, due to bug in the
assembly code, it’s not always the case, and the reported metrics can be
different between the two. Optimized x86 assembly code works fine for
1920x1080 input, but failed for 852x480 input.
How to reproduce:
{{{
1. Build unoptimized ffmpeg binary by fully disable assembly optimization
for entire ffmpeg
% ./configure with --disable-asm
2. Download test 1080p (8-bit) input video (e.g.
https://media.xiph.org/video/derf/y4m/crowd_run_1080p50.y4m)
3. Rescale 1080p video to 852x480p (8-bit):
% ffmpeg -y -i crowd_run_1080p50.y4m -s 852x480 ref_852x480p50.y4m
4. Generate degrade (8-bit) video using x264, e.g.:
% ffmpeg -y -i ref_852x480p50.y4m -c:v libx264 -qp 40 x264_852x480p50.264
5. Compare (8-bit) SSIM Y/U/V generated with unoptimized ffmpeg binary
against SSIM generated using optimized ffmpeg binary:
Sample command line:
% ffmpeg -vsync 0 -i ref_852x480p50.y4m -i x264_852x480p50.264 -lavfi
"ssim" -f null –
Here is a difference between outputs for x86 assembly and C
implementations:
Optimized SSIM output: SSIM Y:0.770184 (6.386200) U:0.830635 (7.711759)
V:0.845416 (8.108361) All:0.792798 (6.836059)
Reference(Unoptimized) : SSIM Y:0.770184 (6.386200) U:0.829381 (7.679738)
V:0.844320 (8.077677) All:0.792406 (6.827860)
Some very tiny fractional difference could be observed due to compiler
uses different floating point instructions. However, the difference is
expected to be very small (e.g. < 1e-5).
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10495>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list