@@ -102,21 +102,19 @@ void print_gauss_filter_symbol( int columns )
102102 }
103103 printf (" \n " );
104104
105- printf (" level 0-filters for direct downscaling \n " );
105+ printf (" level 0-filter for the creation of the first level of the first octave \n " );
106106
107- for ( int lvl=0 ; lvl<MAX_OCTAVES; lvl++ ) {
108- int span = d_gauss.dd .span [lvl] + d_gauss.dd .span [lvl] - 1 ;
107+ int span = d_gauss.dd .span [0 ] + d_gauss.dd .span [0 ] - 1 ;
109108
110- printf (" %d %d %2.6f: " , lvl, span, d_gauss.dd .sigma [lvl] );
111- int m = min ( d_gauss.dd .span [lvl], columns );
112- for ( int x=0 ; x<m; x++ ) {
113- printf (" %0.8f " , d_gauss.dd .filter [lvl*GAUSS_ALIGN+x] );
114- }
115- if ( m < d_gauss.dd .span [lvl] )
116- printf (" ...\n " );
117- else
118- printf (" \n " );
109+ printf (" %d %d %2.6f: " , 0 , span, d_gauss.dd .sigma [0 ] );
110+ int m = min ( d_gauss.dd .span [0 ], columns );
111+ for ( int x=0 ; x<m; x++ ) {
112+ printf (" %0.8f " , d_gauss.dd .filter [x] );
119113 }
114+ if ( m < d_gauss.dd .span [0 ] )
115+ printf (" ...\n " );
116+ else
117+ printf (" \n " );
120118 printf (" \n " );
121119}
122120
@@ -215,26 +213,17 @@ void init_filter( const Config& conf,
215213 h_gauss.abs_oN .computeBlurTable ( &h_gauss );
216214
217215 /* dd :
218- * The direct-downscaling kernels make use of the assumption that downscaling
219- * from MAX_LEVEL-3 is identical to applying 2*sigma on the identical image
220- * before downscaling, which would be identical to applying 1*sigma after
221- * downscaling.
222- * In reality, this is not true because images are not continuous, but we
223- * support the options because it is interesting. Perhaps it works for the later
224- * octaves, where it is also good for performance.
216+ * A leftover from an attempt to create all top levels of all octaves from the
217+ * input image.
225218 * dd is only for creating level 0 of all octave directly from the input image.
226219 */
227- for ( int oct=0 ; oct<MAX_OCTAVES; oct++ ) {
228- // sigma * 2^i
229- float oct_sigma = scalbnf ( sigma0, oct );
230220
231- // subtract initial blur
232- float b = sqrt ( fabs ( oct_sigma * oct_sigma - initial_blur * initial_blur ) );
221+ // subtract initial blur
222+ const float sigma_o0_l0 = sqrt ( fabs ( sigma0 * sigma0 - initial_blur * initial_blur ) );
233223
234- // sigma / 2^i
235- h_gauss.dd .sigma [oct] = scalbnf ( b, -oct );
236- h_gauss.dd .computeBlurTable ( &h_gauss );
237- }
224+ // sigma / 2^i
225+ h_gauss.dd .sigma [0 ] = sigma_o0_l0;
226+ h_gauss.dd .computeBlurTable ( &h_gauss );
238227
239228 cudaError_t err;
240229 err = cudaMemcpyToSymbol ( d_gauss,
0 commit comments