|
|
@ -48,22 +48,42 @@ function x = iAACoder3(AACSeq3, fNameOut) |
|
|
|
currFrameStart = i * 1024 + 1; |
|
|
|
currFrameStop = currFrameStart + 2047; |
|
|
|
|
|
|
|
SL = decodeHuff(AACSeq3(i + 1).chl.stream, ... |
|
|
|
AACSeq3(i + 1).chl.codebook, huffLUT); |
|
|
|
SR = decodeHuff(AACSeq3(i + 1).chr.stream, ... |
|
|
|
AACSeq3(i + 1).chr.codebook, huffLUT); |
|
|
|
if i < 2 |
|
|
|
frameF(:, 1) = iTNS(AACSeq3(i + 1).chl.stream, ... |
|
|
|
AACSeq3(i+1).frameType, ... |
|
|
|
AACSeq3(i + 1).chl.TNScoeffs); |
|
|
|
frameF(:, 2) = iTNS(AACSeq3(i + 1).chr.stream, ... |
|
|
|
AACSeq3(i+1).frameType, ... |
|
|
|
AACSeq3(i + 1).chr.TNScoeffs); |
|
|
|
|
|
|
|
sfcL = decodeHuff(AACSeq3(i + 1).chl.sfc, 12, huffLUT); % TODO: maybe LUT(12); |
|
|
|
sfcR = decodeHuff(AACSeq3(i + 1).chr.sfc, 12, huffLUT); |
|
|
|
frameT = iFilterbank(frameF, AACSeq3(i+1).frameType, AACSeq3(i+1).winType); |
|
|
|
else |
|
|
|
% SL = decodeHuff(AACSeq3(i + 1).chl.stream, ... |
|
|
|
% AACSeq3(i + 1).chl.codebook, huffLUT); |
|
|
|
% SR = decodeHuff(AACSeq3(i + 1).chr.stream, ... |
|
|
|
% AACSeq3(i + 1).chr.codebook, huffLUT); |
|
|
|
% |
|
|
|
% sfcL = decodeHuff(AACSeq3(i + 1).chl.sfc, 12, huffLUT); |
|
|
|
% sfcR = decodeHuff(AACSeq3(i + 1).chr.sfc, 12, huffLUT); |
|
|
|
|
|
|
|
frameF(:, 1) = iAACquantizer(AACSeq3(i + 1).chl.stream, ... |
|
|
|
AACSeq3(i + 1).chl.sfc, ... |
|
|
|
AACSeq3(i + 1).chl.G, ... |
|
|
|
AACSeq3(i+1).frameType); |
|
|
|
frameF(:, 2) = iAACquantizer(AACSeq3(i + 1).chr.stream, ... |
|
|
|
AACSeq3(i + 1).chr.sfc, ... |
|
|
|
AACSeq3(i + 1).chr.G, ... |
|
|
|
AACSeq3(i+1).frameType); |
|
|
|
|
|
|
|
frameF(:, 1) = iAACquantizer(SL, sfcL, AACSeq3(i + 1).chl.G, AACSeq3(i+1).frameType); |
|
|
|
frameF(:, 2) = iAACquantizer(SR, sfcR, AACSeq3(i + 1).chr.G, AACSeq3(i+1).frameType); |
|
|
|
frameF(:, 1) = iTNS(frameF(:, 1), ... |
|
|
|
AACSeq3(i+1).frameType, ... |
|
|
|
AACSeq3(i + 1).chl.TNScoeffs); |
|
|
|
frameF(:, 2) = iTNS(frameF(:, 2), ... |
|
|
|
AACSeq3(i+1).frameType, ... |
|
|
|
AACSeq3(i + 1).chr.TNScoeffs); |
|
|
|
|
|
|
|
TNScoeffsL = AACSeq3(i + 1).chl.TNScoeffs; |
|
|
|
TNScoeffsR = AACSeq3(i + 1).chr.TNScoeffs; |
|
|
|
frameF(:, 1) = iTNS(frameF(:, 1), AACSeq3(i+1).frameType, TNScoeffsL); |
|
|
|
frameF(:, 2) = iTNS(frameF(:, 2), AACSeq3(i+1).frameType, TNScoeffsR); |
|
|
|
frameT = iFilterbank(frameF, AACSeq3(i+1).frameType, AACSeq3(i+1).winType); |
|
|
|
end |
|
|
|
|
|
|
|
decodedAudio(currFrameStart:currFrameStop, :) = decodedAudio(currFrameStart:currFrameStop, :) + frameT; |
|
|
|
end |
|
|
|