12.06.2015 Views

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

86 FLASH STREAM DECODER ANNOYANCE-FILTER §107<br />

107. A transformation matrix is stored as separate scale, rotation/skew, and translation terms, each<br />

represented as a signed fixed-point value. <strong>The</strong> scale and rotation/skew terms are optional and are<br />

omitted if they are identity—an initial bit indicates whether they are present.<br />

〈 Class implementations 11 〉 +≡<br />

void flashStream ::getMatrix (matrix ∗ mat )<br />

{<br />

initBits ( ); /∗ Scale terms ∗/<br />

if (getBits (1)) {<br />

int nBits = static cast〈int〉(getBits (5));<br />

}<br />

mat ⃗ a = getSignedBits (nBits );<br />

mat ⃗ d = getSignedBits (nBits );<br />

}<br />

else {<br />

mat ⃗ a = mat ⃗ d = # 00010000 L ; /∗ Identity: omitted ∗/<br />

} /∗ Rotate/skew terms ∗/<br />

if (getBits (1)) {<br />

int nBits = static cast〈int〉(getBits (5));<br />

mat ⃗ b = getSignedBits (nBits );<br />

mat ⃗ c = getSignedBits (nBits );<br />

}<br />

else {<br />

mat ⃗ b = mat ⃗ c = 0; /∗ Identity: omitted ∗/<br />

} /∗ Translate terms ∗/<br />

int nBits = static cast〈int〉(getBits (5));<br />

mat ⃗ tx = getSignedBits (nBits );<br />

mat ⃗ ty = getSignedBits (nBits );

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!