Changeset 15
- Timestamp:
- 08/20/06 19:56:21 (2 years ago)
- Files:
-
- trunk/A52/ACShepA52Decoder.cpp (modified) (6 diffs)
- trunk/A52/ACShepA52Decoder.h (modified) (2 diffs)
- trunk/A52Codec.xcodeproj/project.pbxproj (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/A52/ACShepA52Decoder.cpp
r13 r15 20 20 //============================================================================= 21 21 22 #define DEBUG23 22 #define kAudioFormatAVIAC3 0x6D732000 24 23 … … 85 84 86 85 remainingBytesFromLastFrame = 0; 87 beginningOfIncompleteHeaderSize = 0; 86 beginningOfIncompleteHeaderSize = 0; 87 88 CFPreferencesAppSynchronize(CFSTR("com.cod3r.a52codec")); 89 CFTypeRef dynRange = CFPreferencesCopyAppValue(CFSTR("dynamicRange"), CFSTR("com.cod3r.a52codec")); 90 if(dynRange != NULL) 91 { 92 CFTypeID type = CFGetTypeID(dynRange); 93 if(type == CFStringGetTypeID()) 94 dynamicRangeCompression = CFStringGetDoubleValue((CFStringRef)dynRange); 95 else if(type == CFNumberGetTypeID()) 96 CFNumberGetValue((CFNumberRef)dynRange, kCFNumberDoubleType, &dynamicRangeCompression); 97 else 98 dynamicRangeCompression = 1; 99 } 100 else 101 dynamicRangeCompression = 1; //no compression 102 103 CFTypeRef stereo = CFPreferencesCopyAppValue(CFSTR("useStereoOverDolby"), CFSTR("com.cod3r.a52codec")); 104 if(stereo != NULL) 105 { 106 CFTypeID type = CFGetTypeID(dynRange); 107 if(type == CFStringGetTypeID()) 108 dynamicRangeCompression = CFStringGetIntValue((CFStringRef)dynRange); 109 else if(type == CFNumberGetTypeID()) 110 CFNumberGetValue((CFNumberRef)dynRange, kCFNumberIntType, &dynamicRangeCompression); 111 else 112 useStereoOverDolby = 0; 113 } 114 else 115 useStereoOverDolby = 0; 88 116 89 117 //fprintf(stderr, "ACShepA52Decoder::Constructor: Number of input formats supported: %lu\n", GetNumberSupportedInputFormats()); … … 267 295 } 268 296 297 static sample_t dynrng_call (sample_t c, void *data) 298 { 299 double *level = (double *)data; 300 return pow((double)c, *level); 301 } 302 269 303 UInt32 ACShepA52Decoder::ProduceOutputPackets(void* outOutputData, 270 304 UInt32& ioOutputDataByteSize, … … 397 431 bias = 0; 398 432 } 399 400 433 401 434 while(processed_frames < frames_to_process) { 402 435 // Redo the entry, for each loop … … 438 471 439 472 case 2: 440 // All we really need is stereophonic, baby 441 a52_flags = A52_DOLBY | A52_ADJUST_LEVEL; 473 // All we really need is stereophonic, baby 474 if(useStereoOverDolby) 475 a52_flags = A52_STEREO | A52_ADJUST_LEVEL; 476 else 477 a52_flags = A52_DOLBY | A52_ADJUST_LEVEL; 442 478 break; 443 479 … … 459 495 readLength = bytes_to_read; 460 496 input_data = GetBytes(readLength); 461 // TODO: Try to test for stereo return and shift to Dolby?462 497 a52_frame(decoder_state, input_data, &a52_flags, &level, bias); 498 a52_dynrng(decoder_state, dynrng_call, &dynamicRangeCompression); 463 499 464 500 // Cycle through the blocks, and actually do stuff trunk/A52/ACShepA52Decoder.h
r13 r15 72 72 UInt32 total_bytes; 73 73 74 bool firstInput;74 bool firstInput; 75 75 76 76 //For badly packetized data … … 78 78 Byte beginningOfIncompleteHeader[6]; 79 79 UInt32 beginningOfIncompleteHeaderSize; 80 81 //Prefs 82 bool useStereoOverDolby; 83 double dynamicRangeCompression; 80 84 }; 81 85 trunk/A52Codec.xcodeproj/project.pbxproj
r14 r15 803 803 ); 804 804 INFOPLIST_FILE = "Info-A52Codec__Upgraded_.plist"; 805 OTHER_CFLAGS = "-DIS_COMPILER_WORKING=0"; 805 OTHER_CFLAGS = ( 806 "-DIS_COMPILER_WORKING=0", 807 "-DDEBUG", 808 ); 806 809 OTHER_REZFLAGS = "-d ppc_$ppc -d i386_$i386 -i / -i /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/A/Headers -I /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers"; 807 810 PRODUCT_NAME = A52Codec;
