File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1066,7 +1066,6 @@ void kernel_ThresholdRectToPix(
1066
1066
__global int * pix ) {
1067
1067
1068
1068
// declare variables
1069
- uint pad = PIXELS_PER_WORD * wpl - width ;//number of padding bits at the end of each output line
1070
1069
int pThresholds [NUM_CHANNELS ];
1071
1070
int pHi_Values [NUM_CHANNELS ];
1072
1071
for ( int i = 0 ; i < NUM_CHANNELS ; i ++ ) {
@@ -1077,15 +1076,16 @@ void kernel_ThresholdRectToPix(
1077
1076
// for each word (32 pixels) in output image
1078
1077
for ( uint w = get_global_id (0 ); w < wpl * height ; w += get_global_size (0 ) ) {
1079
1078
unsigned int word = 0 ; // all bits start at zero
1080
- //decrease the pixel index for the padding at the end of each output line (=number of lines * padding)
1081
- uint pxIdxOffset = ( w / wpl ) * pad ;// = ( ( PIXELS_PER_WORD * w) / ( width + pad)) * pad;
1082
1079
// for each burst in word
1083
1080
for ( int b = 0 ; b < BURSTS_PER_WORD ; b ++ ) {
1084
1081
// load burst
1085
1082
charVec pixels ;
1086
- for ( int i = 0 ; i < (PIXELS_PER_BURST * NUM_CHANNELS )/CHAR_VEC_WIDTH ; i ++ ) {
1087
- pixels .v [i ] = imageData [w * (BURSTS_PER_WORD * (PIXELS_PER_BURST * NUM_CHANNELS )/CHAR_VEC_WIDTH ) + b * ((PIXELS_PER_BURST * NUM_CHANNELS )/CHAR_VEC_WIDTH ) + i - pxIdxOffset ];
1088
- }
1083
+ int offset = (w / wpl ) * width ;
1084
+ offset += (w % wpl ) * PIXELS_PER_WORD ;
1085
+ offset += b * PIXELS_PER_BURST ;
1086
+
1087
+ for (int i = 0 ; i < PIXELS_PER_BURST ; ++ i )
1088
+ pixels .v [i ] = imageData [offset + i ];
1089
1089
1090
1090
// for each pixel in burst
1091
1091
for ( int p = 0 ; p < PIXELS_PER_BURST ; p ++ ) {
You can’t perform that action at this time.
0 commit comments