Changeset 1093
- Timestamp:
- 07/08/09 01:33:40 (14 months ago)
- Location:
- branches/perian-1.1
- Files:
-
- 7 modified
-
. (modified) (1 prop)
-
MatroskaCodecIDs.cpp (modified) (4 diffs)
-
MatroskaImportPrivate.cpp (modified) (2 diffs)
-
Plists/Perian-Info.plist (modified) (2 diffs)
-
Plists/PerianPane-Info.plist (modified) (1 diff)
-
Release/Makefile (modified) (1 diff)
-
createStaticLibs.sh (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/perian-1.1
- Property svn:mergeinfo changed
/trunk merged: 1088-1089,1091-1092
- Property svn:mergeinfo changed
-
branches/perian-1.1/MatroskaCodecIDs.cpp
r1083 r1093 365 365 {"A_AAC/MPEG2/MAIN", 1}, 366 366 {"A_AAC/MPEG2/LC", 2}, 367 {"A_AAC/MPEG2/LC/SBR", 5},367 {"A_AAC/MPEG2/LC/SBR", 2}, 368 368 {"A_AAC/MPEG2/SSR", 3}, 369 369 {"A_AAC/MPEG4/MAIN", 1}, 370 370 {"A_AAC/MPEG4/LC", 2}, 371 {"A_AAC/MPEG4/LC/SBR", 5},371 {"A_AAC/MPEG4/LC/SBR", 2}, 372 372 {"A_AAC/MPEG4/SSR", 3}, 373 373 {"A_AAC/MPEG4/LTP", 4} … … 379 379 }; 380 380 381 static int FindAACFreqIndex(double freq) 382 { 383 unsigned ifreq = freq; 384 385 for (int i = 0; i < sizeof(kAACFrequencyIndexes)/sizeof(unsigned); i++) { 386 if (kAACFrequencyIndexes[i] == ifreq) return i; 387 } 388 389 return 15; 390 } 391 381 392 static void RecreateAACVOS(KaxTrackEntry *tr_entry, uint8_t *vosBuf, size_t *vosLen) 382 393 { 383 unsigned char profile = 2, freq_index = 15;384 394 KaxCodecID *tr_codec = FindChild<KaxCodecID>(*tr_entry); 385 395 KaxTrackAudio & audioTrack = GetChild<KaxTrackAudio>(*tr_entry); 386 396 KaxAudioSamplingFreq & sampleFreq = GetChild<KaxAudioSamplingFreq>(audioTrack); 387 397 KaxAudioChannels & numChannels = GetChild<KaxAudioChannels>(audioTrack); 388 unsigned freq = unsigned((double)sampleFreq), channels = unsigned(numChannels); 389 398 KaxAudioOutputSamplingFreq * outputFreq = FindChild<KaxAudioOutputSamplingFreq>(audioTrack); 399 unsigned channels = unsigned(numChannels); 400 unsigned profile = 2, freq_index = FindAACFreqIndex(sampleFreq); 401 uint8_t *vosStart = vosBuf; 390 402 string codecString(*tr_codec); 391 403 … … 395 407 } 396 408 397 for (int i = 0; i < sizeof(kAACFrequencyIndexes)/sizeof(unsigned); i++) { 398 if (kAACFrequencyIndexes[i] == freq) {freq_index = i; break;} 399 } 400 401 if (profile == 5) 402 profile = 2; // disable SBR 403 404 if (freq_index != 15) { 405 *vosBuf++ = (profile << 3) | (freq_index >> 1); 406 *vosBuf++ = (freq_index << 7) | (channels << 3); 407 *vosLen = 2; 408 } else { 409 *vosBuf++ = (profile << 3) | (freq_index >> 1); 410 *vosBuf++ = (freq_index << 7) | (freq >> (24 - 7)); 411 *vosBuf++ = (freq >> (24 - 7 - 8)); 412 *vosBuf++ = (freq >> (24 - 7 - 16)); 413 *vosBuf++ = ((freq & 1) << 7) | (channels << 3); 414 *vosLen = 5; 415 } 416 417 //FIXME for when SBR is supported: 418 //write the extension data here 419 //(see libavformat matroskadec.c) 409 *vosBuf++ = (profile << 3) | (freq_index >> 1); 410 *vosBuf++ = (freq_index << 7) | (channels << 3); 411 412 if (freq_index == 15) 413 Codecprintf(NULL, "unrecognized AAC frequency not supported\n"); 414 415 if (outputFreq) { 416 unsigned output_freq_index = FindAACFreqIndex(*outputFreq); 417 418 //SBR extension 419 //not sure why we still use object type 2 (LC) instead of 5 (HE) 420 *vosBuf++ = 0x56; 421 *vosBuf++ = 0xE5; 422 *vosBuf++ = 0x80 | (output_freq_index << 3); 423 } 424 425 *vosLen = vosBuf - vosStart; 420 426 } 421 427 … … 520 526 size_t esdsLen; 521 527 522 // QT doesn't like most SBR setup data (5 bytes) so pretend it's LC 523 if (audio && (!vosBuf || vosLen > 2)) { 528 if (audio && !vosBuf) { 524 529 RecreateAACVOS(tr_entry, aacBuf, &vosLen); 525 530 vosBuf = aacBuf; 526 531 } else if (!audio && !vosBuf) 527 532 return NULL; 528 533 529 534 uint8_t *esds = CreateEsdsFromSetupData(vosBuf, vosLen, &esdsLen, trackID, audio, !audio); 530 535 -
branches/perian-1.1/MatroskaImportPrivate.cpp
r1081 r1093 517 517 asbd.mSampleRate = Float64(sampleFreq); 518 518 asbd.mChannelsPerFrame = uint32(numChannels); 519 asbd.mFramesPerPacket = 1; // needed for mp3 and v1 SoundDescription, maybe others520 519 521 520 MkvFinishAudioDescriptions(&kaxTrack, &asbd, &acl); … … 525 524 if(asbd.mChannelsPerFrame == 0) 526 525 asbd.mChannelsPerFrame = 1; // avoid a div by zero 526 if(asbd.mFramesPerPacket == 0) 527 asbd.mFramesPerPacket = 1; //in case of PCM or broken codecs 528 //note: this is completely wrong, but less so than 0 529 527 530 528 531 // FIXME mChannelLayoutTag == 0 is valid -
branches/perian-1.1/Plists/Perian-Info.plist
r1081 r1093 8 8 <string>Perian</string> 9 9 <key>CFBundleGetInfoString</key> 10 <string>1.1.4 b1(SVNREVISION ffmpeg: FFMPEGREVISION), Copyright 2007 The Perian Team</string>10 <string>1.1.4 (SVNREVISION ffmpeg: FFMPEGREVISION), Copyright 2007 The Perian Team</string> 11 11 <key>CFBundleIdentifier</key> 12 12 <string>org.perian.Perian</string> … … 16 16 <string>BNDL</string> 17 17 <key>CFBundleShortVersionString</key> 18 <string>1.1.4 b1</string>18 <string>1.1.4</string> 19 19 <key>CFBundleSignature</key> 20 20 <string>????</string> 21 21 <key>CFBundleVersion</key> 22 <string>1.1.4 b1</string>22 <string>1.1.4</string> 23 23 <key>CSResourcesFileMapped</key> 24 24 <string>yes</string> -
branches/perian-1.1/Plists/PerianPane-Info.plist
r1081 r1093 33 33 <string>????</string> 34 34 <key>CFBundleVersion</key> 35 <string>1.1.4 b1</string>35 <string>1.1.4</string> 36 36 <key>CFBundleGetInfoString</key> 37 <string>1.1.4 b1(SVNREVISION ffmpeg: FFMPEGREVISION), Copyright 2007 The Perian Team</string>37 <string>1.1.4 (SVNREVISION ffmpeg: FFMPEGREVISION), Copyright 2007 The Perian Team</string> 38 38 <key>CFBundleName</key> 39 39 <string>Perian</string> -
branches/perian-1.1/Release/Makefile
r1081 r1093 4 4 # Check the Perian.component target and PerianPane target. 5 5 6 VERSION=1.1.4 b17 BETA= TRUE6 VERSION=1.1.4 7 BETA=FALSE 8 8 SRC_DIR=.. 9 9 BUILD_DIR=build -
branches/perian-1.1/createStaticLibs.sh
r1081 r1093 7 7 fi 8 8 9 generalConfigureOptions="--disable-muxers --disable-encoders --disable-stripping -- enable-pthreads --disable-ffmpeg --disable-network --disable-ffplay --disable-ffserver"9 generalConfigureOptions="--disable-muxers --disable-encoders --disable-stripping --disable-amd3dnow --enable-runtime-cpudetect --enable-pthreads --disable-ffmpeg --disable-network --disable-ffplay --disable-ffserver" 10 10 cflags="-isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -g -Dattribute_deprecated= -w" 11 11 … … 14 14 buildid_ffmpeg="${buildid_ffmpeg}Dev" 15 15 else 16 optcflags="-falign-loops=16 -fweb -fstrict-aliasing -finline-limit=1000 "16 optcflags="-falign-loops=16 -fweb -fstrict-aliasing -finline-limit=1000 -freorder-blocks" 17 17 buildid_ffmpeg="${buildid_ffmpeg}Dep" 18 18 fi … … 114 114 if [ "$BUILD_STYLE" != "Development" ] ; then 115 115 optcflags="$optcflags -mtune=$x86tune -frerun-cse-after-loop" 116 appendcflags="-fno-unswitch-loops" #these disable things in -O3 so must be at the end 116 117 fi 117 118 … … 132 133 cd .. 133 134 fi 135 136 perl -pi -e "s/-O3/-O3 $appendcflags/g" config.mak 137 134 138 make -j3 135 139 fi
