[FFmpeg-devel] [PATCH v1 0/6] swscale: Add dedicated RGB->YUV unscaled functions & aarch64 asm

John Cox jc at kynesim.co.uk
Sun Aug 20 18:10:16 EEST 2023


This patch set expands the set of dedicated RGB->YUV unscaled functions
to help with encoding camera output on a Pi. Obviously there are other
uses but that was the motivation.

It enforces the general bitexact path for the fate tests that depend on
it.
It renames the existing bgr function as bgr... so we don't end up with
the counterintuative situation where BGR is handled by rgb... and BGR
would be handled by rgb..
Adds RGB functions
Improves the rounding in the dedicated function as that improves its
score when tested with test/swscale and fixes it to allow any width
(contrary to the comment any height was already allowed).
Adds XRGB->YUV functions to complete the set
Adds Aarch64 neon for BGR24 & RGB24

I haven't built fate tests for this  as I'm not quite sure what the
appropriate tests would be. The x86 asm doesn't match either the C
template with improved rounding or the previous template (I'm not quite
sure what it does but it produces a different score out of tests/swscale
to either method) so a simple results match isn't going to work.

Regards

John Cox

John Cox (6):
  fate-filter-fps: Set swscale bitexact for tests that do conversions
  swscale: Rename BGR24->YUV conversion functions as bgr...
  swscale: Add explicit rgb24->yv12 conversion
  swscale: RGB24->YUV allow odd widths & improve C rounding
  swscale: Add unscaled XRGB->YUV420P functions
  swscale: Add aarch64 functions for RGB24->YUV420P

 libswscale/aarch64/rgb2rgb.c      |   8 +
 libswscale/aarch64/rgb2rgb_neon.S | 356 ++++++++++++++++++++++++++++++
 libswscale/bayer_template.c       |   2 +-
 libswscale/rgb2rgb.c              |  25 +++
 libswscale/rgb2rgb.h              |  23 ++
 libswscale/rgb2rgb_template.c     | 174 +++++++++++++--
 libswscale/swscale_unscaled.c     | 114 +++++++++-
 libswscale/x86/rgb2rgb_template.c |  13 +-
 tests/fate/filter-video.mak       |   4 +-
 9 files changed, 694 insertions(+), 25 deletions(-)

-- 
2.39.2



More information about the ffmpeg-devel mailing list