BLTsville for Linux

CPU Implementation - Version 2.1.0.0


Copyright © 2012 Texas Instruments, Inc.

By using this software you agree that you have read, understood, and agree to be bound by the terms in the accompanying license file, and to comply with all applicable laws and regulations regarding use of this software.  If you do not agree to these terms, you do not have permission to use this software.


What is BLTsville?

BLTsville is an open, non-implementation specific API for performing 2-D operations.  It can control software and hardware implementations alike.  Details are at http://bltsville.github.com.


What is this?

This is a CPU-based implementation which uses optimized ARM and Neon code to perform the 2-D operations.  It can be distributed for use any Texas Instruments device.  See the license file for details.


Known issues:

  • Blend types BVBLEND_SRC1 and BVBLEND_SRC2 are functionally equivalent to ROPs of 0xCCCC and 0xF0F0, respectively.  But these two ways of specifying the same operation currently take two different code paths, so:
  1. When a conversion is supported by both paths, the performance of them will differ.  In general, the ROP path will be faster.
  2. When a conversion is not supported in the ROP path, it may be supported in the blend path.
  3. When a conversion is supported in the blend path, it may not be supported in the ROP path.

Bugfixes/Additions:

2.1.0.0

  • Updated headers to 2.1.0.0 (forwards and backwards compatible with clients).
  • Changed test for surface equality to use bvbuffdesc and bvsurfgeom pointers (as per spec) instead of members.
  • Corrected inconsistent initial scaling phase when clipping.
  • Added error returns for rectangles in subsampled surfaces that split subsamples.
  • Corrected incorrect validation during scaling which could return error for properly clipped rectangles.
  • Loosened validation of bvbuffmap structures in bvbuffdesc.map to avoid other implementation errors causing problems.
  • Improved errdesc messages to help with debugging.
  • Corrected color component error when using an RGBx24 solid color with a blend.

2.0.0.10

  • Fixed segfault when doing vertical scaling, but not horizontal.

2.0.0.9

  • Improved structure validation checks.
  • Fixed two issues that could cause access of bvbltparams members associated with unused surfaces.
  • Added validation of dithermode when doing fills (dithering not currently supported for fills).
  • Added support for BVDITHER_GOOD_ON, BVDITHER_BETTER_ON, and BVDITHER_BEST_ON.
  • Fixed issue with rotated surfaces and fills.
  • Added 4 new conversions:
    • RGBx24 to UYVY
    • UYVY to RGBx24
    • NV12 to RGBx24
    • NV12 to BGRx24
  • Added scaled RGBA24 SRC1OVER blend into RGB16 (source2 and destination must be the same).
  • Added scaled RGBA24 SRC1OVER blend into RGB16 with dithering (source2 and destination must be the same).
  • Changed method of non-interpolated upscaling for better pixel distribution.
  • Fixed incorrect color in RGBx24 to RGB16 dithering for images without a multiple of 8 width.

2.0.0.8

  • Fixed occasional failure to initialize that caused return of BVERR_RSRC.

2.0.0.7

  • Fixed typedef of bv_unmap member of bvbuffmap structure (bvinternal.h issue).
  • Fixed access-after-free bug in bv_unmap().
  • Changed method of handling over-read on last source line during scaling.

2.0.0.6

  • Added more dither validation.
  • Extended non-interpolated scaling to all supported 32-bit formats.
  • Added ordered 2x2/4x4 dither for RGBx24 to RGB16.
  • Fixed issue with NV12 rectangle offset that caused incorrect colors on right edge of images.
  • Added support for ALPHA8 as mask (instead of MONO8).

2.0.0.5

  • Fix for clipping regression of negative coordinates and clips result in NULL rectangles.
  • Fixed YUV to RGB conversion overflow if the YUV is out of (ITU-R Bt.601) range.
  • Fixed scaling and dithering for multi-threaded clients.

2.0.0.4

  • Fix for clipping of scaled images.
  • Fix for random alpha value when converting from RGB16 to RGB124.
  • Fix for incorrect alpha used for right edge of scaled blend of RGBA24 to RGB124.
  • Fix for occasionally incorrect blend in scaled blend of RGBA24 to RGB124.
  • Fix to recognize global alpha supplied with SRC1 blend and return unsupported error.

2.0.0.3

  • Fixed YV12 to NV12 bug which used wrong dimensions for source U and V planes.
  • Fixed clipping for blends.
  • Speed improvement for non-interpolated scale of RGB16 to RGB124.
  • Added SRC1OVER blend of non-interpolated scaled RGBA24 source 1 into RGBA24 or RGB124 destination (source 2 == destination).
  • Fixed error clipping images scaled vertically but not horizontally.

