|
@ -49,6 +49,7 @@ function x = iAACoder3(AACSeq3, fNameOut) |
|
|
currFrameStop = currFrameStart + 2047; |
|
|
currFrameStop = currFrameStart + 2047; |
|
|
|
|
|
|
|
|
if i < 2 |
|
|
if i < 2 |
|
|
|
|
|
continue; |
|
|
frameF(:, 1) = iTNS(AACSeq3(i + 1).chl.stream, ... |
|
|
frameF(:, 1) = iTNS(AACSeq3(i + 1).chl.stream, ... |
|
|
AACSeq3(i+1).frameType, ... |
|
|
AACSeq3(i+1).frameType, ... |
|
|
AACSeq3(i + 1).chl.TNScoeffs); |
|
|
AACSeq3(i + 1).chl.TNScoeffs); |
|
@ -58,22 +59,29 @@ function x = iAACoder3(AACSeq3, fNameOut) |
|
|
|
|
|
|
|
|
frameT = iFilterbank(frameF, AACSeq3(i+1).frameType, AACSeq3(i+1).winType); |
|
|
frameT = iFilterbank(frameF, AACSeq3(i+1).frameType, AACSeq3(i+1).winType); |
|
|
else |
|
|
else |
|
|
% SL = decodeHuff(AACSeq3(i + 1).chl.stream, ... |
|
|
SL = decodeHuff(AACSeq3(i + 1).chl.stream, ... |
|
|
% AACSeq3(i + 1).chl.codebook, huffLUT); |
|
|
AACSeq3(i + 1).chl.codebook, huffLUT); |
|
|
% SR = decodeHuff(AACSeq3(i + 1).chr.stream, ... |
|
|
SR = decodeHuff(AACSeq3(i + 1).chr.stream, ... |
|
|
% AACSeq3(i + 1).chr.codebook, huffLUT); |
|
|
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, ... |
|
|
sfcL = decodeHuff(AACSeq3(i + 1).chl.sfc, 12, huffLUT)'; |
|
|
AACSeq3(i + 1).chl.sfc, ... |
|
|
sfcR = decodeHuff(AACSeq3(i + 1).chr.sfc, 12, huffLUT)'; |
|
|
AACSeq3(i + 1).chl.G, ... |
|
|
if strcmp(AACSeq3(i+1).frameType, 'ESH') |
|
|
AACSeq3(i+1).frameType); |
|
|
sfcDeHuffL(42, 8) = 0; |
|
|
frameF(:, 2) = iAACquantizer(AACSeq3(i + 1).chr.stream, ... |
|
|
sfcDeHuffR(42, 8) = 0; |
|
|
AACSeq3(i + 1).chr.sfc, ... |
|
|
sfcDeHuffL(2:end, :) = reshape(sfcL, [41 8]); |
|
|
AACSeq3(i + 1).chr.G, ... |
|
|
sfcDeHuffR(2:end, :) = reshape(sfcR, [41 8]); |
|
|
AACSeq3(i+1).frameType); |
|
|
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, ... |
|
|
|
|
|
AACSeq3(i + 1).chl.G, AACSeq3(i+1).frameType); |
|
|
|
|
|
frameF(:, 2) = iAACquantizer(SR, sfcDeHuffR, ... |
|
|
|
|
|
AACSeq3(i + 1).chr.G, AACSeq3(i+1).frameType); |
|
|
|
|
|
|
|
|
frameF(:, 1) = iTNS(frameF(:, 1), ... |
|
|
frameF(:, 1) = iTNS(frameF(:, 1), ... |
|
|
AACSeq3(i+1).frameType, ... |
|
|
AACSeq3(i+1).frameType, ... |
|
@ -86,6 +94,8 @@ function x = iAACoder3(AACSeq3, fNameOut) |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
decodedAudio(currFrameStart:currFrameStop, :) = decodedAudio(currFrameStart:currFrameStop, :) + frameT; |
|
|
decodedAudio(currFrameStart:currFrameStop, :) = decodedAudio(currFrameStart:currFrameStop, :) + frameT; |
|
|
|
|
|
|
|
|
|
|
|
clearvars sfcDeHuffL sfcDeHuffR |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
audiowrite(fNameOut, decodedAudio, 48000); |
|
|
audiowrite(fNameOut, decodedAudio, 48000); |
|
|