3. A generic block diagram of a perceptual audio encoder
Masking
Thresholds
Time-
Frequency
Analysis
Psychoacoustic
Analysis
Quantization
and
Encoding
Bit-allocation
Entropy
(Lossless)
coding
Parameters MUX
Side
information
Input Audio
4. • The absolute threshold of hearing in a noiseless environment.
13. Implementation of the analysis subband Filter Bank
Input 32 audio
samples
Build Input
Sample Vector
x
Window Vector x by
coefficient vector c
(prototype filter)
Calculate Yi ,
i=0 to 63
Compute coefficients
of M
Calculate the 32 subband
samples by matrixing
PCM Audio In
Subband
Samples
Framing
24. Analysis SPL
computation
Spreading function and
excitation pattern
Tonality Index
estimation
Input Signal
Calculation of
masking threshold
for each partition
Estimation of JND
and SMR
Pre-echo detection
and window
switching
SMR
58. Implementation of the Outer Loop (Distortion Control)
Calculation of number of bits needed to encode
the scalefactors.
Binary search for quantizer step-size.Binary search for quantizer step-size.
Inner Loop
Calculation of distortion in each scalefactor band.
Save scaling factors of scalefactor bands.
Preemphasis
Amplification of the scalefactor bands that violate
the masking threshold.
All scalefactor bands amplified?
Amplification of all bands within upper limit?
N
At least one band exceeding allowed distortion?
Y
Y
Restore scaling factors
Y
N
N
59.
60. The effect of the variables status and over in the outer loop execution
1 2
Iterations
3
0
5
10
15
20
25
status
over
61. The effect of the variables status and over in the outer loop execution
1 2 3 4 5 6
0
2
4
6
8
over
status
2
Iterations
62. Unquantized MDCT coefficients for a short block
0 100 200 300
Sample Index
400 500
0.2
0.15
0.1
0.05
0
-0.05
-0.1
-0.15
-0.2
-0.25
-0.3
Amplitude
63. MDCT coefficients (magnitude) quantized to meet target bit rate 128 kbps.
14
12
10
BIG
tude
8 VALUES
Ampli
6 QUADRUPLES
4 RUN-LENGTH ZEROS
2
0
0 100 200 300 400 500
Sample Index
0 100 200 300
Sample Index
400 500
0
2
4
6
8
14
12
10
Amplitude
BIG
VALUES
QUADRUPLES
RUN-LENGTH ZEROS
64. Illustration of main data organization and encoding scheme
part2_length
region0 region1 region2
bigvalues region count1 rzero
part3_length
part2_3_length
Scalefactor Huffman Code
part2_length
region0
xxxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxx
region0 region1 region2
bigvalues region
region2
count1
0000000000000000
rzero
part3_length
part2_3_length
Scalefactor Huffman Code
65. Illustration of bit usage in the inner loop.
Iteration 1 Iteration 2
Big Values
Count1
rzeros
Bits used to code subregions
Total available bits
1659
1588
1474
66. Illustration of relationship between global_gain and the number of bits required
to encode a granule.
129 130
Global Gain
131
1400
1700
1650
1600
1550
1500
1450
#Bitsused
67. Header
Frame 1
Header
Frame 2
Header
Frame 3
Header
Frame 4
sync
sideinfo1
sync
sideinfo2
sync
sideinfo3
sync
sideinfo4
main data 1
main data 2
main data 3
main data 4
main data 4main data 3main data 2main data 1
68. Illustration of total available bits to encode data frames.
Available Bits
Reservoir Size
Mean Bits
Granule0
Granule0
Granule0
Granule0
Granule0
Granule0
Granule1
Granule1
Granule1
Granule1
Granule1
Granule1
Frame 0 Frame 1 Frame 2 Frame 3 Frame 4 Frame 5
71. Organization of scalefactors and Huffman coded data.
GRANULE 0 GRANULE 1
LEFT CHANNEL RIGHT CHANNEL
SCALEFACTORS HUFFMAN CODE
BITS
RIGHT CHANNEL LEFT CHANNEL
. . . . SCALEFACTORS HUFFMAN CODE
BITS
HEADER
(32)
CRC
(0,16)
SIDE INFORMATION
(136,256)
MAIN DATA ANCILLARY
BITS
75. Polyphase implementation of the synthesis filter bank
31
63
V FIFO
16 V vector FIFO
(1024 samples)
0
IMDCT
0
V vector
U vector
511
D window
511
511
31
0
+ + + +
31
0
=
Reconstructed
samples
Subband
samples
W vector