private void quantize3(byte[][] input_buf, int in_row, byte[][] output_buf, int out_row, int num_rows)
{
int width = m_cinfo.m_output_width;
for (int row = 0; row < num_rows; row++)
{
int inIndex = 0;
int inRow = in_row + row;
int outIndex = 0;
int outRow = out_row + row;
for (int col = width; col > 0; col--)
{
int pixcode = m_colorindex[0][m_colorindexOffset[0] + input_buf[inRow][inIndex]];
inIndex++;
pixcode += m_colorindex[1][m_colorindexOffset[1] + input_buf[inRow][inIndex]];
inIndex++;
pixcode += m_colorindex[2][m_colorindexOffset[2] + input_buf[inRow][inIndex]];
inIndex++;
output_buf[outRow][outIndex] = (byte)pixcode;
outIndex++;
}
}
}