ARM NEON Compositor  master
Fast SIMD alpha overlay and blending for ARM
Variables
perf_test Namespace Reference

Variables

 dir = path.dirname(path.realpath(__file__))
 
 parser = argparse.ArgumentParser(description='Benchmark for overlay_alpha')
 
 dest
 
 action
 
 help
 
 type
 
 int
 
 default
 
 choices
 
 args = parser.parse_args()
 
 uint8_t_p = ctypes.POINTER(ctypes.c_uint8)
 
 size_t = ctypes.c_size_t
 
 void = None
 
string so = "libalpha-lib-"
 
 dll = ctypes.cdll.LoadLibrary(path.join(dir, so))
 
 overlay_alpha = dll['overlay_alpha_stride_' + args.rescale]
 
 argtypes
 
 restype
 
 sizes = np.linspace(args.min_size, args.max_size, args.N, dtype=np.int)
 
 times = np.zeros((args.N, ))
 
 bg_img = np.random.randint(255, size=(size, size, 4), dtype=np.uint8)
 
 fg_img = np.random.randint(255, size=(size, size, 4), dtype=np.uint8)
 
 out_img = np.zeros((size, size, 4), dtype=np.uint8)
 
 bg_img_p = bg_img.ctypes.data_as(uint8_t_p)
 
 fg_img_p = fg_img.ctypes.data_as(uint8_t_p)
 
 out_img_p = out_img.ctypes.data_as(uint8_t_p)
 
 iterations = int(round(args.max_size * args.max_iterations / size))
 
 start_time = time.perf_counter()
 
 end_time = time.perf_counter()
 
 results = np.column_stack((sizes, times))
 
tuple simd = (' simd ' if args.SIMD else ' no-simd ')
 
tuple name = str(time.asctime()) + simd + args.rescale + ' ' + platform.machine()
 
 delimiter
 

Variable Documentation

◆ dir

dir = path.dirname(path.realpath(__file__))

Definition at line 61 of file perf_test.py.

◆ parser

parser = argparse.ArgumentParser(description='Benchmark for overlay_alpha')

Definition at line 63 of file perf_test.py.

◆ dest

dest

Definition at line 64 of file perf_test.py.

◆ action

action

Definition at line 64 of file perf_test.py.

◆ help

help

Definition at line 65 of file perf_test.py.

◆ type

type

Definition at line 66 of file perf_test.py.

◆ int

int

Definition at line 66 of file perf_test.py.

◆ default

default

Definition at line 66 of file perf_test.py.

◆ choices

choices

Definition at line 74 of file perf_test.py.

◆ args

args = parser.parse_args()

Definition at line 78 of file perf_test.py.

◆ uint8_t_p

uint8_t_p = ctypes.POINTER(ctypes.c_uint8)

Definition at line 82 of file perf_test.py.

◆ size_t

size_t = ctypes.c_size_t

Definition at line 83 of file perf_test.py.

◆ void

void = None

Definition at line 84 of file perf_test.py.

◆ so

string so = "libalpha-lib-"

Definition at line 86 of file perf_test.py.

◆ dll

dll = ctypes.cdll.LoadLibrary(path.join(dir, so))

Definition at line 90 of file perf_test.py.

◆ overlay_alpha

overlay_alpha = dll['overlay_alpha_stride_' + args.rescale]

Definition at line 91 of file perf_test.py.

◆ argtypes

argtypes

Definition at line 92 of file perf_test.py.

◆ restype

restype

Definition at line 101 of file perf_test.py.

◆ sizes

sizes = np.linspace(args.min_size, args.max_size, args.N, dtype=np.int)

Definition at line 104 of file perf_test.py.

◆ times

times = np.zeros((args.N, ))

Definition at line 105 of file perf_test.py.

◆ bg_img

bg_img = np.random.randint(255, size=(size, size, 4), dtype=np.uint8)
Examples
examples/overlay_alpha/overlay_alpha.cpp.

Definition at line 112 of file perf_test.py.

◆ fg_img

fg_img = np.random.randint(255, size=(size, size, 4), dtype=np.uint8)
Examples
examples/overlay_alpha/overlay_alpha.cpp.

Definition at line 113 of file perf_test.py.

◆ out_img

out_img = np.zeros((size, size, 4), dtype=np.uint8)

Definition at line 114 of file perf_test.py.

◆ bg_img_p

bg_img_p = bg_img.ctypes.data_as(uint8_t_p)

Definition at line 115 of file perf_test.py.

◆ fg_img_p

fg_img_p = fg_img.ctypes.data_as(uint8_t_p)

Definition at line 116 of file perf_test.py.

◆ out_img_p

out_img_p = out_img.ctypes.data_as(uint8_t_p)

Definition at line 117 of file perf_test.py.

◆ iterations

iterations = int(round(args.max_size * args.max_iterations / size))

Definition at line 120 of file perf_test.py.

◆ start_time

start_time = time.perf_counter()

Definition at line 121 of file perf_test.py.

◆ end_time

end_time = time.perf_counter()

Definition at line 124 of file perf_test.py.

◆ results

results = np.column_stack((sizes, times))

Definition at line 128 of file perf_test.py.

◆ simd

tuple simd = (' simd ' if args.SIMD else ' no-simd ')

Definition at line 129 of file perf_test.py.

◆ name

tuple name = str(time.asctime()) + simd + args.rescale + ' ' + platform.machine()

Definition at line 130 of file perf_test.py.

◆ delimiter

delimiter

Definition at line 131 of file perf_test.py.