private void make_funny_pointers()
{
int M = m_cinfo.min_DCT_v_scaled_size;
for (int ci = 0; ci < m_cinfo.m_num_components; ci++)
{
/* height of a row group of component */
int rgroup = (m_cinfo.Comp_info[ci].V_samp_factor * m_cinfo.Comp_info[ci].DCT_v_scaled_size) / m_cinfo.min_DCT_v_scaled_size;
int[] ind0 = m_funnyIndices[0][ci];
int[] ind1 = m_funnyIndices[1][ci];
/* First copy the workspace pointers as-is */
for (int i = 0; i < rgroup * (M + 2); i++)
{
ind0[i + rgroup] = i;
ind1[i + rgroup] = i;
}
/* In the second list, put the last four row groups in swapped order */
for (int i = 0; i < rgroup * 2; i++)
{
ind1[rgroup * (M - 1) + i] = rgroup * M + i;
ind1[rgroup * (M + 1) + i] = rgroup * (M - 2) + i;
}
/* The wraparound pointers at top and bottom will be filled later
* (see set_wraparound_pointers, below). Initially we want the "above"
* pointers to duplicate the first actual data line. This only needs
* to happen in xbuffer[0].
*/
for (int i = 0; i < rgroup; i++)
ind0[i] = ind0[rgroup];
}
}