Changeset 636

Show
Ignore:
Timestamp:
07/16/07 01:52:41 (3 years ago)
Author:
dconrad
Message:

DTS decoder. Closes #91.
Add speaker order comments to the default channel layouts

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/FFissionCodec/FFissionCodec.r

    r628 r636  
    9191#define kComponentInfo                                  "An AudioCodec that decodes True Audio into linear PCM" 
    9292#include "XCAResources.r" 
     93 
     94#define kPrimaryResourceID                              144 
     95#define kComponentType                                  'adec' 
     96#define kComponentSubtype                               kAudioFormatDTS 
     97#define kComponentName                                  "DTS Coherent Acoustics" 
     98#define kComponentInfo                                  "An AudioCodec that decodes DCA Audio into linear PCM" 
     99#include "XCAResources.r" 
  • trunk/FFissionCodec/FFissionDecoder.cpp

    r628 r636  
    4747        { 0x6d730050, CODEC_ID_MP2 }, 
    4848        { kAudioFormatTTA, CODEC_ID_TTA }, 
     49        { kAudioFormatDTS, CODEC_ID_DTS }, 
    4950        { 0, CODEC_ID_NONE } 
    5051}; 
     
    358359                                                                                         AudioStreamPacketDescription* outPacketDescription) 
    359360{ 
    360         UInt32 ans = kAudioCodecProduceOutputPacketSuccess; 
     361        UInt32 ans; 
    361362         
    362363        if (!avCodec) 
     
    367368         
    368369        UInt32 written = 0; 
    369         ioNumberPackets = 0; 
    370370        Byte *outData = (Byte *) outOutputData; 
    371371         
     
    395395                        outBufUsed = 0; 
    396396                        ioOutputDataByteSize = written; 
     397                        ioNumberPackets = ioOutputDataByteSize / (2 * mOutputFormat.NumberChannels()); 
    397398                        return kAudioCodecProduceOutputPacketFailure; 
    398399                } 
     
    404405                outBufUsed -= amountToCopy; 
    405406                written += amountToCopy; 
    406                 ioNumberPackets++; 
    407407                 
    408408                // and save what's left over 
     
    413413        if (written < ioOutputDataByteSize) 
    414414                ans = kAudioCodecProduceOutputPacketNeedsMoreInputData; 
    415         else if (outBufUsed > written || inputBuffer.GetNumPackets() > 0) 
    416                 // we have more left than what we wrote, or an entire other packet 
     415        else if (inputBuffer.GetNumPackets() > 0) 
     416                // we have an entire packet left to decode 
    417417                ans = kAudioCodecProduceOutputPacketSuccessHasMore; 
     418        else 
     419                ans = kAudioCodecProduceOutputPacketSuccess; 
    418420         
    419421        ioOutputDataByteSize = written; 
     422        ioNumberPackets = ioOutputDataByteSize / (2 * mOutputFormat.NumberChannels()); 
    420423         
    421424        return ans; 
  • trunk/MatroskaCodecIDs.cpp

    r635 r636  
    628628static const AudioChannelLayout vorbisChannelLayouts[6] = { 
    629629        { kAudioChannelLayoutTag_UseChannelBitmap, kAudioChannelBit_Left | kAudioChannelBit_Right | kAudioChannelBit_CenterSurround }, 
    630         { kAudioChannelLayoutTag_Quadraphonic }, 
    631         { kAudioChannelLayoutTag_MPEG_5_0_C }, 
    632         { kAudioChannelLayoutTag_MPEG_5_1_C } 
     630        { kAudioChannelLayoutTag_Quadraphonic },                // L R Ls Rs 
     631        { kAudioChannelLayoutTag_MPEG_5_0_C },                  // L C R Ls Rs 
     632        { kAudioChannelLayoutTag_MPEG_5_1_C },                  // L C R Ls Rs LFE 
    633633}; 
    634634 
    635635// these should be the default for the number of channels; esds can specify other mappings 
    636636static const AudioChannelLayout aacChannelLayouts[6] = { 
    637         { kAudioChannelLayoutTag_MPEG_3_0_B },          // C L R according to wiki.multimedia.cx 
    638         { kAudioChannelLayoutTag_AAC_4_0 }, 
    639         { kAudioChannelLayoutTag_AAC_5_0 }, 
    640         { kAudioChannelLayoutTag_AAC_5_1 }, 
    641         { kAudioChannelLayoutTag_AAC_6_1 }, 
    642         { kAudioChannelLayoutTag_AAC_7_1 } 
     637        { kAudioChannelLayoutTag_MPEG_3_0_B },                  // C L R according to wiki.multimedia.cx 
     638        { kAudioChannelLayoutTag_AAC_4_0 },                             // C L R Cs 
     639        { kAudioChannelLayoutTag_AAC_5_0 },                             // C L R Ls Rs 
     640        { kAudioChannelLayoutTag_AAC_5_1 },                             // C L R Ls Rs Lfe 
     641        { kAudioChannelLayoutTag_AAC_6_1 },                             // C L R Ls Rs Cs Lfe 
     642        { kAudioChannelLayoutTag_AAC_7_1 },                             // C Lc Rc L R Ls Rs Lfe 
    643643}; 
    644644 
    645645static const AudioChannelLayout ac3ChannelLayouts[6] = { 
    646         { kAudioChannelLayoutTag_ITU_3_0 }, 
    647         { kAudioChannelLayoutTag_ITU_3_1 }, 
    648         { kAudioChannelLayoutTag_ITU_3_2 }, 
    649         { kAudioChannelLayoutTag_ITU_3_2_1 } 
     646        { kAudioChannelLayoutTag_ITU_3_0 },                             // L R C 
     647        { kAudioChannelLayoutTag_ITU_3_1 },                             // L R C Cs 
     648        { kAudioChannelLayoutTag_ITU_3_2 },                             // L R C Ls Rs 
     649        { kAudioChannelLayoutTag_ITU_3_2_1 },                   // L R C LFE Ls Rs 
    650650}; 
    651651 
    652652static const AudioChannelLayout flacChannelLayouts[6] = { 
    653         { kAudioChannelLayoutTag_ITU_3_0 }, 
    654         { kAudioChannelLayoutTag_Quadraphonic }, 
    655         { kAudioChannelLayoutTag_ITU_3_2 }, 
    656         { kAudioChannelLayoutTag_ITU_3_2_1 }, 
    657         { kAudioChannelLayoutTag_MPEG_6_1_A }, 
    658         { kAudioChannelLayoutTag_MPEG_7_1_C } 
     653        { kAudioChannelLayoutTag_ITU_3_0 },                             // L R C 
     654        { kAudioChannelLayoutTag_Quadraphonic },                // L R Ls Rs 
     655        { kAudioChannelLayoutTag_ITU_3_2 },                             // L R C Ls Rs 
     656        { kAudioChannelLayoutTag_ITU_3_2_1 },                   // L R C LFE Ls Rs 
     657        { kAudioChannelLayoutTag_MPEG_6_1_A },                  // L R C LFE Ls Rs Cs 
     658        { kAudioChannelLayoutTag_MPEG_7_1_C },                  // L R C LFE Ls Rs Rls Rrs 
     659}; 
     660 
     661// 5.1 is tested, the others are just guesses 
     662static const AudioChannelLayout dtsChannelLayouts[6] = { 
     663        { kAudioChannelLayoutTag_MPEG_3_0_B },                  // C L R 
     664        { kAudioChannelLayoutTag_MPEG_4_0_B },                  // C L R Cs 
     665        { kAudioChannelLayoutTag_MPEG_5_0_D },                  // C L R Ls Rs 
     666        { kAudioChannelLayoutTag_MPEG_5_1_D },                  // C L R Ls Rs Lfe 
    659667}; 
    660668 
     
    681689                        case kAudioFormatAC3: 
    682690                                acl = ac3ChannelLayouts[channelIndex]; 
     691                                break; 
     692                                 
     693                        case kAudioFormatDTS: 
     694                                acl = dtsChannelLayouts[channelIndex]; 
    683695                                break; 
    684696                } 
  • trunk/ff_MovieImport.c

    r623 r636  
    9191                register_avcodec(&mp2_decoder); 
    9292                register_avcodec(&tta_decoder); 
     93                register_avcodec(&dca_decoder); 
    9394                 
    9495                av_log_set_callback(FFMpegCodecprintf);