|
@ -48,50 +48,39 @@ function x = iAACoder3(AACSeq3, fNameOut) |
|
|
currFrameStart = i * 1024 + 1; |
|
|
currFrameStart = i * 1024 + 1; |
|
|
currFrameStop = currFrameStart + 2047; |
|
|
currFrameStop = currFrameStart + 2047; |
|
|
|
|
|
|
|
|
if i < 2 |
|
|
SL = decodeHuff(AACSeq3(i + 1).chl.stream, ... |
|
|
continue; |
|
|
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); |
|
|
|
|
|
|
|
|
|
|
|
frameT = iFilterbank(frameF, AACSeq3(i+1).frameType, AACSeq3(i+1).winType); |
|
|
sfcL = decodeHuff(AACSeq3(i + 1).chl.sfc, 12, huffLUT)'; |
|
|
|
|
|
sfcR = decodeHuff(AACSeq3(i + 1).chr.sfc, 12, huffLUT)'; |
|
|
|
|
|
if strcmp(AACSeq3(i+1).frameType, 'ESH') |
|
|
|
|
|
sfcDeHuffL(42, 8) = 0; |
|
|
|
|
|
sfcDeHuffR(42, 8) = 0; |
|
|
|
|
|
sfcDeHuffL(2:end, :) = reshape(sfcL, [41 8]); |
|
|
|
|
|
sfcDeHuffR(2:end, :) = reshape(sfcR, [41 8]); |
|
|
|
|
|
sfcDeHuffL(1, :) = AACSeq3(i+1).chl.G; |
|
|
|
|
|
sfcDeHuffR(1, :) = AACSeq3(i+1).chr.G; |
|
|
else |
|
|
else |
|
|
SL = decodeHuff(AACSeq3(i + 1).chl.stream, ... |
|
|
sfcDeHuffL = [AACSeq3(i+1).chl.G; sfcL]; |
|
|
AACSeq3(i + 1).chl.codebook, huffLUT); |
|
|
sfcDeHuffR = [AACSeq3(i+1).chr.G; sfcR]; |
|
|
SR = decodeHuff(AACSeq3(i + 1).chr.stream, ... |
|
|
end |
|
|
AACSeq3(i + 1).chr.codebook, huffLUT); |
|
|
|
|
|
|
|
|
|
|
|
sfcL = decodeHuff(AACSeq3(i + 1).chl.sfc, 12, huffLUT)'; |
|
|
frameF(:, 1) = iAACquantizer(SL, sfcDeHuffL, ... |
|
|
sfcR = decodeHuff(AACSeq3(i + 1).chr.sfc, 12, huffLUT)'; |
|
|
AACSeq3(i + 1).chl.G, AACSeq3(i+1).frameType); |
|
|
if strcmp(AACSeq3(i+1).frameType, 'ESH') |
|
|
frameF(:, 2) = iAACquantizer(SR, sfcDeHuffR, ... |
|
|
sfcDeHuffL(42, 8) = 0; |
|
|
AACSeq3(i + 1).chr.G, AACSeq3(i+1).frameType); |
|
|
sfcDeHuffR(42, 8) = 0; |
|
|
|
|
|
sfcDeHuffL(2:end, :) = reshape(sfcL, [41 8]); |
|
|
|
|
|
sfcDeHuffR(2:end, :) = reshape(sfcR, [41 8]); |
|
|
|
|
|
sfcDeHuffL(1, :) = AACSeq3(i+1).chl.G; |
|
|
|
|
|
sfcDeHuffR(1, :) = AACSeq3(i+1).chr.G; |
|
|
|
|
|
else |
|
|
|
|
|
sfcDeHuffL = [AACSeq3(i+1).chl.G; sfcL]; |
|
|
|
|
|
sfcDeHuffR = [AACSeq3(i+1).chr.G; sfcR]; |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
frameF(:, 1) = iAACquantizer(SL, sfcDeHuffL, ... |
|
|
frameF(:, 1) = iTNS(frameF(:, 1), ... |
|
|
AACSeq3(i + 1).chl.G, AACSeq3(i+1).frameType); |
|
|
AACSeq3(i+1).frameType, ... |
|
|
frameF(:, 2) = iAACquantizer(SR, sfcDeHuffR, ... |
|
|
AACSeq3(i + 1).chl.TNScoeffs); |
|
|
AACSeq3(i + 1).chr.G, AACSeq3(i+1).frameType); |
|
|
frameF(:, 2) = iTNS(frameF(:, 2), ... |
|
|
|
|
|
AACSeq3(i+1).frameType, ... |
|
|
|
|
|
AACSeq3(i + 1).chr.TNScoeffs); |
|
|
|
|
|
|
|
|
frameF(:, 1) = iTNS(frameF(:, 1), ... |
|
|
frameT = iFilterbank(frameF, AACSeq3(i+1).frameType, AACSeq3(i+1).winType); |
|
|
AACSeq3(i+1).frameType, ... |
|
|
|
|
|
AACSeq3(i + 1).chl.TNScoeffs); |
|
|
|
|
|
frameF(:, 2) = iTNS(frameF(:, 2), ... |
|
|
|
|
|
AACSeq3(i+1).frameType, ... |
|
|
|
|
|
AACSeq3(i + 1).chr.TNScoeffs); |
|
|
|
|
|
|
|
|
|
|
|
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; |
|
|
|
|
|
|
|
|