watery01 / libyuv

Automatically exported from code.google.com/p/libyuv
0 stars 0 forks source link

RGBA format support? #78

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
RGBA is R in msb and A in lsb.
libyuv supports ARGB, BGRA, and ABGR but not RGBA.
This is apparently used in Android for bigendian platforms?  Consider adding 
it, so all four swizzlings of ARGB are available.

Original issue reported on code.google.com by fbarch...@chromium.org on 30 Aug 2012 at 8:45

GoogleCodeExporter commented 9 years ago
A quick grep shows ABGR (little endian RGBA) only has a few entry points

c:\src\libyuv\trunk\include\libyuv>findstr ABGR *.h
convert.h:// ABGR little endian (rgba in memory) to I420
convert.h:int ABGRToI420(const uint8* src_frame, int src_stride_frame,
convert_argb.h:// ABGR little endian (rgba in memory) to ARGB
convert_argb.h:int ABGRToARGB(const uint8* src_frame, int src_stride_frame,
convert_from.h:int I420ToABGR(const uint8* src_y, int src_stride_y,
planar_functions.h:#define ARGBToABGR ABGRToARGB
video_common.h:  FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'),
video_common.h:  FOURCC_BPP_ABGR = 32,

RGB565 has a few more for mobile
c:\src\libyuv\trunk\include\libyuv>findstr RGB565 *.h
convert.h:int RGB565ToI420(const uint8* src_frame, int src_stride_frame,
convert_argb.h:int RGB565ToARGB(const uint8* src_frame, int src_stride_frame,
convert_from.h:int I420ToRGB565(const uint8* src_y, int src_stride_y,
planar_functions.h:// Convert NV12 to RGB565.
planar_functions.h:int NV12ToRGB565(const uint8* src_y, int src_stride_y,
planar_functions.h:// Convert NV21 to RGB565.
planar_functions.h:int NV21ToRGB565(const uint8* src_y, int src_stride_y,
planar_functions.h:// Convert ARGB To RGB565.
planar_functions.h:int ARGBToRGB565(const uint8* src_argb, int src_stride_argb,

so adding RGBA isnt too bad.  There will be many row functions, but just 
variations of existing ABGR.

Original comment by fbarch...@chromium.org on 12 Sep 2012 at 9:36

GoogleCodeExporter commented 9 years ago
c:\src\libyuv\trunk>build\release\libyuv_unittest.exe 
--gtest_catch_exceptions=0 --gtest_filter=*RGBA*
Note: Google Test filter = *RGBA*
[==========] Running 6 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 6 tests from libyuvTest
[ RUN      ] libyuvTest.ARGBToRGBA_OptVsC
[       OK ] libyuvTest.ARGBToRGBA_OptVsC (531 ms)
[ RUN      ] libyuvTest.ARGBToRGBAInvert_OptVsC
[       OK ] libyuvTest.ARGBToRGBAInvert_OptVsC (530 ms)
[ RUN      ] libyuvTest.RGBAToARGB_OptVsC
[       OK ] libyuvTest.RGBAToARGB_OptVsC (531 ms)
[ RUN      ] libyuvTest.RGBAToARGBInvert_OptVsC
[       OK ] libyuvTest.RGBAToARGBInvert_OptVsC (515 ms)
[ RUN      ] libyuvTest.ARGBToRGBA_Random
[       OK ] libyuvTest.ARGBToRGBA_Random (109 ms)
[ RUN      ] libyuvTest.RGBAToARGB_Random
[       OK ] libyuvTest.RGBAToARGB_Random (125 ms)
[----------] 6 tests from libyuvTest (2356 ms total)

[----------] Global test environment tear-down
[==========] 6 tests from 1 test case ran. (2356 ms total)
[  PASSED  ] 6 tests.

Original comment by fbarch...@chromium.org on 14 Sep 2012 at 5:57

GoogleCodeExporter commented 9 years ago
r355 adds I420 to and from RGBA, completing the RGBA functionality, but not 
optimized.

Original comment by fbarch...@google.com on 16 Sep 2012 at 11:33

GoogleCodeExporter commented 9 years ago
I420ToARGB_OptVsC (849 ms)
I420ToBGRA_OptVsC (862 ms)
I420ToABGR_OptVsC (855 ms)
I420ToRGBA_OptVsC (30922 ms)

ARGBToI420_OptVsC (628 ms)
BGRAToI420_OptVsC (626 ms)
ABGRToI420_OptVsC (632 ms)
RGBAToI420_OptVsC (8400 ms)

Original comment by fbarch...@chromium.org on 18 Sep 2012 at 1:28

GoogleCodeExporter commented 9 years ago
r359 optimized for SSSE3
I420ToRGBA_OptVsC (850 ms)
RGBAToI420_OptVsC (621 ms)

Original comment by fbarch...@chromium.org on 18 Sep 2012 at 6:05

GoogleCodeExporter commented 9 years ago

Original comment by fbarch...@chromium.org on 18 Sep 2012 at 6:06

GoogleCodeExporter commented 9 years ago
r364 adds NEON version.

Original comment by fbarch...@google.com on 19 Sep 2012 at 2:16