Presentation is loading. Please wait.

Presentation is loading. Please wait.

Developement and Implementation of an MPEG1 Layer III Decoder on x86 and TMS320C6711 platforms Braidotti Enrico (Farina Simone)

Similar presentations

Presentation on theme: "Developement and Implementation of an MPEG1 Layer III Decoder on x86 and TMS320C6711 platforms Braidotti Enrico (Farina Simone)"— Presentation transcript:

1 Developement and Implementation of an MPEG1 Layer III Decoder on x86 and TMS320C6711 platforms Braidotti Enrico (Farina Simone)

2 What is MPEG1 Layer III ? Frequently referred to as “MP3” Method to store compressed audio (LOSSY ) Developed by Moving Pictures Expert Group (MPEG) Standard ISO/IEC (Audio Part 3), 1991 Compression rate w/out recognizeable quality loss up to 12x Last release of MPEG1 family: –Highest complexity –Provides best quality

3 Standard MPEG1 3 possible compression types (increasing complexity): –Layer I –Layer II –Layer III Sampling frequencies for Layer III: –32 kHz –44.1 kHz –48 kHz Bitrates: –Min 32 kbit/s –Max 320 kbit/s Compact Disc: 1.41 Mbit/s

4 BITSTREAM FORMAT Whole bitstream is divided into frames of defined length: framesize = 144· bitrate / sampling frequency + padding (bytes) Frames are divided in 2 granules and are composed by different parts: Header CRC (optional) Side Information Main data Ancillary data (optional)

5 FRAME HEADER Syncword = 12 bits put to ‘1’ ID = 1 for MPEG1 Audio (2 bits used for MPEG2 and 2.5) Padding = to adjust framesize (and effective bitrate of CBR files)

6 SIDE INFORMATION Length depends on number of channels 17 bytes for single channel 32 bytes for others Contains all necessary informations for decoding the Main data section Main structure is:

7 BIT RESERVOIR It is one of the most important features of Layer III format and it works as follows (use of main_data_end ):

8 MAIN DATA SCALEFACTORS informations in the Side Information section HUFFMAN CODED DATA extraction of scaled frequency lines (not ordered in some cases)



11 HUFFMAN DECODING Lossless - type coding / decoding Fixed – variable Based on 18 Huffman Tables (specific for MPEG1) Codewords up to 19-bit long Tables up to 256 values

12 HUFFMAN DECODING Big Values Region 0 Region 1 Region 2 Count 1 RZero

13 HUFFMAN DECODING Couple of f. lines ( big-values ) Quadruple of f. lines ( count1 )

14 HUFFMAN DECODING CLUSTERED HUFFMAN DECODING (R. Hashemian ) Compromise between binary-tree and direct look-up decoding Custom made Huffman tables containing 16-bit words Structure of words depend on HIT / MISS:

15 HUFFMAN DECODING Example Huffman Table 1 x y len codeword Address HIT / MISS New Address Bits xy 0MISS101 1HIT00 10MISS HIT10 100HIT11 101HIT01 Clustered Table 1

16 REQUANTIZATION (DESCALING) The Huffman decoded frequency lines are restored to their original values according to the following formulas:

17 REQUANTIZATION (DESCALING) Use of large look-up table with all possible values of modulus of Huffman decoded data (0 → = 8206) pros: speed, accuracy cons: memory requirements (32 KByte with float precision) Reduced Look-up table pros: table is 87.5 % smaller (4 KByte with float precision) cons: speed (need to calculate is· 0.125), accuracy

18 REQUANTIZATION (DESCALING) Shift – based power computing (T. Uželac ) Requantization has to be done up to 2304 times each frame, direct computation of: would require too many clock cycles

19 REQUANTIZATION (DESCALING) shift operations 2 small look-up tables (total of 32 Bytes) scale = scalefac_scale + 1; a = global_gain (scalefac_long << scale); if (preflag) a -= (pretab << scale); if (a < -127) y = 0; if (a >= 0) y = tab[a&3]*(1 > 2)); else y = tabi[(-a)&3]/(1 > 2)); tab contains values: [2 0, 2 1/4, 2 1/2, 2 3/4 ] tabi contains values: [2 0, 2 -1/4, 2 -1/2, 2 -3/4 ]

20 STEREO PROCESSING INTENSITY STEREO In the critical bands higher than 2 kHz, the sensation of stereo is given mainly by the envelope of the signal. The encoder codes only one sum - like signal and the decoder extracts separate L and R with different scalefactors MIDDLE/SIDE STEREO Encoding of the Middle (L+R) and Side (L-R) signals for reducing redundant elements

21 STEREO PROCESSING There are 4 different typologies of transmission for stereophonic signals (according to mode_extension, found in the header ):

22 STEREO PROCESSING MIDDLE/SIDE STEREO Left and Right channels are simply reconstructed according to: INTENSITY STEREO Values are read from the Rzero part of Left channel and IS positions is_pos (sfb ) are read from scalefactors of right channel:

23 REORDERING It is performed only when using short blocks: this is due to the way the MDCT in the encoder arranges the output lines.

Download ppt "Developement and Implementation of an MPEG1 Layer III Decoder on x86 and TMS320C6711 platforms Braidotti Enrico (Farina Simone)"

Similar presentations

Ads by Google