@@ -96,21 +96,22 @@ def rgba2gray_fn(of_in, of_out, rgba2gray_line):
9696 )
9797 )
9898
99+ v0 = 0
100+ v1 = 4096
101+ v_minus4 = - 16384
102+ initial_value = np .array (
103+ [[v0 ,v1 ,v0 ], [v1 ,v_minus4 ,v1 ], [v0 ,v1 ,v0 ]],dtype = np .int16
104+ )
99105filter_kernel_buff = Buffer (
100106np .ndarray [(3 ,3 ),np .dtype [np .int16 ]],
101107name = "kernel" ,
102- initial_value = np .array (
103- [[v0 ,v1 ,v0 ], [v1 ,v_minus4 ,v1 ], [v0 ,v1 ,v0 ]],dtype = np .int16
104- ),
108+ initial_value = initial_value ,
105109 )
106110
107111# Task for the core to perform
108112def filter_fn (of_in ,of_out ,kernel ,filter2d_line ):
109113# OF_2to3 -> intermediates[0]
110114# OF_3to4 -> intermediates[1]
111- v0 = 0
112- v1 = 4096
113- v_minus4 = - 16384
114115
115116for _ in range_ (sys .maxsize ):
116117# Preamble : Top Border
@@ -162,6 +163,7 @@ def filter_fn(of_in, of_out, kernel, filter2d_line):
162163 [
163164of_intermediates [0 ].cons (),
164165of_intermediates [1 ].prod (),
166+ filter_kernel_buff ,
165167filter2d_line_kernel ,
166168 ],
167169while_true = False ,