• bnnm's avatar
    avcodec/atrac3: Add multichannel joint stereo ATRAC3 · c61b28e0
    bnnm authored
    Multichannel joint stereo simply interleaves stereo pairs (6ch: 2ch + 2ch + 2ch), so each pair is decoded separatedly.
    
    ***
    
    To test my changes, I converted examples to wav with ffmpeg.exe (old and new), and compared them to see they are byte-exact.
    
    Regular 2ch files (JS and normal) were straightforward to test.
    
    For multichannel, to check each JS pair is correctly decoded separatedly I did:
    - manually demux 6ch.msf into 3 pairs and convert them (2ch_1.wav + 2ch_2.wav + 2ch_3.wav)
    - convert the 6ch.msf file to wav (with my changes)
    - manually demux the 6ch.wav into 3 pairs (6ch_d1.wav + 6ch_d2.wav + 6ch_d3.wav)
    - compare each pair (ex. 2ch_3.wav vs 6ch_d3.wav): all pairs are byte-exact.
    
    The new code just processes each JS pair separatedly, there are no algorithm changes.
    It could be improved a bit but I'm not sure about typical styles.
    I've only seen 6ch .MSF (probably the AT3 spec only supports 2ch audio).
    Signed-off-by: 's avatarbnnm <bananaman255@gmail.com>
    c61b28e0
atrac3.c 31.6 KB