2.0.0.2

  • Clipping added for all supported ROP operations
    • Solid Fill
    • Copy/Conversion
    • Rotation
  • Fix for UYVY/VYUY 180° rotation
  • Fix for rotation normalization (calculating difference between surface orientations)
  • Removed double-rotation in some cases
  • Added check for NULL and inverted rectangles
  • 8 new NV12 operations:
    • NV12 to RGB24
    • NV12 to BGR24
    • RGB16 to NV12
    • BGR16 to NV12
    • RGB24 to NV12
    • BGR24 to NV12
    • RGBx24 to NV12
    • BGRx24 to NV12

2.0.0.1

  • Fixed bad calculations when clipping.
  • Fixed clipping of negative rectangles when scaling.
  • Added rejection of scaled/clipped rectangles outside of surfaces.
  • Fixed error blending when local and global alphas are both used.

2.0.0.0

Initial release

Contents:

.../lib/linux/libbltsville_cpu.so Client entry point for CPU-based implementations. Softlink to libbltsville_ticpu.so.
.../lib/linux/libbltsville_ticpu.so Client entry point for special cases.  Softlink to libbltsville_ticpu.so.2.0.0.10.  (Most clients should not use this entry.)
.../lib/linux/libbltsville_ticpu.so.2.0.0.10 Version 2.0.0.10 of the TI BLTsville CPU-based library of 2-D functions for Linux.  (Do not directly load this file.)

