diff --git a/CHANGES.md b/CHANGES.md index 6c8bd109..d449fa5a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed option to create top level of every octave from input image [PR](https://github.com/alicevision/popsift/pull/178) - Removed option to compute very narrow Gaussian filters called opencv [PR](https://github.com/alicevision/popsift/pull/179) +- Removed unreachable code for alternative downscaling between octaves [PR](https://github.com/alicevision/popsift/pull/180) ## [0.10.0] - 2025-10-14 diff --git a/src/popsift/s_pyramid_build.cu b/src/popsift/s_pyramid_build.cu index f0270f06..7ecf6ab5 100755 --- a/src/popsift/s_pyramid_build.cu +++ b/src/popsift/s_pyramid_build.cu @@ -29,24 +29,6 @@ namespace popsift { namespace gauss { -__global__ -void get_by_2_interpolate( cudaTextureObject_t src_data, - const int src_level, - cudaSurfaceObject_t dst_data, - const int dst_w, - const int dst_h ) -{ - const int idx = blockIdx.x * blockDim.x + threadIdx.x; - const int idy = blockIdx.y * blockDim.y + threadIdx.y; - - if( idx >= dst_w ) return; - if( idy >= dst_h ) return; - - const float val = readTex( src_data, 2.0f * idx + 1.0f, 2.0f * idy + 1.0f, src_level ); - - surf2DLayeredwrite( val, dst_data, idx*4, idy, 0, cudaBoundaryModeZero ); // dst_data.ptr(idy)[idx] = val; -} - __global__ void get_by_2_pick_every_second( cudaTextureObject_t src_data, const int src_w, @@ -214,35 +196,17 @@ inline void Pyramid::downscale_from_prev_octave( int octave, cudaStream_t stream h_grid.x = (unsigned int)grid_divide( width, h_block.x ); h_grid.y = (unsigned int)grid_divide( height, h_block.y ); - switch( mode ) - { - case Config::PopSift : - case Config::VLFeat : - case Config::OpenCV : - gauss::get_by_2_pick_every_second - <<>> - ( prev_oct_obj.getDataTexPoint( ), - prev_oct_obj.getWidth(), - prev_oct_obj.getHeight(), - _levels-PREV_LEVEL, - oct_obj.getDataSurface( ), - oct_obj.getWidth(), - oct_obj.getHeight() ); - - POP_SYNC_CHK; - break; - default : - gauss::get_by_2_interpolate - <<>> - ( prev_oct_obj.getDataTexLinear( ).tex, - _levels-PREV_LEVEL, - oct_obj.getDataSurface( ), - oct_obj.getWidth(), - oct_obj.getHeight() ); - - POP_SYNC_CHK; - break; - } + gauss::get_by_2_pick_every_second + <<>> + ( prev_oct_obj.getDataTexPoint( ), + prev_oct_obj.getWidth(), + prev_oct_obj.getHeight(), + _levels-PREV_LEVEL, + oct_obj.getDataSurface( ), + oct_obj.getWidth(), + oct_obj.getHeight() ); + + POP_SYNC_CHK; } __host__ diff --git a/src/popsift/sift_conf.h b/src/popsift/sift_conf.h index 5decebc9..20397cb1 100644 --- a/src/popsift/sift_conf.h +++ b/src/popsift/sift_conf.h @@ -366,7 +366,7 @@ struct Config /// default: 1 int _filter_grid_size; - /// Modes are computation according to VLFeat or OpenCV, + /// Modes are computation according to VLFeat /// or fixed size. Default is VLFeat mode. GaussMode _gauss_mode;