@@ -107,11 +107,13 @@ void gradient_core ( PelStorage *buff1,
107107 for (int j = 0 ; j < height; j++)
108108 {
109109 int acc = 0 ;
110+ int xOffset = i - convWidthS / 2 ;
111+ int yOffset = j - convHeightS / 2 ;
110112 for (int x = 0 ; x < convWidthS; x++)
111113 {
112114 for (int y = 0 ; y < convHeightS; y++)
113115 {
114- acc += (buff1->get (compID).at (x - convWidthS / 2 + i , y - convHeightS / 2 + j ) * m_gx[x][y]);
116+ acc += ( buff1->get (compID).at ( x + xOffset , y + yOffset ) * m_gx[x][y] );
115117 }
116118 }
117119 tmpBuf1->Y ().at (i, j) = acc;
@@ -526,7 +528,6 @@ int dilation_core ( PelStorage *buff,
526528 ++iter,
527529 Value );
528530
529- return iter;
530531}
531532
532533Morph::Morph ()
@@ -1258,8 +1259,8 @@ void FGAnalyzer::estimateScalingFactors ( uint32_t bitDepth,
12581259void FGAnalyzer::adaptiveSampling ( int bins,
12591260 double threshold,
12601261 std::vector<int >& significantIndices,
1261- int startIdx ,
1262- bool isRow )
1262+ bool isRow ,
1263+ int startIdx )
12631264{
12641265 int binSize = DATA_BASE_SIZE / bins;
12651266 for ( int i = 0 ; i < bins; i++ )
@@ -1318,11 +1319,13 @@ void FGAnalyzer::estimateCutoffFreqAdaptive( ComponentID compId )
13181319 adaptiveSampling ( coarseBins,
13191320 threshold,
13201321 significantRows,
1321- true ); // Rows
1322+ true ,
1323+ 0 ); // Rows
13221324 adaptiveSampling ( coarseBins,
13231325 threshold,
13241326 significantCols,
1325- false ); // Columns
1327+ false ,
1328+ 0 ); // Columns
13261329
13271330 // Iterative Refinement
13281331 for ( int iter = 0 ; iter < maxIterations; iter++ )
@@ -1333,16 +1336,16 @@ void FGAnalyzer::estimateCutoffFreqAdaptive( ComponentID compId )
13331336 adaptiveSampling ( refineBins,
13341337 threshold,
13351338 refinedRows,
1336- row ,
1337- true );
1339+ true ,
1340+ row );
13381341 }
13391342 for ( int col : significantCols )
13401343 {
13411344 adaptiveSampling ( refineBins,
13421345 threshold,
13431346 refinedCols,
1344- col ,
1345- false );
1347+ false ,
1348+ col );
13461349 }
13471350 significantRows = refinedRows;
13481351 significantCols = refinedCols;
0 commit comments