To Install:

  1. Copy .../lib/linux/* to /lib on the target device.
NOTE: Two of the files are symbolic links, which require care when copying to avoid being replaced with a copy of the target library.

NOTE: The license file must be installed on the target system with the binaries.

Functions supported:

Solid Fill (1x1 Source 1)
Destination
LUT8 RGB16 BGR24 RGB24 BGR024 RGB024 BGR124 RGB124 BGRA24 RGBA24 0BGR24 0RGB24 1BGR24 1RGB24 ABGR24 ARGB24 nBGRA24 nRGBA24 nABGR24 nARGB24 UYVY/Y422 YUYV/YUY2 IYUV/I420 NV12 YV12
+ + + + + + + + + + + + + + + + + + + +          

 

Color Space Conversion
Source 1 Destination
  LUT8 RGB16 BGR24 RGB24 BGR024 RGB024 BGR124 RGB124 BGRA24 RGBA24 0BGR24 0RGB24 1BGR24 1RGB24 ABGR24 ARGB24 nBGRA24 nRGBA24 nABGR24 nARGB24 UYVY/Y422 YUYV/YUY2 IYUV/I420 NV12 YV12
LUT8 + + + + + + + + + + + + + +     + + + +          
RGB16   + + + + + + +                               +  
BGR16                                               +  
BGR24   + + + + + + +     + + + +             +     +  
RGB24   + + + + + + +     + + + +             +     +  
BGRx24   + + + + + + +     + + + +             +     +  
RGBx24   + + + + + + +     + + + +             +     +  
xBGR24     + + + + + +     + + + +                      
xRGB24     + + + + + +     + + + +                      
BGRA24                 + +         + + +                
RGBA24                 + +         + +   +              
ABGR24                 + +         + +                  
ARGB24                 + +         + +                  
nBGRA24                                 + + + +          
nRGBA24                                 + + + +          
nABGR24                                 + + + +          
nARGB24                                 + + + +          
UYVY/Y422   + + + + + + +                         +        
YUYV/YUY2                                           +      
IYUV/I420   +                                     +   +    
NV12     + + + + + +                               +  
YV12                                               +  

 

Color Space Conversion
(with Dither)
Source 1 Destination
   RGB16
BGRx24 +
RGBx24 +

 

Scaling: Non-interpolated
(NEAREST_NEIGHBOR)
Source 1 Destination
   BGR124 RGB124 1BGR24 1RGB24 BGRA24 RGBA24 ABGR24 ARGB24 nBGRA24 nRGBA24 nABGR24 nARGB24
RGB16   +                    
BGRx24 +                      
RGBx24   +                    
xBGR24     +                  
xRGB24       +                
BGRA24         +              
RGBA24           +            
ABGR24             +          
ARGB24               +        
nBGRA24                 +      
nRGBA24                   +    
nABGR24                     +  
nARGB24                       +

 

Rotation
Angle Format
   LUT8 RGB16 UYVY/Y422 YUYV/YUY2 IYUV/I420 NV12
90 Degrees +* +* +* +* +* +*
180 Degrees +* +* +* +* +* +*
270 Degrees +* +* +* +* +* +*

* = Rotation has width/height limitations.. See the chart below

Rotation Limitations
Angle Format
   LUT8 RGB16 UYVY/Y422 YUYV/YUY2 IYUV/I420 NV12
90 Degrees Multiple of 4 x 8  Multiple of 8 x 8 Multiple of 2 x 8 Multiple of 2 x 8 Multiple of 8 x 16 Multiple of 16 x 16
180 Degrees Multiple of 16 x 1 Multiple of 8 x 1 Multiple of 8 x 1 Multiple of 8 x 1 Multiple of 32 x 2 Multiple of 16 x 2
270 Degrees Multiple of 4 x 8 Multiple of 8 x 8 Multiple of 2 x 8 Multiple of 2 x 8 Multiple of 8 x 16 Multiple of 16 x 16

(Rotation does not support scaling.)

 

(Blends do not support clipping or scaling.)
(Source 1 or Source 2 can be a 1x1 rectangle for solid color.)
(Color space conversion is performed as indicated.)

Blend: CLEAR
Destination
RGB16 BGR24 RGB24 BGR024 RGB024 BGR124 RGB124 BGRA24 RGBA24
+ + + +  + + + + +

 

Blend: SRC1
Source 1 Destination
   RGB16 BGR24 RGB24 BGR024 RGB024 BGR124 RGB124 BGRA24 RGBA24
RGB16 + + + + + + +    
BGR24 + + + + + + +    
RGB24 + + + + + + +    
BGRx24 + + + + + + +    
RGBx24 + + + + + + +    
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + +    

 

Blend: SRC2
Source 2 Destination
   RGB16 BGR24 RGB24 BGR024 RGB024 BGR124 RGB124 BGRA24 RGBA24
RGB16 + + + + + + +    
BGR24 + + + + + + +    
RGB24 + + + + + + +    
BGRx24 + + + + + + +    
RGBx24 + + + + + + +    
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + +    

 

Blend: SRC1OVER
(uses only Source 1 and Source 2 alphas, if present)
Source 1 Source 2 Destination
    RGB16 BGR24 RGB24 BGR024 RGB024 BGR124 RGB124 BGRA24 RGBA24
BGRA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
RGBA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
nBGRA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
nRGBA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +

 

Blend: SRC1OVER | GLOBAL
(uses global alpha as well as source 1 and source 2 alphas, if present)
Source 1 Source 2 Destination
    RGB16 BGR24 RGB24 BGR024 RGB024 BGR124 RGB124 BGRA24 RGBA24
RGB16 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
BGR24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
RGB24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
BGRx24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
RGBx24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
BGRA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
RGBA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
nBGRA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
nRGBA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
UYVY/Y422 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +

 

Blend: SRC1OVER
(uses mask alpha as well as source 1 and source 2 alphas, if present)
(only mask format of ALPHA8 is supported)
Source 1 Source 2 Destination
    RGB16 BGR24 RGB24 BGR024 RGB024 BGR124 RGB124 BGRA24 RGBA24
RGB16 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
BGR24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
RGB24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
BGRx24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
RGBx24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
BGRA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
RGBA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
nBGRA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
nRGBA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
UYVY/Y422 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +

 

Blend: SRC1OVER
(uses global alpha, mask alpha, as well as source 1 and source 2 alphas, when present)
(only mask format of ALPHA8 is supported)
Source 1 Source 2 Destination
    RGB16 BGR24 RGB24 BGR024 RGB024 BGR124 RGB124 BGRA24 RGBA24
RGB16 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
BGR24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
RGB24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
BGRx24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
RGBx24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
BGRA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
RGBA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
nBGRA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
nRGBA24 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +
UYVY/Y422 RGB16 + + + + + + + + +
BGR24 + + + + + + + + +
RGB24 + + + + + + + + +
BGRx24 + + + + + + + + +
RGBx24 + + + + + + + + +
BGRA24               + +
RGBA24               + +
nBGRA24               + +
nRGBA24               + +
UYVY/Y422 + + + + + + + + +

 

Non-Interpolated Scale (Nearest Neighbor) + Blend: SRC1OVER
(uses only Source 1 and Source 2/Destination alphas, if present)
Source 1 Source 2 Destination
    RGB16 RGB124 RGBA24
RGBA24
RGB16 +*,**    
RGBx24   +*  
RGBA24     +*

* Source 2 and Destination must be the same surface (and have the same geometry) and share the same rectangle.
** With and without ordered dither.