[FFmpeg-devel] [PATCH] vf_psnr: sse2 optimizations for sum-squared-error.

Clément Bœsch u at pkh.me
Sun Jul 12 10:39:32 CEST 2015


On Sat, Jul 11, 2015 at 10:50:26AM -0400, Ronald S. Bultje wrote:
> The internal line accumulator for 16bit can overflow, so I changed that
> from int to uint64_t in the C code. The matching assembly looks a little
> weird but output looks correct.

> It assumes aligned input pointers, I'm
> not sure if that's a requirement in lavfi (it should be IMO).
> 

You can get a misalignment by just cropping the left part of the video.

[~/src/ffmpeg]☭ ./ffmpeg -lavfi "testsrc,crop=iw-3:x=3 [a]; testsrc,hue,crop=iw-3:x=3 [b]; [a][b] psnr, trim=end=10" -f null -
ffmpeg version N-73542-g4607d0a Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.1.0 (GCC)
  configuration: --enable-gpl --enable-fontconfig --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libvpx --enable-x11grab --samples=/home/ux/fate-samples --assert-level=2 --enable-libass --enable-libpulse --enable-libopenjpeg --enable-x11grab
  libavutil      54. 28.100 / 54. 28.100
  libavcodec     56. 47.100 / 56. 47.100
  libavformat    56. 40.100 / 56. 40.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 21.100 /  5. 21.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf56.40.100
    Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p, 317x240 [SAR 1:1 DAR 317:240], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)
    Metadata:
      encoder         : Lavc56.47.100 rawvideo
Stream mapping:
  trim -> Stream #0:0 (rawvideo)
Press [q] to stop, [?] for help
[swscaler @ 0x323dea0] Warning: data is not aligned! This can lead to a speedloss
zsh: segmentation fault (core dumped)  ./ffmpeg -lavfi  -f null -
[~/src/ffmpeg]☠ 

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150712/ea965fa3/attachment.sig>


More information about the ffmpeg-devel mailing list