ARM NEON Compositor
master
Fast SIMD alpha overlay and blending for ARM
|
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 | |
dir = path.dirname(path.realpath(__file__)) |
Definition at line 61 of file perf_test.py.
parser = argparse.ArgumentParser(description='Benchmark for overlay_alpha') |
Definition at line 63 of file perf_test.py.
dest |
Definition at line 64 of file perf_test.py.
action |
Definition at line 64 of file perf_test.py.
help |
Definition at line 65 of file perf_test.py.
type |
Definition at line 66 of file perf_test.py.
int |
Definition at line 66 of file perf_test.py.
default |
Definition at line 66 of file perf_test.py.
choices |
Definition at line 74 of file perf_test.py.
args = parser.parse_args() |
Definition at line 78 of file perf_test.py.
uint8_t_p = ctypes.POINTER(ctypes.c_uint8) |
Definition at line 82 of file perf_test.py.
size_t = ctypes.c_size_t |
Definition at line 83 of file perf_test.py.
void = None |
Definition at line 84 of file perf_test.py.
string so = "libalpha-lib-" |
Definition at line 86 of file perf_test.py.
Definition at line 90 of file perf_test.py.
overlay_alpha = dll['overlay_alpha_stride_' + args.rescale] |
Definition at line 91 of file perf_test.py.
argtypes |
Definition at line 92 of file perf_test.py.
restype |
Definition at line 101 of file perf_test.py.
sizes = np.linspace(args.min_size, args.max_size, args.N, dtype=np.int) |
Definition at line 104 of file perf_test.py.
times = np.zeros((args.N, )) |
Definition at line 105 of file perf_test.py.
bg_img = np.random.randint(255, size=(size, size, 4), dtype=np.uint8) |
Definition at line 112 of file perf_test.py.
fg_img = np.random.randint(255, size=(size, size, 4), dtype=np.uint8) |
Definition at line 113 of file perf_test.py.
out_img = np.zeros((size, size, 4), dtype=np.uint8) |
Definition at line 114 of file perf_test.py.
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.ctypes.data_as(uint8_t_p) |
Definition at line 116 of file perf_test.py.
out_img_p = out_img.ctypes.data_as(uint8_t_p) |
Definition at line 117 of file perf_test.py.
iterations = int(round(args.max_size * args.max_iterations / size)) |
Definition at line 120 of file perf_test.py.
start_time = time.perf_counter() |
Definition at line 121 of file perf_test.py.
end_time = time.perf_counter() |
Definition at line 124 of file perf_test.py.
Definition at line 128 of file perf_test.py.
tuple simd = (' simd ' if args.SIMD else ' no-simd ') |
Definition at line 129 of file perf_test.py.
tuple name = str(time.asctime()) + simd + args.rescale + ' ' + platform.machine() |
Definition at line 130 of file perf_test.py.
delimiter |
Definition at line 131 of file perf_test.py.