Cypress DCT-1D Guide de l'utilisateur Page 61

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 82
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 60
Chapter 6
Lab task 4 - Custom Instructions
6.1 Introduction
In this lab task you will learn how to design and integrate a new instruction into the
processor. This part will target the bit alignment problem arising when trying to write
bit streams to the memory. A bit stream is here defined as a stream of bits with no
particular memory alignment. In accordance with jpegfiles the bit pattern to write
to the stream will be called the code and the number of bits to write the size of the
code. The extension you will make to the instruction set is called a Variable Length
eXtension, or VLX for short.
6.1.1 Huffman Coding
First a short review of the principles of Huffman encoding. Huffman encoding works
by encoding the most frequently occurring item with the fewest number of bits and
then using more bits for items occurring less frequently. For instance take the sequence
ABAACDAAAB, the letter’s frequencies are calculated and listed in 6.1
Four different values imply that we at least need two bits per value thus we would
need 10 · 2 = 20 bits to encode the string. If we were to use the Huffman codes in 6.1
we would need only 6 · 1 + 2 · 2 + 3 + 3 = 16 bits, thus saving four bits. How the
Huffman codes are calculated is not in the scope of this course, for further information
about Huffman coding see for example [14].
When the Huffman tables are calculated the encoding process is simple, just do a
lookup and replace, e.g. simply replace the data with its corresponding code.
In our case jpegfiles uses already pre calculated Huffman tables, the JPEG standard
Letter Frequency Huffman code
A 6 0
B 2 10
C 1 110
D 1 111
Table 6.1: Letter frequencies and Huffman codes
61
Vue de la page 60
1 2 ... 56 57 58 59 60 61 62 63 64 65 66 ... 81 82

Commentaires sur ces manuels

Pas de commentaire