14.01.2013 Views

A.R.Drone Developer Guide - Abstract

A.R.Drone Developer Guide - Abstract

A.R.Drone Developer Guide - Abstract

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

* Else: ⇒ Resulting value (zero-counter) is equal to the direct decimal conversion<br />

of the merged read binary values. Ex: if xxxx = 1101(2) → 000001(2) + 1101(2) =<br />

0000011101(2) = 29(10)<br />

– Add "0" to the output list, as many times indicated by the zero-counter.<br />

– Reading of the non-zero value as explain below:<br />

* Read the coarse pattern part (bit-per-bit, till there is 1 value).<br />

* On the corresponding line (cf.Figure 15), get the number of complementary bits<br />

to read. Ex: 0001(2) → xxs → 2 more bits to read (then the sign bit.)<br />

* If there is no 0 before the 1 (coarse pattern part = 1, in the first case of the Huffman<br />

table): ⇒ Temporary value is equal to 1.<br />

* Else if the coarse pattern part = 01(2) (second case of the Huffman table) : ⇒<br />

Temporary value is equal to End Of Bloc code (EOB).<br />

* Else ⇒ Temporary value is equal to the direct decimal conversion of the merged<br />

read binary values. Ex: if xx = 11 → 00001(2) + 11(2) = 0000111(2) = 7(10) Read<br />

the next bit, to get the sign (s).<br />

* If s = 0: ⇒ Resulting non-zero value = temporary value<br />

* Else (s = 1): ⇒<br />

* Resulting non-zero value = temporary value x (-1)<br />

– Add the resulting non-zero value to the output list.<br />

• (End of "while")<br />

7.2.4 Example<br />

Encoding :<br />

• Initial data list :<br />

-26; -3; 0; 0; 0; 0; 7; -5; EOB<br />

• Step 1 :<br />

-26; 0x"0"; -3; 4x"0"; 7; 0x"0"; -5; 0x"0"; EOB<br />

• Step 2 (binary form):<br />

1111111111100110; 1; 001 11; 0001 00; 0001 110; 1; 0001 011; 1; 01<br />

• Final stream :<br />

1111100110100111000100000111010001011101<br />

Decoding :<br />

• Initial bit-data stream :<br />

{11110001110111000110001010010100001010001101}<br />

• Step 1 (first 10 bits split) :<br />

{1111000111}; {0111000110001010010100001010001101}<br />

• Step 2 (16-bits conversion of DC value) :<br />

{1111111111000111}; {0111000110001010010100001010001101}<br />

51

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

Saved successfully!

Ooh no, something went wrong!