|
@ -48,22 +48,42 @@ function x = iAACoder3(AACSeq3, fNameOut) |
|
|
currFrameStart = i * 1024 + 1; |
|
|
currFrameStart = i * 1024 + 1; |
|
|
currFrameStop = currFrameStart + 2047; |
|
|
currFrameStop = currFrameStart + 2047; |
|
|
|
|
|
|
|
|
SL = decodeHuff(AACSeq3(i + 1).chl.stream, ... |
|
|
if i < 2 |
|
|
AACSeq3(i + 1).chl.codebook, huffLUT); |
|
|
frameF(:, 1) = iTNS(AACSeq3(i + 1).chl.stream, ... |
|
|
SR = decodeHuff(AACSeq3(i + 1).chr.stream, ... |
|
|
AACSeq3(i+1).frameType, ... |
|
|
AACSeq3(i + 1).chr.codebook, huffLUT); |
|
|
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); |
|
|
frameT = iFilterbank(frameF, AACSeq3(i+1).frameType, AACSeq3(i+1).winType); |
|
|
sfcR = decodeHuff(AACSeq3(i + 1).chr.sfc, 12, huffLUT); |
|
|
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(SL, sfcL, AACSeq3(i + 1).chl.G, AACSeq3(i+1).frameType); |
|
|
frameF(:, 1) = iAACquantizer(AACSeq3(i + 1).chl.stream, ... |
|
|
frameF(:, 2) = iAACquantizer(SR, sfcR, AACSeq3(i + 1).chr.G, AACSeq3(i+1).frameType); |
|
|
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) = 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); |
|
|
frameT = iFilterbank(frameF, AACSeq3(i+1).frameType, AACSeq3(i+1).winType); |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
decodedAudio(currFrameStart:currFrameStop, :) = decodedAudio(currFrameStart:currFrameStop, :) + frameT; |
|
|
decodedAudio(currFrameStart:currFrameStop, :) = decodedAudio(currFrameStart:currFrameStop, :) + frameT; |
|
|
end |
|
|
end |
|
|