next up previous
Next: Other Applications of LPS Up: Linear Pixel Shuffling Previous: Linear Pixel Shuffling

Mathematical Justification of the LPS Algorithm

The above algorithm processes all $G_n\times G_n$ image pixels for the following reason. Let

 \begin{displaymath}
\left[
\!\!
\begin{array}{c}
i \\ j
\end{array}\!\!
\right]...
...
\left[
\!\!
\begin{array}{c}
x \\ y
\end{array}\!\!
\right]\end{displaymath} (8)

We will show that

Tij = x (9)

Multiplying out the above matrix formula, we have
  
Tij = iGn-2 + jGn-1 (10)
  = (G-n+1x + Gn-3y)Gn-2  
    + (G-n x+ Gn-2y)Gn-1 (11)
  = (G-n+1Gn-2 + G-nGn-1 )x  
    + (Gn-3Gn-2 + Gn-2Gn-1)y (12)
  = (G-n+1Gn-2 + G-nGn-1 )x (13)
    + (Gn-3 + Gn-1)Gn-2y (14)

The values in Eq. (8-14) are all modulo Gn. One of the factors in (14) satisfies

\begin{displaymath}G_{n-3} + G_{n-1} = G_n \equiv 0 \pmod {G_n}
\end{displaymath} (15)

by (3); so Tij is independent of y. The coefficient of x in (13) satisfies

\begin{displaymath}G_{n-2} G_{-n+1}
+
G_{n-1} G_{-n}
\equiv 1 \pmod{G_n}
\end{displaymath} (16)

for all n, because

Gn-2 G-n+1 + Gn-1 G-n + Gn G-n+2 = 1 (17)

for all n; this is easily established by mathematical induction. Finally, because three consecutive terms of the G sequence are relatively prime (5), $M \left[
\!\!
\begin{array}{c}
0 \\ y
\end{array}\!\!
\right]
$ takes Gn distinct values for $0 \leq y<G_n$. Linearity allows us to conclude that $ \left[
\!\!
\begin{array}{c}
i \\ j
\end{array}\!\!
\right]
$ ranges over all $G_n\times G_n$ pixel positions.


next up previous
Next: Other Applications of LPS Up: Linear Pixel Shuffling Previous: Linear Pixel Shuffling

2000-04-14