Commit abde5123 authored by Bram Veenboer's avatar Bram Veenboer

Merge branch 'shifted-predict' into 'master'

Fix sign and swapping issues for shifted predict

See merge request astron-idg/idg!33
parents 0309c3e9 57ea9f3d
......@@ -409,11 +409,11 @@ namespace api {
for(int x = 0; x < m_size; x++) {
// Compute phase
const float w_offset = (w+0.5)*m_w_step;
const float l = (y-((int)m_size/2)) * m_cell_size;
const float m = (x-((int)m_size/2)) * m_cell_size;
const float l = (x-((int)m_size/2)) * m_cell_size;
const float m = (y-((int)m_size/2)) * m_cell_size;
// evaluate n = 1.0f - sqrt(1.0 - (l * l) - (m * m));
// accurately for small values of l and m
const float n = compute_n(l, m, m_shift);
const float n = compute_n(l, -m, m_shift);
//const float tmp = (l * l) + (m * m);
//const float n = tmp > 1.0 ? 1.0 : tmp / (1.0f + sqrtf(1.0f - tmp));
float phase = 2*M_PI*n*w_offset;
......@@ -490,9 +490,9 @@ namespace api {
for (int x = 0; x < m_size; x++) {
// Compute phase
const float w_offset = (w+0.5)*m_w_step;
const float l = (y-((int)m_size/2)) * m_cell_size;
const float m = (x-((int)m_size/2)) * m_cell_size;
const float n = compute_n(l, m, m_shift);
const float l = (x-((int)m_size/2)) * m_cell_size;
const float m = (y-((int)m_size/2)) * m_cell_size;
const float n = compute_n(l, -m, m_shift);
// evaluate n = 1.0f - sqrt(1.0 - (l * l) - (m * m));
// accurately for small values of l and m
//const float tmp = (l * l) + (m * m);
......
......@@ -47,7 +47,7 @@ void kernel_degridder(
l_[i] = compute_l(x, subgrid_size, image_size);
m_[i] = compute_m(y, subgrid_size, image_size);
n_[i] = compute_n(l_[i], m_[i], shift);
n_[i] = compute_n(-l_[i], m_[i], shift);
}
// Iterate all subgrids
......
......@@ -48,7 +48,7 @@ void kernel_gridder(
l_[i] = compute_l(x, subgrid_size, image_size);
m_[i] = compute_m(y, subgrid_size, image_size);
n_[i] = compute_n(l_[i], m_[i], shift);
n_[i] = compute_n(-l_[i], m_[i], shift);
}
// Iterate all subgrids
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment