R ESULTADOS
7.1. Resultados del síndrome de Down
7.1.1. Datos obtenidos
The JFIF data reader monitors the input stream for markers. It is able to detect and retrieve the header information according to 3.2.1.
The decoder JFIF data reader uses several state machines for the header information reading (see Figure 32):
state – main Finite State Machine (FSM) for the decoder but also used for the header reading process. Updated on state_machine_comb process;
SOF0_header_state – Finite State Machine for Frame information reading. Updated on frame_data_p process.
SOS_Header_state – Finite State Machine for Scan information reading and decode. Updated on SOS_information_state_p process.
An input_reg retains the last 3 bytes of data, the state_machine_comb process is used to monitor for a marker. If a marker is found the state is changed to process the incoming data. For Frame and Scan data reading dedicated state machines are used to control the decoder.
When an SOI marker is found on the input stream the decoder resets some of the internal states. It will remain on that state until other marker is found.
DQT marker detection
The DQT marker defines that a quantification table is going to be defined. The decoder sets the DQT state and the process for reading the quantification table is started (see Figure 33).
DQT_lenght
As presented in 3.2.1, the quantification table is defined by an identifier and the 64 elements of the table. The decoder reads the 64 elements and retains the values on the memory qtable. The decoder qtable memory is 2 dimension distributed memory with a capacity of 4 x 64 bytes.
DHT marker detection
The DHT marker indicates that a Huffman table is going to be defined. The decoder sets the DHT state and the process for reading the Huffman table is started (see Figure 34).
DHT_length
The Huffman table reading process is complex because is in this phase that the necessary decoding information is retrieved and generated.
The Huffman code tree like the one on Appendix A is not defined on the header but from the information on the header the decoder is able to generate a Huffman code table.
The Huffman decoder retrieves from the header the information on the number of symbols for each code length and with that information three tables are generated:
huff_code_number - This table indicates the number of existing symbols for each code length.
This information is retrieved directly from the header.
The memory is a distributed memory with a capacity of 4x16 x 1 bytes;
huff_code_offset - This table is generated to indicate the starting Huffman code for each code length. The code is calculated by applying the following rule:
(3.6)
The memory is a two dimension distributed memory with a capacity of 128 x 2 bytes, capable of registering the information about 8 Huffman code tables in total;
ram_pointer - This table is generated to indicate the RAM pointer for the symbols of each code length. The code is calculated by applying the following rule:
(3.7)
The memory is 2 dimension distributed memory with a capacity of 512 x 1 bytes. A total of 512 symbols can be registered but in theory a total of
symbols can be declared using a 16 length huffman code table. In practice the 512 symbols memory is enough to cover the needs for real application.
(3.8)
These tables are used later on for the Entropy decoding process.
On Appendix B there is an example of the generated internal tables from a defined Header data. The memory address will depend on the number of Huffman tables that are defined. The example is for the first table being defined.
On JPEG the Huffman table will be associated to a component (Luminance or Chrominance) and to the DC or AC value. On a colour image there will be a total of four Huffman code tables.
SOF0 marker detection
The SOF0 marker indicates the Frame parameters. The decoder sets the SOF0 state and the process for reading the quantification table is started (see Figure 35).
SOF0_lenght sampling factor and quantification tables used is declared. The information retrieve process is defined by the state machine states but for the component information retrieve the SOF0_header_state state machine is used, and the number of components defined will determinate the interactions as exemplified in Figure 36.
The decoder reads the information about the components and retains the values on the memory SOF0_comp_table. The memory is 2 dimension distributed memory with a capacity of 16 x 2 bytes, capable of registering the information about 16 components in total.
SOS marker detection
The SOS marker indicates the start of the scan process. It is during the scan that the image information is decoded, defined as the SOS_scan process. Before the scan is initiated some information about the scan is retrieved from the header. The retrieve process is controlled by the state machine
Before the decoding process of the Scan is initiated the scan components information is retrieved and registered on the SOS_comp_table memory. The memory is 2 dimension distributed memory with a capacity of 16 x 1 bytes, capable of registering the scan information about 16 components in total.
After the scan components information is retrieved the scan decoding is initiated, this is where the file header stream terminates and the entropy decoder is initiated.