Changeset 806

Show
Ignore:
Timestamp:
02/09/08 13:55:44 (2 years ago)
Author:
astrange
Message:

Merge 1.1 to trunk. If you're switching, delete ffmpeg/ first!
I haven't merged the nib changes, so the component manager is missing again.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/perian-1.1/PerianPrefPane.nib/info.nib

    r802 r806  
    99        <key>IBOpenObjects</key> 
    1010        <array> 
    11                 <integer>32</integer> 
     11                <integer>5</integer> 
    1212        </array> 
    1313        <key>IBSystem Version</key> 
  • trunk/CAPublicUtility/CAStreamBasicDescription.cpp

    r219 r806  
    5050        #include <Endian.h> 
    5151#endif 
     52 
     53#import "CodecIDs.h" 
    5254 
    5355const AudioStreamBasicDescription       CAStreamBasicDescription::sEmpty = { 0.0, 0, 0, 0, 0, 0, 0, 0, 0 }; 
     
    272274                 
    273275                case kAudioFormatAC3: 
     276                case kAudioFormatAC3MS: 
    274277                        strcpy(outName, "AC-3"); 
    275278                        break; 
  • trunk/CommonUtils.c

    r585 r806  
    7070        { "he", "heb", langHebrew }, 
    7171        { "hi", "hin", langHindi }, 
    72         { "",   "hmn", langHungarian }, 
     72        { "hu", "hun", langHungarian }, 
    7373        { "is", "ice", langIcelandic }, 
    7474        { "is", "isl", langIcelandic }, 
  • trunk/FFusionCodec.c

    r736 r806  
    4141#include "FrameBuffer.h" 
    4242#include "CommonUtils.h" 
     43#include "pthread.h" 
    4344 
    4445void inline swapFrame(AVFrame * *a, AVFrame * *b) 
     
    164165#include <QuickTime/ComponentDispatchHelper.c> 
    165166 
     167void *launchUpdateChecker(void *args) 
     168{ 
     169        FSRef *ref = (FSRef *)args; 
     170    LSOpenFSRef(ref, NULL); 
     171        free(ref); 
     172        return NULL; 
     173} 
     174 
    166175void FFusionRunUpdateCheck() 
    167176{ 
     
    181190     
    182191    char fileRep[1024]; 
    183     FSRef updateCheckRef
     192    FSRef *updateCheckRef = malloc(sizeof(FSRef))
    184193    Boolean doCheck = FALSE; 
    185194     
    186195    if(CFStringGetFileSystemRepresentation(location, fileRep, 1024)) 
    187         if(FSPathMakeRef((UInt8 *)fileRep, &updateCheckRef, NULL) == noErr) 
     196        if(FSPathMakeRef((UInt8 *)fileRep, updateCheckRef, NULL) == noErr) 
    188197            doCheck = TRUE; 
    189198     
     
    193202        CFStringRef absLocation = CFSTR("/Library/PreferencePanes/Perian.prefPane/Contents/Resources/PerianUpdateChecker.app"); 
    194203        if(CFStringGetFileSystemRepresentation(absLocation, fileRep, 1024)) 
    195             if(FSPathMakeRef((UInt8 *)fileRep, &updateCheckRef, NULL) != noErr) 
     204            if(FSPathMakeRef((UInt8 *)fileRep, updateCheckRef, NULL) != noErr) 
    196205                return;  //We have failed 
    197206    } 
    198      
    199     LSOpenFSRef(&updateCheckRef, NULL);     
     207        pthread_t thread; 
     208        pthread_create(&thread, NULL, launchUpdateChecker, updateCheckRef); 
    200209} 
    201210 
     
    290299            Codecprintf(glob->fileLog, "Error opening the base image decompressor! Exiting.\n"); 
    291300        } 
     301                 
     302                // we allocate some space for copying the frame data since we need some padding at the end 
     303                // for ffmpeg's optimized bitstream readers. Size doesn't really matter, it'll grow if need be 
     304                FFusionDataSetup(&(glob->data), 256, 64*1024); 
    292305        FFusionRunUpdateCheck(); 
    293306    } 
     
    315328            DisposeImageCodecMPDrawBandUPP(glob->drawBandUPP); 
    316329        } 
    317          
    318         if (glob->avCodec) 
    319         { 
    320             avcodec_close(glob->avContext); 
    321         } 
    322330                                 
    323331        if (glob->avContext) 
     
    326334                                free(glob->avContext->extradata); 
    327335                                                 
     336                        if (glob->avContext->codec) avcodec_close(glob->avContext); 
    328337            av_free(glob->avContext); 
    329338        } 
     
    344353                        fclose(glob->fileLog); 
    345354                 
     355        memset(glob, 0, sizeof(FFusionGlobalsRecord)); 
    346356        DisposePtr((Ptr)glob); 
    347357    } 
     
    453463        long count = 0; 
    454464        Handle imgDescExt; 
     465        OSErr err = noErr; 
    455466         
    456467    // We first open libavcodec library and the codec corresponding 
     
    678689                        ffusionParseExtraData(glob->begin.parser, glob->avContext->extradata, glob->avContext->extradata_size); 
    679690                 
     691                // XXX: at the moment ffmpeg can't handle interlaced H.264 right 
     692                // specifically PAFF + spatial prediction 
     693                if (glob->componentType == 'avc1' && !ffusionIsParsedVideoDecodable(glob->begin.parser)) 
     694                        err = featureUnsupported; 
     695                 
    680696                // some hooks into ffmpeg's buffer allocation to get frames in  
    681697                // decode order without delay more easily 
     
    693709            Codecprintf(glob->fileLog, "Error opening avcodec!\n"); 
    694710             
    695             return -2
     711                       err = paramErr
    696712        } 
    697713                 
    698                 // we allocate some space for copying the frame data since we need some padding at the end 
    699                 // for ffmpeg's optimized bitstream readers. Size doesn't really matter, it'll grow if need be 
    700                 FFusionDataSetup(&(glob->data), 256, 64*1024); 
    701714    } 
    702715     
     
    736749    index = 0; 
    737750         
     751        if (!err) { 
    738752        switch (glob->avContext->pix_fmt) 
    739753        { 
     
    756770                        break; 
    757771        } 
     772        } 
    758773     
    759774    pos[index++] = 0; 
     
    771786        capabilities->flags |= codecCanAsync | codecCanAsyncWhen; 
    772787         
    773      
    774     return noErr; 
     788    return err; 
    775789} 
    776790 
     
    833847        myDrp->frameData = NULL; 
    834848        myDrp->buffer = NULL; 
     849         
     850        if (!glob->avContext) { 
     851                fprintf(stderr, "Perian Codec: QT tried to call BeginBand without preflighting!\n"); 
     852                return internalComponentErr; 
     853        } 
    835854         
    836855        if(myDrp->decoded) 
  • trunk/FFusionCodec.h

    r708 r806  
    2929//--------------------------------------------------------------------------- 
    3030 
    31 #define kFFusionCodecVersion            (0x00030002
     31#define kFFusionCodecVersion            (0x00030003
    3232 
    3333#define kDivX1CodecInfoResID            256 
  • trunk/FrameBuffer.c

    r641 r806  
    3939                free(data->frames[i]); 
    4040        } 
    41         free(data->buffer); 
     41        free(data->frames); 
     42        av_free(data->buffer); 
    4243} 
    4344 
  • trunk/MatroskaCodecIDs.cpp

    r726 r806  
    427427} 
    428428 
     429static const unsigned char aac_lc_vos[] = {0x11, 0x90}; 
     430 
    429431static Handle CreateEsdsExt(KaxTrackEntry *tr_entry, bool audio) 
    430432{ 
     
    436438    uint8_t *vosBuf = codecPrivate ? codecPrivate->GetBuffer() : NULL; 
    437439        size_t esdsLen; 
     440         
     441        if (!vosBuf) { // minimal AAC-LC descriptor 
     442                vosBuf = (uint8_t*)aac_lc_vos; 
     443                vosLen = 2; 
     444        } 
    438445 
    439446        Handle esdsExt = NewHandleClear(4); 
     
    720727                                 
    721728                        case kAudioFormatAC3: 
     729                        case kAudioFormatAC3MS: 
    722730                                acl = ac3ChannelLayouts[channelIndex]; 
    723731                                break; 
     
    753761        { kAudioFormatMPEGLayer2, 0x50 }, 
    754762        { kAudioFormatMPEGLayer3, 0x55 }, 
    755         { kAudioFormatAC3, 0x2000 }, 
     763        { kAudioFormatAC3MS, 0x2000 }, 
    756764        { kAudioFormatDTS, 0x2001 }, 
    757765        { kAudioFormatMPEG4AAC, 0xff }, 
     
    795803        { kAudioFormatMPEGLayer2, "A_MPEG/L2" }, 
    796804        { kAudioFormatMPEGLayer3, "A_MPEG/L3" }, 
    797         { kAudioFormatAC3, "A_AC3" }, 
     805        { kAudioFormatAC3MS, "A_AC3" }, 
    798806        { kAudioFormatAC3MS, "A_AC3" }, 
    799807        // anything special for these two? 
    800         { kAudioFormatAC3, "A_AC3/BSID9" }, 
    801         { kAudioFormatAC3, "A_AC3/BSID10" }, 
     808        { kAudioFormatAC3MS, "A_AC3/BSID9" }, 
     809        { kAudioFormatAC3MS, "A_AC3/BSID10" }, 
    802810        { kAudioFormatXiphVorbis, "A_VORBIS" }, 
    803811        { kAudioFormatXiphFLAC, "A_FLAC" }, 
  • trunk/MatroskaImport.cpp

    r794 r806  
    116116        err = store->ImportDataRef((Handle)alias, rAliasType, theMovie, targetTrack, 
    117117                                                           usedTrack, atTime, durationAdded, inFlags, outFlags); 
    118         if (err) goto bail; 
    119          
    120         LoadExternalSubtitles(&theFileFSRef, theMovie); 
    121          
     118                 
    122119bail: 
    123120        if (alias) 
     
    131128                                                                          Track *usedTrack, TimeValue atTime, TimeValue *durationAdded, long inFlags, long *outFlags) 
    132129{ 
    133         return store->ImportDataRef(dataRef, dataRefType, theMovie, targetTrack, 
     130        ComponentResult res = store->ImportDataRef(dataRef, dataRefType, theMovie, targetTrack, 
    134131                                                                usedTrack, atTime, durationAdded, inFlags, outFlags); 
     132         
     133        LoadExternalSubtitlesFromFileDataRef(dataRef, dataRefType, theMovie); 
     134        return res; 
    135135} 
    136136 
     
    254254                        // invalid file, validate should catch this 
    255255                        return invalidMovie; 
    256                  
     256                                
    257257                err = SetupMovie(); 
    258258                if (err) return err; 
  • trunk/MatroskaImportPrivate.cpp

    r714 r806  
    657657                                                                           dataRef, HandleDataHandlerSubType); 
    658658        if (chapterMedia == NULL) { 
    659                 Codecprintf(NULL, "MKV: Error creating chapter media %d\n", GetMoviesError()); 
     659                OSErr err = GetMoviesError(); 
     660                Codecprintf(NULL, "MKV: Error creating chapter media %d\n", err); 
    660661                DisposeMovieTrack(chapterTrack); 
    661                 return GetMoviesError()
     662                return err
    662663        } 
    663664         
     
    966967        bool replaceSoundDesc = false; 
    967968         
    968         switch ((*desc)->dataFormat) { 
    969                 case kAudioFormatAC3: 
    970                         replaceSoundDesc = parse_ac3_bitstream(&asbd, &acl, block.GetBuffer(0).Buffer(), block.GetFrameSize(0)); 
    971                         break; 
     969        if (desc) { 
     970                switch ((*desc)->dataFormat) { 
     971                        case kAudioFormatAC3: 
     972                        case kAudioFormatAC3MS: 
     973                                replaceSoundDesc = parse_ac3_bitstream(&asbd, &acl, block.GetBuffer(0).Buffer(), block.GetFrameSize(0)); 
     974                                break; 
     975                } 
    972976        } 
    973977         
  • trunk/MatroskaImportVersion.h

    r794 r806  
    2424 
    2525// The high word is the codecInterfaceVersion 
    26 #define kMatroskaImportVersion          (0x00020001
     26#define kMatroskaImportVersion          (0x00020002
  • trunk/Perian.xcodeproj/project.pbxproj

    r792 r806  
    18041804                        buildSettings = { 
    18051805                                COPY_PHASE_STRIP = NO; 
    1806                                 FRAMEWORK_SEARCH_PATHS = ( 
    1807                                         "$(inherited)", 
    1808                                         "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", 
    1809                                 ); 
    1810                                 FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_DEVELOPER_DIR)/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks\""; 
    18111806                                GCC_DYNAMIC_NO_PIC = NO; 
    18121807                                GCC_ENABLE_FIX_AND_CONTINUE = YES; 
     
    18361831                        buildSettings = { 
    18371832                                COPY_PHASE_STRIP = YES; 
    1838                                 FRAMEWORK_SEARCH_PATHS = ( 
    1839                                         "$(inherited)", 
    1840                                         "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", 
    1841                                 ); 
    1842                                 FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_DEVELOPER_DIR)/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks\""; 
    18431833                                GCC_ENABLE_FIX_AND_CONTINUE = NO; 
    18441834                                GCC_ENABLE_OBJC_EXCEPTIONS = YES; 
     
    18681858                                DEAD_CODE_STRIPPING = NO; 
    18691859                                EXPORTED_SYMBOLS_FILE = "$(SOURCE_ROOT)/exportedSymbols"; 
    1870                                 FRAMEWORK_SEARCH_PATHS = ( 
    1871                                         "$(inherited)", 
    1872                                         "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", 
    1873                                         "$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)", 
    1874                                 ); 
    1875                                 FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_DEVELOPER_DIR)/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks\""; 
    1876                                 FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SYSTEM_DEVELOPER_DIR)/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks\""; 
    18771860                                GCC_DYNAMIC_NO_PIC = NO; 
    18781861                                GCC_ENABLE_FIX_AND_CONTINUE = YES; 
     
    18971880                                INFOPLIST_FILE = "Plists/Perian-Info.plist"; 
    18981881                                INSTALL_PATH = "$(HOME)/Library/QuickTime"; 
    1899                                 LIBRARY_SEARCH_PATHS = ( 
    1900                                         $SYMROOT/Universal, 
    1901                                         "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 
    1902                                 ); 
    1903                                 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\""; 
     1882                                LIBRARY_SEARCH_PATHS = $SYMROOT/Universal; 
    19041883                                OTHER_LDFLAGS = ( 
    19051884                                        "-framework", 
     
    19151894                                PRODUCT_NAME = Perian; 
    19161895                                REZ_PREPROCESSOR_DEFINITIONS = ""; 
    1917                                 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 
    19181896                                WRAPPER_EXTENSION = component; 
    19191897                                ZERO_LINK = NO; 
     
    19291907                                GCC_DYNAMIC_NO_PIC = NO; 
    19301908                                GCC_ENABLE_FIX_AND_CONTINUE = NO; 
     1909                                GCC_ENABLE_OBJC_GC = YES; 
    19311910                                GCC_GENERATE_DEBUGGING_SYMBOLS = NO; 
    19321911                                GCC_MODEL_TUNING = G5; 
     
    19471926                                INFOPLIST_FILE = "Plists/Perian-Info.plist"; 
    19481927                                INSTALL_PATH = "$(HOME)/Library/QuickTime"; 
    1949                                 LIBRARY_SEARCH_PATHS = ( 
    1950                                         $SYMROOT/Universal, 
    1951                                         "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 
    1952                                 ); 
     1928                                LIBRARY_SEARCH_PATHS = $SYMROOT/Universal; 
    19531929                                OTHER_CFLAGS = "$(OTHER_CFLAGS_$(CURRENT_ARCH))"; 
    19541930                                OTHER_CFLAGS_i386 = "-march=pentium-m -mtune=nocona $(OTHER_CFLAGS)"; 
     
    19831959                                GCC_ALTIVEC_EXTENSIONS = YES; 
    19841960                                GCC_MODEL_TUNING = G5; 
     1961                                OTHER_LDFLAGS = ( 
     1962                                        "-read_only_relocs", 
     1963                                        suppress, 
     1964                                ); 
    19851965                                SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 
    19861966                        }; 
     
    19991979                                GCC_STRICT_ALIASING = YES; 
    20001980                                MACOSX_DEPLOYMENT_TARGET = 10.4; 
     1981                                OTHER_LDFLAGS = ( 
     1982                                        "-read_only_relocs", 
     1983                                        suppress, 
     1984                                ); 
    20011985                                SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 
    20021986                                STRIP_INSTALLED_PRODUCT = NO; 
     
    20492033                                DEAD_CODE_STRIPPING = YES; 
    20502034                                EXPORTED_SYMBOLS_FILE = "$(SOURCE_ROOT)/exportedSymbols"; 
    2051                                 FRAMEWORK_SEARCH_PATHS = ( 
    2052                                         "$(inherited)", 
    2053                                         "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", 
    2054                                         "$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)", 
    2055                                 ); 
    2056                                 FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_DEVELOPER_DIR)/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks\""; 
    2057                                 FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SYSTEM_DEVELOPER_DIR)/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks\""; 
    20582035                                GCC_ALTIVEC_EXTENSIONS = YES; 
    20592036                                GCC_DYNAMIC_NO_PIC = NO; 
    20602037                                GCC_ENABLE_FIX_AND_CONTINUE = NO; 
     2038                                GCC_ENABLE_OBJC_GC = YES; 
    20612039                                GCC_FAST_MATH = YES; 
    20622040                                GCC_MODEL_TUNING = G5; 
     
    20782056                                INFOPLIST_FILE = "Plists/Perian-Info.plist"; 
    20792057                                INSTALL_PATH = "$(HOME)/Library/QuickTime"; 
    2080                                 LIBRARY_SEARCH_PATHS = ( 
    2081                                         $SYMROOT/Universal, 
    2082                                         "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 
    2083                                 ); 
    2084                                 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Universal\""; 
     2058                                LIBRARY_SEARCH_PATHS = $SYMROOT/Universal; 
    20852059                                OTHER_CFLAGS = "$(OTHER_CFLAGS_$(CURRENT_ARCH))"; 
    20862060                                OTHER_CFLAGS_i386 = "-march=pentium-m -mtune=nocona $(OTHER_CFLAGS)"; 
     
    20962070                                PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES; 
    20972071                                PRODUCT_NAME = Perian; 
    2098                                 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 
    20992072                                WRAPPER_EXTENSION = component; 
    21002073                                ZERO_LINK = NO; 
     
    21872160                                PREBINDING = NO; 
    21882161                                PRODUCT_NAME = Perian; 
    2189                                 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 
    21902162                                WRAPPER_EXTENSION = prefPane; 
    21912163                                ZERO_LINK = NO; 
     
    21972169                        buildSettings = { 
    21982170                                COPY_PHASE_STRIP = YES; 
    2199                                 FRAMEWORK_SEARCH_PATHS = ( 
    2200                                         "$(inherited)", 
    2201                                         "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", 
    2202                                 ); 
    2203                                 FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_DEVELOPER_DIR)/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks\""; 
    22042171                                GCC_ENABLE_FIX_AND_CONTINUE = NO; 
    22052172                                GCC_ENABLE_OBJC_EXCEPTIONS = YES; 
     
    22312198                                GCC_PREPROCESSOR_DEFINITIONS = DEBUG_BUILD; 
    22322199                                GCC_STRICT_ALIASING = YES; 
     2200                                OTHER_LDFLAGS = ( 
     2201                                        "-read_only_relocs", 
     2202                                        suppress, 
     2203                                ); 
    22332204                                SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 
    22342205                                STRIP_INSTALLED_PRODUCT = NO; 
     
    23362307                                PREBINDING = NO; 
    23372308                                PRODUCT_NAME = Perian; 
    2338                                 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 
    23392309                                WRAPPER_EXTENSION = prefPane; 
    23402310                                ZERO_LINK = YES; 
     
    23612331                                PREBINDING = NO; 
    23622332                                PRODUCT_NAME = Perian; 
    2363                                 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 
    23642333                                WRAPPER_EXTENSION = prefPane; 
    23652334                                ZERO_LINK = NO; 
  • trunk/PerianAviImporter.r

    r708 r806  
    2121****************************************************************************/ 
    2222 
    23 #define kChristophManufacturer 'Rafz
     23#define kChristophManufacturer 'Peri
    2424 
    2525#define thng_RezTemplateVersion 2 
  • trunk/Plists/Perian-Info.plist

    r612 r806  
    88        <string>Perian</string> 
    99        <key>CFBundleGetInfoString</key> 
    10         <string>1.0.9999 (SVNREVISION ffmpeg: FFMPEGREVISION), Copyright 2007 The Perian Team</string> 
     10        <string>1.1 (SVNREVISION ffmpeg: FFMPEGREVISION), Copyright 2007 The Perian Team</string> 
    1111        <key>CFBundleIdentifier</key> 
    1212        <string>org.perian.Perian</string> 
     
    1616        <string>BNDL</string> 
    1717        <key>CFBundleShortVersionString</key> 
    18         <string>1.0.9999</string> 
     18        <string>1.1</string> 
    1919        <key>CFBundleSignature</key> 
    2020        <string>????</string> 
    2121        <key>CFBundleVersion</key> 
    22         <string>1.0.9999</string> 
     22        <string>1.1</string> 
    2323        <key>CSResourcesFileMapped</key> 
    2424        <string>yes</string> 
  • trunk/Plists/PerianPane-Info.plist

    r612 r806  
    3333        <string>????</string> 
    3434        <key>CFBundleVersion</key> 
    35         <string>1.0.9999</string> 
     35        <string>1.1</string> 
    3636        <key>CFBundleName</key> 
    3737        <string>Perian</string> 
  • trunk/Plists/PerianUpdateChecker-Info.plist

    r612 r806  
    1818        <string>????</string> 
    1919        <key>CFBundleVersion</key> 
    20         <string>1.0.9999</string> 
     20        <string>1.1</string> 
    2121        <key>NSMainNibFile</key> 
    2222        <string>UpdateCheckerMainMenu</string> 
  • trunk/Release/Changes.txt

    r731 r806  
    33- TrueAudio, MP1, and DTS audio support 
    44- Slice-based multithreaded decoding for MPEG-1/2/H.264 
    5 - Better support for interlaced H.264 
    6 - Compatibility fixes for QuickTime 7.2 and Leopard 
     5- Apple H.264 now handles AVCHD/interlaced video 
     6- Compatibility fixes for QuickTime 7.4 and Leopard 
    77- Objective-C GC compatibility 
    88- Fixed a crash in Toast 
  • trunk/Release/Makefile

    r528 r806  
    44# Check the Perian.component target and PerianPane target. 
    55 
    6 VERSION=1.0b5 
     6VERSION=1.1 
    77BETA=FALSE 
    88SRC_DIR=.. 
  • trunk/Release/Read Me.rtf

    r792 r806  
    22{\fonttbl\f0\fswiss\fcharset0 Helvetica;} 
    33{\colortbl;\red255\green255\blue255;} 
     4\margl1440\margr1440\vieww16040\viewh15820\viewkind0 
    45\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural 
    56 
    67\f0\b\fs24 \cf0 About 
    78\b0 \ 
    8 Perian aims at providing a single package to provide all your playback needs.  It is a collection of QuickTime components incorporating several libraries:\ 
     9Perian aims to provide a single package for all your playback needs.  It is a collection of QuickTime components incorporating several libraries:\ 
    910 \'95 libavcodec, from the ffmpeg project, along with code from the old FFusion component:\ 
    1011        \'95 MS-MPEG4 v1 & v2\ 
    1112        \'95 DivX\ 
    12         \'95 3ivX
     13        \'95 3ivx
    1314        \'95 H.264\ 
    1415        \'95 Flash Video\ 
     
    1920        \'95 HuffYUV\ 
    2021        \'95 ffvhuff\ 
    21         \'95 MPEG-1 & 2 video\ 
    22         \'95 FRAPS
     22        \'95 MPEG-1 & 2 Video\ 
     23        \'95 Fraps (up to v4)
    2324        \'95 Windows Media Audio v1 & v2\ 
    2425        \'95 Flash ADPCM\ 
    2526        \'95 Xiph Vorbis (in Matroska)\ 
    26         \'95 MPEG Layer II Audio\ 
     27        \'95 MPEG Layer I and II audio\ 
     28        \'95 DTS Coherent Acoustics audio\ 
     29        \'95 Snow wavelet video\ 
    2730 \'95 libavformat, from the ffmpeg project. along with AVIImporter.component:\ 
    2831        \'95 AVI file format\ 
     
    3033 \'95 libmatroska, along with matroska-qt.component:\ 
    3134        \'95 MKV file format\ 
    32  \'95 Subtitle parsing
     35 \'95 Subtitles:
    3336        \'95 SSA file format\ 
    3437        \'95 SRT file format\ 
    35  \'95 liba52, via A52Codec
     38 \'95 liba52, via A52Codec:
    3639        \'95 AC3 audio\ 
    3740\ 
    38 The code is available under the LGPL. The project site is located at <http://trac.perian.org/> and the project subversion repository is located at <http://svn.perian.org/>.\ 
    39 The code for A52Codec is available under GPL. The project site is located at <http://trac.cod3r.com/a52codec/> and the project subversion repository is located at <http://svn.cod3r.com/a52codec/>.\ 
     41The code is available under the LGPL. The project site is located at <http://trac.perian.org/> and the project Subversion repository is located at <http://svn.perian.org/>.\ 
     42The code for A52Codec is available under the GPL. The project site is located at <http://trac.cod3r.com/a52codec/> and the project Subversion repository is located at <http://svn.cod3r.com/a52codec/>.\ 
    4043\ 
    4144 
     
    5861\b0 \ 
    5962J\'e9r\'f4me Cornet and his FFusion project for giving me the idea and code to start from Christoph N\'e4geli's AVI Importer from his XviD component, which allowed us to leverage libavformat.\ 
    60 FFMPEG project for providing such a rich library.\ 
     63
     64The FFmpeg project for providing such a rich library.\ 
     65(http://ffmpeg.mplayerhq.hu/)\ 
     66
    6167The Mozilla Foundation and Dag \'c5gren for the universal charset detector.\ 
     68(http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html, http://wakaba.c3.cx/s/apps/unarchiver.html)\ 
     69\ 
    6270Adrian Thurston for the Ragel parser generator.\ 
     71(http://www.cs.queensu.ca/~thurston/ragel/)\ 
     72\ 
    6373Matroska for their library.\ 
     74(http://www.matroska.org/)\ 
    6475\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural 
    65 \cf0 Bryan Bortz for the icon.\ 
     76\cf0 \ 
     77Bryan Bortz for the icon.\ 
     78(http://www.owlboy.com/)\ 
    6679\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural 
    67 \cf0 Ken Aspeslagh for releasing the source to his QuickTime Component Manager (http://macdaddyworld.com/quicktime-component-manager/) which gives us most of the smarts for the component manager tab.\ 
     80\cf0 \ 
     81All the people that put up with my insane requests for help and free testing, notably MartianSteve from #macsb for the first ICBM test, and Graham Booker for joining up with me and fixing the build every time I add a feature and then run off somewhere like the overcommitted madman I am.\ 
     82
    6883\ 
    6984\ 
  • trunk/Subtitles/SubATSUIRenderer.m

    r731 r806  
    262262        free(ubuffer); 
    263263        UCDisposeTextBreakLocator(&breakLocator); 
     264        ATSUDisposeTextLayout(layout); 
    264265        [super dealloc]; 
    265266} 
     
    269270        free(ubuffer); 
    270271        UCDisposeTextBreakLocator(&breakLocator); 
     272        ATSUDisposeTextLayout(layout); 
    271273        [super finalize]; 
    272274} 
     
    349351} 
    350352 
    351 -(void)releaseStyleEx:(void*)ex 
     353-(void)releaseStyleExtra:(void*)ex 
    352354{ 
    353355        ATSUDisposeStyle(ex); 
     
    541543} 
    542544 
    543 static void GetTypographicRectangleForLayout(ATSUTextLayout layout, UniCharArrayOffset *breaks, ItemCount breakCount, Fixed *lX, Fixed *lY, Fixed *height, Fixed *width) 
     545static void GetTypographicRectangleForLayout(ATSUTextLayout layout, UniCharArrayOffset *breaks, ItemCount breakCount, Fixed extraHeight, Fixed *lX, Fixed *lY, Fixed *height, Fixed *width) 
    544546{ 
    545547        ATSTrapezoid trap = {0}; 
     
    555557                ATSUGetGlyphBounds(layout, 0, baseY, breaks[i], end-breaks[i], kATSUseDeviceOrigins, 1, &trap, &trapCount); 
    556558 
    557                 baseY += GetLineHeight(layout, breaks[i])
     559                baseY += GetLineHeight(layout, breaks[i]) + extraHeight
    558560                 
    559561                rect.bottom = MAX(trap.lowerLeft.y, trap.lowerRight.y); 
     
    575577        *width = largeRect.right - largeRect.left; 
    576578} 
     579 
     580#if 0 
     581static void GetImageBoundingBoxForLayout(ATSUTextLayout layout, UniCharArrayOffset *breaks, ItemCount breakCount, Fixed extraHeight, Fixed *lX, Fixed *lY, Fixed *height, Fixed *width) 
     582{ 
     583        Rect largeRect = {0}; 
     584        ATSUTextMeasurement baseY = 0; 
     585        int i; 
     586         
     587        for (i = breakCount; i >= 0; i--) { 
     588                UniCharArrayOffset end = breaks[i+1]; 
     589                Rect rect; 
     590                 
     591                ATSUMeasureTextImage(layout, breaks[i], end-breaks[i], 0, baseY, &rect); 
     592                 
     593                baseY += GetLineHeight(layout, breaks[i]) + extraHeight; 
     594                 
     595                if (i == breakCount) largeRect = rect; 
     596                 
     597                largeRect.bottom = MAX(largeRect.bottom, rect.bottom); 
     598                largeRect.left = MIN(largeRect.left, rect.left); 
     599                largeRect.top = MIN(largeRect.top, rect.top); 
     600                largeRect.right = MAX(largeRect.right, rect.right); 
     601                        } 
     602         
     603         
     604        if (lX) *lX = IntToFixed(largeRect.left); 
     605        if (lY) *lY = IntToFixed(largeRect.bottom); 
     606        *height = IntToFixed(largeRect.bottom - largeRect.top); 
     607        *width = IntToFixed(largeRect.right - largeRect.left); 
     608} 
     609#endif 
    577610 
    578611enum {fillc, strokec}; 
     
    806839                ATSUTextMeasurement lineWidth, lineHeight, lineX, lineY; 
    807840                UniCharArrayOffset breaks[2] = {thisBreak, thisBreak + lineLen}; 
    808                 GetTypographicRectangleForLayout(layout, breaks, 0, &lineX, &lineY, &lineHeight, &lineWidth); 
     841                GetTypographicRectangleForLayout(layout, breaks, 0, FloatToFixed(spanEx->outlineRadius), &lineX, &lineY, &lineHeight, &lineWidth); 
    809842                 
    810843                CGRect borderRect = CGRectMake(FixedToFloat(lineX + penX), FixedToFloat(penY - lineY), FixedToFloat(lineWidth), FixedToFloat(lineHeight)); 
     
    867900                                                                                                                 (textType == kTextLayerShadow) ? (penY - FloatToFixed(spanEx->shadowDist)) : penY, c, div, spanEx, textType); 
    868901                                extraHeight = MAX(extraHeight, spanEx->outlineRadius); 
     902                                lastSpanEx = spanEx; 
    869903                        } 
    870904                 
     
    954988                ATSUTextMeasurement imageWidth, imageHeight; 
    955989 
    956                 if (div->posX != -1 || div->alignV == kSubAlignmentMiddle) GetTypographicRectangleForLayout(layout, breaks, breakCount, NULL, NULL, &imageHeight, &imageWidth); 
     990                if (div->posX != -1 || div->alignV == kSubAlignmentMiddle) GetTypographicRectangleForLayout(layout, breaks, breakCount, FloatToFixed(div->styleLine->outlineRadius), NULL, NULL, &imageHeight, &imageWidth); 
    957991 
    958992                if (div->posX == -1) { 
     
    9741008                                        } else penY = centerPen; 
    9751009                                         
    976                                         storePen = &centerPen; breakc.lStart = 0; breakc.lEnd = breakCount+1; breakc.direction = -1; 
     1010                                        storePen = &centerPen; breakc.lStart = breakCount; breakc.lEnd = -1; breakc.direction = 1; 
    9771011                                        break; 
    9781012                                case kSubAlignmentTop: 
     
    9841018                                        break; 
    9851019                        } 
    986                 } else {                                                 
     1020                } else { 
     1021                        ATSUTextMeasurement descent; 
    9871022                        penX = FloatToFixed(div->posX * screenScaleX); 
    9881023                        penY = FloatToFixed((context->resY - div->posY) * screenScaleY); 
     
    9931028                        } 
    9941029                         
     1030                        ATSUGetLineControl(layout, kATSUFromTextBeginning, kATSULineDescentTag, sizeof(ATSUTextMeasurement), &descent, NULL); 
     1031 
    9951032                        switch (div->alignV) { 
    9961033                                case kSubAlignmentMiddle: penY -= imageHeight / 2; break; 
    997                                 case kSubAlignmentTop: penY -= imageHeight; 
    998                         } 
    999                                                  
     1034                                case kSubAlignmentTop: penY -= imageHeight; break; 
     1035                        } 
     1036                         
     1037                        penY += descent; 
     1038 
    10001039                        SetLayoutPositioning(layout, imageWidth, div->alignH); 
    10011040                        storePen = NULL; breakc.lStart = breakCount; breakc.lEnd = -1; breakc.direction = 1; 
     
    10231062} 
    10241063 
    1025 extern SubtitleRendererPtr SubInitForSSA(char *header, size_t headerLen, int width, int height) 
    1026 
     1064SubtitleRendererPtr SubInitForSSA(char *header, size_t headerLen, int width, int height) 
     1065
     1066        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 
    10271067        NSString *hdr = [[NSString alloc] initWithBytesNoCopy:(void*)header length:headerLen encoding:NSUTF8StringEncoding freeWhenDone:NO]; 
    10281068 
    10291069        SubtitleRendererPtr s = [[SubATSUIRenderer alloc] initWithSSAHeader:hdr videoWidth:width videoHeight:height]; 
    10301070        [hdr release]; 
     1071        CFRetain(s); 
     1072        [pool release]; 
    10311073        return s; 
    10321074} 
    10331075 
    1034 extern SubtitleRendererPtr SubInitNonSSA(int width, int height) 
    1035 
    1036         return [[SubATSUIRenderer alloc] initWithVideoWidth:width videoHeight:height]; 
    1037 
    1038  
    1039 extern CGColorSpaceRef SubGetColorSpace(SubtitleRendererPtr s) 
     1076SubtitleRendererPtr SubInitNonSSA(int width, int height) 
     1077
     1078        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 
     1079        SubtitleRendererPtr s = [[SubATSUIRenderer alloc] initWithVideoWidth:width videoHeight:height]; 
     1080        CFRetain(s); 
     1081        [pool release]; 
     1082        return s; 
     1083
     1084 
     1085CGColorSpaceRef SubGetColorSpace(SubtitleRendererPtr s) 
    10401086{ 
    10411087        return s->srgbCSpace; 
    10421088} 
    10431089 
    1044 extern void SubRenderPacket(SubtitleRendererPtr s, CGContextRef c, CFStringRef str, int cWidth, int cHeight) 
     1090void SubRenderPacket(SubtitleRendererPtr s, CGContextRef c, CFStringRef str, int cWidth, int cHeight) 
    10451091{ 
    10461092        [s renderPacket:(NSString*)str inContext:c width:cWidth height:cHeight]; 
    10471093} 
    10481094 
    1049 extern void SubDisposeRenderer(SubtitleRendererPtr s) 
    1050 
     1095void SubDisposeRenderer(SubtitleRendererPtr s) 
     1096
     1097        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 
     1098        CFRelease(s); 
    10511099        [s release]; 
     1100        [pool release]; 
    10521101} 
    10531102@end 
  • trunk/Subtitles/SubContext.h

    r695 r806  
    3030        BOOL bold, italic, underline, strikeout; 
    3131        UInt8 alignH, alignV, borderStyle; 
    32         void* ex; 
     32        __strong void* ex; 
    3333        Float32 platformSizeScale; 
    3434        SubRenderer *delegate; 
  • trunk/Subtitles/SubContext.m

    r729 r806  
    5252{ 
    5353        switch (a) { 
    54                 case 1 ... 3: *alignV = kSubAlignmentBottom; break; 
     54                default: case 1 ... 3: *alignV = kSubAlignmentBottom; break; 
    5555                case 4 ... 6: *alignV = kSubAlignmentMiddle; break; 
    5656                case 7 ... 9: *alignV = kSubAlignmentTop; break; 
     
    5959        switch (a) { 
    6060                case 1: case 4: case 7: *alignH = kSubAlignmentLeft; break; 
    61                 case 2: case 5: case 8: *alignH = kSubAlignmentCenter; break; 
     61                default: case 2: case 5: case 8: *alignH = kSubAlignmentCenter; break; 
    6262                case 3: case 6: case 9: *alignH = kSubAlignmentRight; break; 
    6363        } 
     
    8484        sty->alignH = kSubAlignmentCenter; 
    8585        sty->alignV = kSubAlignmentBottom; 
    86         sty->borderStyle = 0
     86        sty->borderStyle = kSubBorderStyleNormal
    8787        sty->ex = [delegate completedStyleParsing:sty]; 
    8888        sty->delegate = delegate; 
     
    9696                delegate = delegate_; 
    9797                                 
    98 #define sv(fn, n) fn = [s objectForKey: @""#n] 
     98#define sv(fn, n) fn = [[s objectForKey: @""#n] retain] 
    9999#define fv(fn, n) fn = [[s objectForKey:@""#n] floatValue] 
    100100#define iv(fn, n) fn = [[s objectForKey:@""#n] intValue] 
     
    175175         
    176176        // obscure res rules copied from VSFilter 
    177         if (!resXS && !resYS) { 
     177        if ((!resXS && !resYS) || (!resX && !resY)) { 
    178178                resX = 384; resY = 288; 
    179179        } else if (!resYS) { 
     
    200200                        for (i=0; i < nstyles; i++) { 
    201201                                NSDictionary *style = [styles_ objectAtIndex:i]; 
    202                                 [sdict setObject:[[SubStyle alloc] initWithDictionary:style scriptVersion:scriptType delegate:delegate] 
     202                                [sdict setObject:[[[SubStyle alloc] initWithDictionary:style scriptVersion:scriptType delegate:delegate] autorelease] 
    203203                                                                                                forKey:[style objectForKey:@"Name"]]; 
    204204                        } 
  • trunk/Subtitles/SubImport.h

    r674 r806  
    1212#include <QuickTime/QuickTime.h> 
    1313 
     14#ifndef __OBJC_GC__ 
     15#ifndef __strong 
     16#define __strong 
     17#endif 
     18#endif 
     19 
    1420#ifdef __cplusplus 
    1521extern "C" 
     
    1925short GetFilenameLanguage(CFStringRef filename); 
    2026ComponentResult LoadExternalSubtitles(const FSRef *theFile, Movie theMovie); 
     27ComponentResult LoadExternalSubtitlesFromFileDataRef(Handle dataRef, OSType dataRefType, Movie theMovie); 
    2128Track CreatePlaintextSubTrack(Movie theMovie, ImageDescriptionHandle imgDesc, TimeScale timescale, Handle dataRef, OSType dataRefType, FourCharCode subType, Handle imageExtension, Rect movieBox); 
    2229 
     
    5764class CXXSubSerializer 
    5865{ 
    59         void *priv; 
     66        __strong void *priv; 
    6067         
    6168public: 
     
    7380class CXXAutoreleasePool 
    7481{ 
    75         void *pool; 
     82        __strong void *pool; 
    7683public: 
    7784        CXXAutoreleasePool(); 
  • trunk/Subtitles/SubImport.mm

    r685 r806  
    315315         
    316316bail: 
     317        [ss release]; 
    317318        [pool release]; 
    318319         
     
    443444} 
    444445 
     446ComponentResult LoadExternalSubtitlesFromFileDataRef(Handle dataRef, OSType dataRefType, Movie theMovie) 
     447{ 
     448        if (dataRefType != AliasDataHandlerSubType) return noErr; 
     449         
     450        CFStringRef cfPath; 
     451        FSRef ref; 
     452        uint8_t path[PATH_MAX]; 
     453         
     454        QTGetDataReferenceFullPathCFString(dataRef, dataRefType, kQTPOSIXPathStyle, &cfPath); 
     455        CFStringGetCString(cfPath, (char*)path, PATH_MAX, kCFStringEncodingUTF8); 
     456        FSPathMakeRef(path, &ref, NULL); 
     457        CFRelease(cfPath); 
     458         
     459        return LoadExternalSubtitles(&ref, theMovie); 
     460} 
     461 
    445462#pragma mark Obj-C Classes 
    446463 
  • trunk/Subtitles/SubParsing.h

    r697 r806  
    3737        @public; 
    3838        UniCharArrayOffset offset; 
    39         void *ex; 
     39        __strong void *ex; 
    4040        SubRenderer *delegate; 
    4141} 
  • trunk/Subtitles/SubParsing.m.rl

    r731 r806  
    4848{ 
    4949        int i, sc = [spans count]; 
    50         NSMutableString *tmp = [NSMutableString stringWithFormat:@"div %d spans:",sc]; 
     50        NSMutableString *tmp = [NSMutableString stringWithFormat:@"div \"%@\" with %d spans:", text, sc]; 
    5151        for (i = 0; i < sc; i++) {[tmp appendFormat:@" %d",((SubRenderSpan*)[spans objectAtIndex:i])->offset];} 
    5252        [tmp appendFormat:@" %d", [text length]]; 
  • trunk/Subtitles/SubRenderer.h

    r675 r806  
    1515          tag_alpha, tag_1a, tag_2a, tag_3a, tag_4a, tag_r} SSATagType; 
    1616 
     17#ifndef __OBJC_GC__ 
     18#ifndef __strong 
     19#define __strong 
     20#endif 
     21#endif 
     22 
    1723@interface SubRenderer : NSObject 
    1824-(void)completedHeaderParsing:(SubContext*)sc; 
  • trunk/TextSubCodec.c

    r794 r806  
    233233        glob->ssa = NULL; 
    234234         
    235         return noErr; 
    236 } 
    237  
    238 // ImageCodecBeginBand 
    239 //              The ImageCodecBeginBand function allows your image decompressor component to save information about 
    240 // a band before decompressing it. This function is never called at interrupt time. The base image decompressor 
    241 // preserves any changes your component makes to any of the fields in the ImageSubCodecDecompressRecord 
    242 // or CodecDecompressParams structures. If your component supports asynchronous scheduled decompression, it 
    243 // may receive more than one ImageCodecBeginBand call before receiving an ImageCodecDrawBand call. 
    244 pascal ComponentResult TextSubCodecBeginBand(TextSubGlobals glob, CodecDecompressParams *p, ImageSubCodecDecompressRecord *drp, long flags) 
    245 { 
    246         long offsetH, offsetV; 
    247         TextSubDecompressRecord *myDrp = (TextSubDecompressRecord *)drp->userDecompressRecord; 
    248  
    249         offsetH = (long)(p->dstRect.left - p->dstPixMap.bounds.left) * (long)(p->dstPixMap.pixelSize >> 3); 
    250         offsetV = (long)(p->dstRect.top - p->dstPixMap.bounds.top) * (long)drp->rowBytes; 
    251  
    252         drp->baseAddr = p->dstPixMap.baseAddr + offsetH + offsetV; 
    253          
    254         // Let base codec know that all our frames are key frames (a.k.a., sync samples) 
    255         // This allows the base codec to perform frame dropping on our behalf if needed  
    256     drp->frameType = kCodecFrameTypeKey; 
    257  
    258         myDrp->width = p->dstRect.right - p->dstRect.left; 
    259         myDrp->height = p->dstRect.bottom - p->dstRect.top; 
    260         myDrp->depth = (**p->imageDescription).depth; 
    261     myDrp->dataSize = p->bufferSize; 
    262          
    263235        if (!glob->ssa) { 
    264236                if ((**p->imageDescription).cType == kSubFormatSSA) { 
     
    271243                                GetImageDescriptionExtension(p->imageDescription,&ssaheader,kSubFormatSSA,1); 
    272244                                 
    273                                 glob->ssa = SubInitForSSA(*ssaheader, GetHandleSize(ssaheader), myDrp->width, myDrp->height); 
     245                                glob->ssa = SubInitForSSA(*ssaheader, GetHandleSize(ssaheader), (**p->imageDescription).width, (**p->imageDescription).height); 
    274246                        }  
    275247                }  
    276248                 
    277                 if (!glob->ssa) glob->ssa = SubInitNonSSA(myDrp->width,myDrp->height); 
     249                if (!glob->ssa) glob->ssa = SubInitNonSSA((**p->imageDescription).width,(**p->imageDescription).height); 
    278250                 
    279251                //SSA_PrerollFonts(glob->ssa); 
     
    281253                glob->colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); 
    282254        } 
     255         
     256        return noErr; 
     257} 
     258 
     259// ImageCodecBeginBand 
     260//              The ImageCodecBeginBand function allows your image decompressor component to save information about 
     261// a band before decompressing it. This function is never called at interrupt time. The base image decompressor 
     262// preserves any changes your component makes to any of the fields in the ImageSubCodecDecompressRecord 
     263// or CodecDecompressParams structures. If your component supports asynchronous scheduled decompression, it 
     264// may receive more than one ImageCodecBeginBand call before receiving an ImageCodecDrawBand call. 
     265pascal ComponentResult TextSubCodecBeginBand(TextSubGlobals glob, CodecDecompressParams *p, ImageSubCodecDecompressRecord *drp, long flags) 
     266{ 
     267        long offsetH, offsetV; 
     268        TextSubDecompressRecord *myDrp = (TextSubDecompressRecord *)drp->userDecompressRecord; 
     269 
     270        offsetH = (long)(p->dstRect.left - p->dstPixMap.bounds.left) * (long)(p->dstPixMap.pixelSize >> 3); 
     271        offsetV = (long)(p->dstRect.top - p->dstPixMap.bounds.top) * (long)drp->rowBytes; 
     272 
     273        drp->baseAddr = p->dstPixMap.baseAddr + offsetH + offsetV; 
     274         
     275        // Let base codec know that all our frames are key frames (a.k.a., sync samples) 
     276        // This allows the base codec to perform frame dropping on our behalf if needed  
     277    drp->frameType = kCodecFrameTypeKey; 
     278 
     279        myDrp->width = p->dstRect.right - p->dstRect.left; 
     280        myDrp->height = p->dstRect.bottom - p->dstRect.top; 
     281        myDrp->depth = (**p->imageDescription).depth; 
     282    myDrp->dataSize = p->bufferSize; 
    283283         
    284284        return noErr; 
  • trunk/TextSubCodec.r

    r794 r806  
    5959// These flags specify information about the capabilities of the component 
    6060// Works with 1-bit, 8-bit, 16-bit and 32-bit Pixel Maps 
    61 #define kTextSubDecoFlags ( codecInfoDoes32 | codecInfoDoes16 | codecInfoDoes8 | codecInfoDoes1 | codecInfoDoesSpool | cmpThreadSafe | codecInfoDoesStretch | codecInfoDoesShrink) 
     61#define kTextSubDecoFlags ( codecInfoDoes32 | codecInfoDoes16 | codecInfoDoes8 | codecInfoDoes1 | cmpThreadSafe | codecInfoDoesStretch | codecInfoDoesShrink) 
    6262 
    6363// These flags specify the possible format of compressed data produced by the component 
  • trunk/UniversalDetector/UniversalDetector.xcodeproj/project.pbxproj

    r729 r806  
    668668                        isa = XCBuildConfiguration; 
    669669                        buildSettings = { 
     670                                GCC_ENABLE_OBJC_GC = YES; 
    670671                                GCC_WARN_ABOUT_RETURN_TYPE = YES; 
    671672                                GCC_WARN_UNUSED_VARIABLE = YES; 
  • trunk/VobSubCodec.r

    r794 r806  
    6060// These flags specify information about the capabilities of the component 
    6161// Works with 1-bit, 8-bit, 16-bit and 32-bit Pixel Maps 
    62 #define kVobSubDecoFlags ( codecInfoDoes32 | codecInfoDoes16 | codecInfoDoes8 | codecInfoDoes1 | codecInfoDoesSpool | cmpThreadSafe ) 
     62#define kVobSubDecoFlags ( codecInfoDoes32 | codecInfoDoes16 | codecInfoDoes8 | codecInfoDoes1 | cmpThreadSafe ) 
    6363 
    6464// These flags specify the possible format of compressed data produced by the component 
  • trunk/bitstream_info.c

    r719 r806  
    1212#include <AudioToolbox/AudioToolbox.h> 
    1313#include <QuickTime/QuickTime.h> 
     14#include "CodecIDs.h" 
    1415 
    1516#import "ac3tab.h" 
     
    128129        memset(asbd, 0, sizeof(AudioStreamBasicDescription)); 
    129130        asbd->mSampleRate = sample_rate >> shift; 
    130         asbd->mFormatID = kAudioFormatAC3
     131        asbd->mFormatID = kAudioFormatAC3MS
    131132        asbd->mFramesPerPacket = 1; 
    132133        asbd->mChannelsPerFrame = nfchans_tbl[acmod] + lfe; 
     
    249250        int num_ref_frames_in_pic_order_cnt_cycle; 
    250251        int sum_of_offset_for_ref_frames; 
     252         
     253        int chroma_format_idc; 
    251254}H264ParserContext; 
    252255 
     
    330333        if(profile_idc >= 100) 
    331334        { 
     335                context->chroma_format_idc = get_ue_golomb(gb); 
    332336                //high profile 
    333                 if(get_ue_golomb(gb) == 3)    //chroma_format_idc 
     337                if(context->chroma_format_idc == 3)   //chroma_format_idc 
    334338                        get_bits1(gb);                  //residual_color_transfrom_flag 
    335339                get_ue_golomb(gb);                      //bit_depth_luma_minus8 
     
    353357                for(i=0; i<context->num_ref_frames_in_pic_order_cnt_cycle; i++) 
    354358                        context->sum_of_offset_for_ref_frames += get_se_golomb(gb); //offset_for_ref_frame[i] 
    355                get_ue_golomb(gb);      //num_ref_frames 
    356                get_bits1(gb);          //gaps_in_frame_num_value_allowed_flag 
    357                get_ue_golomb(gb);      //pic_width_in_mbs_minus1 
    358                get_ue_golomb(gb);      //pic_height_in_map_units_minus1 
    359                context->frame_mbs_only_flag = get_bits1(gb); 
    360         } 
     359        } 
     360        get_ue_golomb(gb);     //num_ref_frames 
     361        get_bits1(gb);         //gaps_in_frame_num_value_allowed_flag 
     362        get_ue_golomb(gb);     //pic_width_in_mbs_minus1 
     363        get_ue_golomb(gb);     //pic_height_in_map_units_minus1 
     364        context->frame_mbs_only_flag = get_bits1(gb); 
    361365} 
    362366 
     
    525529                        start_offset = buf_index + 1; 
    526530                        //do start code prefix search 
    527                         for(; buf_index < buf_size; buf_index++) 
     531                        for(buf_index++; buf_index < buf_size; buf_index++) 
    528532                        { 
    529533                                if(buf[buf_index] == 0) 
     
    732736                av_free(parser->avctx); 
    733737        if(parser->internalContext) 
    734                 free(parser->internalContext); 
     738                av_free(parser->internalContext); 
    735739        free(parser); 
    736740} 
     
    783787        parserContext->parserStructure = ffParser; 
    784788        if(ffParser->internalContextSize) 
    785                 parserContext->internalContext = malloc(ffParser->internalContextSize); 
     789                parserContext->internalContext = av_mallocz(ffParser->internalContextSize); 
    786790        else 
    787791                parserContext->internalContext = NULL; 
     
    819823        return 0; 
    820824} 
     825 
     826int ffusionIsParsedVideoDecodable(FFusionParserContext *parser) 
     827{ 
     828        if (parser->parserStructure == &ffusionH264Parser) { 
     829                H264ParserContext *h264parser = parser->internalContext; 
     830                 
     831                // don't try to decode interlaced or 4:2:2 H.264 
     832                return (h264parser->frame_mbs_only_flag == 1) && (h264parser->chroma_format_idc <= 1); 
     833        } 
     834         
     835        return 1; 
     836} 
  • trunk/bitstream_info.h

    r588 r806  
    4343int ffusionParseExtraData(FFusionParserContext *parser, const uint8_t *buf, int buf_size); 
    4444int ffusionParse(FFusionParserContext *parser, const uint8_t *buf, int buf_size, int *out_buf_size, int *type, int *skippable); 
     45int ffusionIsParsedVideoDecodable(FFusionParserContext *parser); 
    4546 
    4647#ifdef __cplusplus 
  • trunk/createStaticLibs.sh

    r733 r806  
    5454    exit 0 
    5555fi 
     56 
     57if [ -e ffmpeg/patched ] ; then 
     58        (cd ffmpeg && svn revert -R . && rm patched) 
     59fi 
     60 
     61(cd ffmpeg; patch -p1 < ../Patches/ffmpeg.diff) 
    5662 
    5763if [ "$buildid_ffmpeg" = "$oldbuildid_ffmpeg" ] ; then 
  • trunk/ff_MovieImport.c

    r708 r806  
    322322                } else if (tag == 'strh'){ 
    323323                        // 4-byte offset to the fourcc 
    324                         url_fskip(pb, 4); 
    325                         return get_be32(pb); 
     324                        OSType tag1 = get_be32(pb); 
     325                        if(tag1 == 'iavs' || tag1 == 'ivas') 
     326                                return get_be32(pb); 
     327                        else 
     328                                url_fskip(pb, size + (size & 1) - 4); 
    326329                } else 
    327330                        url_fskip(pb, size + (size & 1)); 
     
    336339        uint8_t buf[PROBE_BUF_SIZE]; 
    337340        AVProbeData *pd = (AVProbeData *)malloc(sizeof(AVProbeData)); 
    338         ByteIOContext byteContext; 
     341        ByteIOContext *byteContext; 
    339342 
    340343        /* default */ 
     
    361364                if (IS_AVI(storage->componentType)) { 
    362365                        /* Prepare the iocontext structure */ 
    363                         memset(&byteContext, 0, sizeof(byteContext)); 
    364366                        result = url_open_dataref(&byteContext, dataRef, dataRefType, NULL, NULL, NULL); 
    365367                        require_noerr(result, bail); 
    366368                         
    367                         OSType fourcc = get_avi_strf_fourcc(&byteContext); 
     369                        OSType fourcc = get_avi_strf_fourcc(byteContext); 
    368370                        enum CodecID id = codec_get_id(codec_bmp_tags, BSWAP(fourcc)); 
    369371                         
    370                         if (id == CODEC_ID_MJPEG || id == CODEC_ID_DVVIDEO || id == CODEC_ID_RAWVIDEO || id == CODEC_ID_NONE
     372                        if (id == CODEC_ID_MJPEG || id == CODEC_ID_DVVIDEO || id == CODEC_ID_RAWVIDEO || id == CODEC_ID_NONE || id == CODEC_ID_MSVIDEO1
    371373                                *valid = 0; 
    372374                         
    373                         url_fclose(&byteContext); 
     375                        url_fclose(byteContext); 
    374376                } 
    375377        } 
     
    403405        result = FSpMakeFSRef(theFile, &theFileFSRef); 
    404406        require_noerr(result, bail); 
    405          
    406         LoadExternalSubtitles(&theFileFSRef, theMovie); 
    407          
     407                 
    408408bail: 
    409409                if(dataRef) 
     
    417417{ 
    418418        ComponentResult result = noErr; 
    419         ByteIOContext byteContext; 
     419        ByteIOContext *byteContext; 
    420420        AVFormatContext *ic = NULL; 
    421421        AVFormatParameters params; 
     
    432432        if(valid != 255) 
    433433                goto bail; 
    434                  
     434                        
    435435        /* Prepare the iocontext structure */ 
    436         memset(&byteContext, 0, sizeof(byteContext)); 
    437436        result = url_open_dataref(&byteContext, dataRef, dataRefType, &storage->dataHandler, &storage->dataHandlerSupportsWideOffsets, &storage->dataSize); 
    438437        storage->isStreamed = dataRefType == URLDataHandlerSubType; 
     
    441440        /* Open the Format Context */ 
    442441        memset(&params, 0, sizeof(params)); 
    443         result = av_open_input_stream(&ic, &byteContext, "", storage->format, &params); 
     442        result = av_open_input_stream(&ic, byteContext, "", storage->format, &params); 
    444443        require_noerr(result,bail); 
    445444        storage->format_context = ic; 
     
    547546        } 
    548547         
     548        LoadExternalSubtitlesFromFileDataRef(dataRef, dataRefType, theMovie); 
     549 
    549550bail: 
    550551        if(result == noErr) 
     
    552553        else 
    553554                storage->movieLoadState == kMovieLoadStateError; 
    554          
     555                
    555556        return result; 
    556557} /* FFAvi_MovieImportDataRef */ 
  • trunk/ff_MovieImportVersion.h

    r708 r806  
    2424#define __FF_MOVIEIMPORTVERSION__ 
    2525 
    26 #define kFFAviComponentVersion 0x00010002 
     26#define kFFAviComponentVersion 0x00010003 
    2727 
    28 #define kChristophManufacturer 'Rafz
     28#define kChristophManufacturer 'Peri
    2929 
    3030#define kAVIthngResID 512 
  • trunk/ff_dataref.c

    r703 r806  
    199199 
    200200/* This is the public function to open bytecontext withs datarefs */ 
    201 OSStatus url_open_dataref(ByteIOContext *pb, Handle dataRef, OSType dataRefType, DataHandler *dataHandler, Boolean *wideSupport, int64_t *dataSize) 
     201OSStatus url_open_dataref(ByteIOContext **pb, Handle dataRef, OSType dataRefType, DataHandler *dataHandler, Boolean *wideSupport, int64_t *dataSize) 
    202202{ 
    203203        URLContext *uc; 
     
    217217                return err; 
    218218        } 
    219         uc->filename[0] = '\0'
     219        uc->filename = NULL
    220220        uc->prot = up; 
    221221        uc->flags = URL_RDONLY; // we're just using the read access... 
  • trunk/ff_private.c

    r716 r806  
    320320                        break; 
    321321                case CODEC_ID_AC3: 
    322                         asbd->mFormatID = kAudioFormatAC3
     322                        asbd->mFormatID = kAudioFormatAC3MS
    323323                        map->vbr = 1; 
    324324                        break; 
     
    606606                if(result < 0) goto bail; 
    607607                 
    608                 av_read_frame(formatContext, &packet); 
     608                result = av_read_frame(formatContext, &packet); 
     609                if(result < 0) goto bail; 
    609610                st = formatContext->streams[packet.stream_index]; 
    610611                 
  • trunk/ff_private.h

    r716 r806  
    9393 
    9494/* Public interface of the DataRef interface */ 
    95 OSStatus url_open_dataref(ByteIOContext *pb, Handle dataRef, OSType dataRefType, DataHandler *dataHandler, Boolean *wideSupport, int64_t *dataSize); 
     95OSStatus url_open_dataref(ByteIOContext **pb, Handle dataRef, OSType dataRefType, DataHandler *dataHandler, Boolean *wideSupport, int64_t *dataSize); 
    9696 
    9797/* Import routines */ 
  • trunk/ffmpeg-patch

    r721 r806  
    1 Index: libavcodec/i386/motion_est_mmx.c 
    2 =================================================================== 
    3 --- libavcodec/i386/motion_est_mmx.c    (revision 10865) 
    4 +++ libavcodec/i386/motion_est_mmx.c    (working copy) 
    5 @@ -167,7 +167,7 @@ 
    6  static inline void sad8_4_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h) 
     1diff -ru ffmpeg/libavcodec/dsputil.c ffmpeg-/libavcodec/dsputil.c 
     2--- ffmpeg/libavcodec/dsputil.c 2008-01-20 15:05:32.000000000 -0500 
     3+++ ffmpeg-/libavcodec/dsputil.c        2008-01-20 17:09:12.000000000 -0500 
     4@@ -1440,6 +1440,7 @@ 
     5     \ 
     6     assert(x<8 && y<8 && x>=0 && y>=0);\ 
     7 \ 
     8+    if(D){\ 
     9     for(i=0; i<h; i++)\ 
     10     {\ 
     11         OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\ 
     12@@ -1447,9 +1448,20 @@ 
     13         dst+= stride;\ 
     14         src+= stride;\ 
     15     }\ 
     16+    }else{\ 
     17+        const int E= B+C;\ 
     18+        const int step= C ? stride : 1;\ 
     19+        for(i=0; i<h; i++)\ 
     20+        {\ 
     21+            OP(dst[0], (A*src[0] + E*src[step+0]));\ 
     22+            OP(dst[1], (A*src[1] + E*src[step+1]));\ 
     23+            dst+= stride;\ 
     24+            src+= stride;\ 
     25+        }\ 
     26+    }\ 
     27 }\ 
     28 \ 
     29-static void OPNAME ## h264_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\ 
     30+void OPNAME ## h264_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\ 
     31     const int A=(8-x)*(8-y);\ 
     32     const int B=(  x)*(8-y);\ 
     33     const int C=(8-x)*(  y);\ 
     34@@ -1458,6 +1470,7 @@ 
     35     \ 
     36     assert(x<8 && y<8 && x>=0 && y>=0);\ 
     37 \ 
     38+    if(D){\ 
     39     for(i=0; i<h; i++)\ 
     40     {\ 
     41         OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\ 
     42@@ -1467,6 +1480,19 @@ 
     43         dst+= stride;\ 
     44         src+= stride;\ 
     45     }\ 
     46+    }else{\ 
     47+        const int E= B+C;\ 
     48+        const int step= C ? stride : 1;\ 
     49+        for(i=0; i<h; i++)\ 
     50+        {\ 
     51+            OP(dst[0], (A*src[0] + E*src[step+0]));\ 
     52+            OP(dst[1], (A*src[1] + E*src[step+1]));\ 
     53+            OP(dst[2], (A*src[2] + E*src[step+2]));\ 
     54+            OP(dst[3], (A*src[3] + E*src[step+3]));\ 
     55+            dst+= stride;\ 
     56+            src+= stride;\ 
     57+        }\ 
     58+    }\ 
     59 }\ 
     60 \ 
     61 static void OPNAME ## h264_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\ 
     62@@ -1478,6 +1504,7 @@ 
     63     \ 
     64     assert(x<8 && y<8 && x>=0 && y>=0);\ 
     65 \ 
     66+    if(D){\ 
     67     for(i=0; i<h; i++)\ 
     68     {\ 
     69         OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\ 
     70@@ -1491,6 +1518,23 @@ 
     71         dst+= stride;\ 
     72         src+= stride;\ 
     73     }\ 
     74+    }else{\ 
     75+        const int E= B+C;\ 
     76+        const int step= C ? stride : 1;\ 
     77+        for(i=0; i<h; i++)\ 
     78+        {\ 
     79+            OP(dst[0], (A*src[0] + E*src[step+0]));\ 
     80+            OP(dst[1], (A*src[1] + E*src[step+1]));\ 
     81+            OP(dst[2], (A*src[2] + E*src[step+2]));\ 
     82+            OP(dst[3], (A*src[3] + E*src[step+3]));\ 
     83+            OP(dst[4], (A*src[4] + E*src[step+4]));\ 
     84+            OP(dst[5], (A*src[5] + E*src[step+5]));\ 
     85+            OP(dst[6], (A*src[6] + E*src[step+6]));\ 
     86+            OP(dst[7], (A*src[7] + E*src[step+7]));\ 
     87+            dst+= stride;\ 
     88+            src+= stride;\ 
     89+        }\ 
     90+    }\ 
     91 } 
     92  
     93 #define op_avg(a, b) a = (((a)+(((b) + 32)>>6)+1)>>1) 
     94diff -ru ffmpeg/libavcodec/i386/dsputil_h264_template_mmx.c ffmpeg-/libavcodec/i386/dsputil_h264_template_mmx.c 
     95--- ffmpeg/libavcodec/i386/dsputil_h264_template_mmx.c  2008-01-20 15:05:31.000000000 -0500 
     96+++ ffmpeg-/libavcodec/i386/dsputil_h264_template_mmx.c 2008-01-20 17:08:31.000000000 -0500 
     97@@ -182,14 +182,26 @@ 
     98     } 
     99 } 
     100  
     101+extern void put_h264_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y); 
     102+extern void avg_h264_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y); 
     103
     104 static void H264_CHROMA_MC4_TMPL(uint8_t *dst/*align 4*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y) 
    7105 { 
     106+       if (!(x*y)) { 
     107+#if H264_CHROMA_MC4_TMPL == put_h264_chroma_mc4_mmx 
     108+               put_h264_chroma_mc4_c(dst,src,stride,h,x,y); 
     109+#else 
     110+               avg_h264_chroma_mc4_c(dst,src,stride,h,x,y); 
     111+#endif 
     112+               return; 
     113+       } 
     114+        
    8115     asm volatile( 
    9 -        "movq "MANGLE(bone)", %%mm5     \n\t" 
    10 +        "movq %4, %%mm5     \n\t" 
    11          "movq (%1), %%mm0               \n\t" 
    12          "pavgb 1(%1), %%mm0             \n\t" 
    13          "add %3, %1                     \n\t" 
    14 @@ -190,7 +190,7 @@ 
    15          "sub $2, %0                     \n\t" 
    16          " jg 1b                         \n\t" 
    17          : "+r" (h), "+r" (blk1), "+r" (blk2) 
    18 -        : "r" ((long)stride) 
    19 +        : "r" ((long)stride), "m" (bone) 
    20      ); 
    21  } 
    22   
    23 @@ -258,7 +258,7 @@ 
    24          "punpckhbw %%mm7, %%mm5         \n\t" 
    25          "paddw %%mm4, %%mm2             \n\t" 
    26          "paddw %%mm5, %%mm3             \n\t" 
    27 -        "movq 16+"MANGLE(round_tab)", %%mm5 \n\t" 
    28 +        "movq 16+%5, %%mm5 \n\t" 
    29          "paddw %%mm2, %%mm0             \n\t" 
    30          "paddw %%mm3, %%mm1             \n\t" 
    31          "paddw %%mm5, %%mm0             \n\t" 
    32 @@ -281,7 +281,7 @@ 
    33          "add %4, %%"REG_a"              \n\t" 
    34          " js 1b                         \n\t" 
    35          : "+a" (len) 
    36 -        : "r" (blk1 - len), "r" (blk1 -len + stride), "r" (blk2 - len), "r" ((long)stride) 
    37 +        : "r" (blk1 - len), "r" (blk1 -len + stride), "r" (blk2 - len), "r" ((long)stride), "m" (round_tab[0]) 
    38      ); 
    39  } 
    40   
    41 Index: libavcodec/i386/dsputil_h264_template_mmx.c 
    42 =================================================================== 
    43 --- libavcodec/i386/dsputil_h264_template_mmx.c (revision 10865) 
    44 +++ libavcodec/i386/dsputil_h264_template_mmx.c (working copy) 
    45 @@ -188,8 +188,8 @@ 
    46116         "pxor   %%mm7, %%mm7        \n\t" 
    47117         "movd %5, %%mm2             \n\t" 
     
    54124         "punpcklwd %%mm3, %%mm3     \n\t" 
    55125         "punpcklwd %%mm2, %%mm2     \n\t" 
    56 @@ -246,7 +246,7 @@ 
     126@@ -246,7 +258,7 @@ 
    57127         "sub $2, %2                 \n\t" 
    58128         "jnz 1b                     \n\t" 
     
    63133 } 
    64134  
    65 Index: libavcodec/i386/dsputil_mmx.c 
    66 =================================================================== 
    67 --- libavcodec/i386/dsputil_mmx.c       (revision 10865) 
    68 +++ libavcodec/i386/dsputil_mmx.c       (working copy) 
    69 @@ -1917,7 +1917,7 @@ 
     135diff -ru ffmpeg/libavcodec/i386/dsputil_mmx.c ffmpeg-/libavcodec/i386/dsputil_mmx.c 
     136--- ffmpeg/libavcodec/i386/dsputil_mmx.c        2008-01-20 15:05:31.000000000 -0500 
     137+++ ffmpeg-/libavcodec/i386/dsputil_mmx.c       2008-01-20 17:03:15.000000000 -0500 
     138@@ -1918,7 +1918,7 @@ 
    70139  
    71140 #define QPEL_V_LOW(m3,m4,m5,m6, pw_20, pw_3, rnd, in0, in1, in2, in7, out, OP)\ 
     
    76145         "movq "#in7", " #m3 "             \n\t" /* d */\ 
    77146         "movq "#in0", %%mm5               \n\t" /* D */\ 
    78 @@ -1929,7 +1929,7 @@ 
     147@@ -1930,7 +1930,7 @@ 
    79148         "paddw " #m5 ", %%mm6             \n\t" /* x2 */\ 
    80149         "paddw %%mm6, %%mm6               \n\t" /* 2x2 */\ 
     
    85154         "paddw %%mm4, %%mm5               \n\t" /* 20x1 - 6x2 + 3x3 - x4 */\ 
    86155         "psraw $5, %%mm5                  \n\t"\ 
    87 @@ -1963,10 +1963,10 @@ 
     156@@ -1964,10 +1964,10 @@ 
    88157         "paddw %%mm5, %%mm5               \n\t" /* 2b */\ 
    89158         "psubw %%mm5, %%mm6               \n\t" /* c - 2b */\ 
     
    98167         "paddw %6, %%mm6                  \n\t"\ 
    99168         "paddw %%mm6, %%mm0               \n\t" /* 20a - 6b + 3c - d */\ 
    100 @@ -1989,10 +1989,10 @@ 
     169@@ -1990,10 +1990,10 @@ 
    101170         "psrlq $24, %%mm6                 \n\t" /* IJKLM000 */\ 
    102171         "punpcklbw %%mm7, %%mm2           \n\t" /* 0F0G0H0I */\ 
     
    111180         "paddw %6, %%mm1                  \n\t"\ 
    112181         "paddw %%mm1, %%mm3               \n\t" /* 20a - 6b +3c - d */\ 
    113 @@ -2015,7 +2015,7 @@ 
     182@@ -2016,7 +2016,7 @@ 
    114183         "psubw %%mm5, %%mm0               \n\t" /* c - 2b */\ 
    115184         "movq %%mm3, %%mm5                \n\t" /* JKLMNOPQ */\ 
     
    120189         "paddw %%mm3, %%mm2               \n\t" /* d */\ 
    121190         "psubw %%mm2, %%mm0               \n\t" /* -6b + 3c - d */\ 
    122 @@ -2023,7 +2023,7 @@ 
     191@@ -2024,7 +2024,7 @@ 
    123192         "punpcklbw %%mm7, %%mm2           \n\t" /* 0J0K0L0M */\ 
    124193         "punpckhbw %%mm7, %%mm5           \n\t" /* 0N0O0P0Q */\ 
     
    129198         "paddw %%mm6, %%mm0               \n\t" /* 20a - 6b + 3c - d */\ 
    130199         "psraw $5, %%mm0                  \n\t"\ 
    131 @@ -2038,8 +2038,8 @@ 
     200@@ -2039,8 +2039,8 @@ 
    132201         "paddw %%mm2, %%mm5               \n\t" /* d */\ 
    133202         "paddw %%mm6, %%mm6               \n\t" /* 2b */\ 
     
    140209         "paddw %6, %%mm4                  \n\t"\ 
    141210         "paddw %%mm3, %%mm4               \n\t" /* 20a - 6b + 3c - d */\ 
    142 @@ -2052,7 +2052,9 @@ 
     211@@ -2053,7 +2053,9 @@ 
    143212         "decl %2                          \n\t"\ 
    144213         " jnz 1b                          \n\t"\ 
     
    151220     );\ 
    152221 }\ 
    153 @@ -2130,10 +2132,10 @@ 
     222@@ -2131,10 +2133,10 @@ 
    154223         "paddw %%mm5, %%mm5               \n\t" /* 2b */\ 
    155224         "psubw %%mm5, %%mm6               \n\t" /* c - 2b */\ 
     
    164233         "paddw %6, %%mm6                  \n\t"\ 
    165234         "paddw %%mm6, %%mm0               \n\t" /* 20a - 6b + 3c - d */\ 
    166 @@ -2151,8 +2153,8 @@ 
     235@@ -2152,8 +2154,8 @@ 
    167236         "paddw %%mm5, %%mm4               \n\t" /* d */\ 
    168237         "paddw %%mm2, %%mm2               \n\t" /* 2b */\ 
     
    175244         "paddw %6, %%mm1                  \n\t"\ 
    176245         "paddw %%mm1, %%mm3               \n\t" /* 20a - 6b + 3c - d */\ 
    177 @@ -2165,7 +2167,9 @@ 
     246@@ -2166,7 +2168,9 @@ 
    178247         "decl %2                          \n\t"\ 
    179248         " jnz 1b                          \n\t"\ 
     
    186255     );\ 
    187256 }\ 
    188 @@ -2244,31 +2248,31 @@ 
     257@@ -2245,31 +2249,31 @@ 
    189258         "movq 8(%0), %%mm1              \n\t"\ 
    190259         "movq 16(%0), %%mm2             \n\t"\ 
     
    234303         "add $136, %0                   \n\t"\ 
    235304         "add %6, %1                     \n\t"\ 
    236 @@ -2276,7 +2280,9 @@ 
     305@@ -2277,7 +2281,9 @@ 
    237306         " jnz 1b                        \n\t"\ 
    238307         \ 
     
    245314     );\ 
    246315 }\ 
    247 @@ -2316,19 +2322,19 @@ 
     316@@ -2317,19 +2323,19 @@ 
    248317         "movq 8(%0), %%mm1              \n\t"\ 
    249318         "movq 16(%0), %%mm2             \n\t"\ 
     
    273342         "add $72, %0                    \n\t"\ 
    274343         "add %6, %1                     \n\t"\ 
    275 @@ -2336,7 +2342,9 @@ 
     344@@ -2337,7 +2343,9 @@ 
    276345         " jnz 1b                        \n\t"\ 
    277346          \ 
     
    284353    );\ 
    285354 }\ 
    286 @@ -2967,7 +2975,6 @@ 
     355@@ -2972,7 +2980,6 @@ 
    287356     double c = 2.0 / (len-1.0); 
    288357     int n2 = len>>1; 
     
    292361         "movsd   %0,     %%xmm7 \n\t" 
    293362         "movapd  %1,     %%xmm6 \n\t" 
    294 @@ -2985,17 +2992,18 @@ 
     363@@ -2990,17 +2997,18 @@ 
    295364         "movapd   %%xmm6,  %%xmm0   \n\t"\ 
    296365         "subpd    %%xmm1,  %%xmm0   \n\t"\ 
     
    317386          "r"(data+n2), "r"(data+len-2-n2)\ 
    318387     ); 
    319 Index: libavcodec/i386/h264dsp_mmx.c 
    320 =================================================================== 
    321 --- libavcodec/i386/h264dsp_mmx.c       (revision 10865) 
    322 +++ libavcodec/i386/h264dsp_mmx.c       (working copy) 
     388diff -ru ffmpeg/libavcodec/i386/h264dsp_mmx.c ffmpeg-/libavcodec/i386/h264dsp_mmx.c 
     389--- ffmpeg/libavcodec/i386/h264dsp_mmx.c        2008-01-20 15:05:31.000000000 -0500 
     390+++ ffmpeg-/libavcodec/i386/h264dsp_mmx.c       2008-01-20 17:03:15.000000000 -0500 
    323391@@ -341,21 +341,21 @@ 
    324392 // in: mm0=p1 mm1=p0 mm2=q0 mm3=q1 mm7=(tc&mask) 
     
    380448 } 
    381449  
    382 Index: libavcodec/i386/simple_idct_mmx.c 
    383 =================================================================== 
    384 --- libavcodec/i386/simple_idct_mmx.c   (revision 10865) 
    385 +++ libavcodec/i386/simple_idct_mmx.c   (working copy) 
     450diff -ru ffmpeg/libavcodec/i386/motion_est_mmx.c ffmpeg-/libavcodec/i386/motion_est_mmx.c 
     451--- ffmpeg/libavcodec/i386/motion_est_mmx.c     2008-01-20 15:05:31.000000000 -0500 
     452+++ ffmpeg-/libavcodec/i386/motion_est_mmx.c    2008-01-20 17:03:15.000000000 -0500 
     453@@ -167,7 +167,7 @@ 
     454 static inline void sad8_4_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h) 
     455 { 
     456     asm volatile( 
     457-        "movq "MANGLE(bone)", %%mm5     \n\t" 
     458+        "movq %4, %%mm5     \n\t" 
     459         "movq (%1), %%mm0               \n\t" 
     460         "pavgb 1(%1), %%mm0             \n\t" 
     461         "add %3, %1                     \n\t" 
     462@@ -190,7 +190,7 @@ 
     463         "sub $2, %0                     \n\t" 
     464         " jg 1b                         \n\t" 
     465         : "+r" (h), "+r" (blk1), "+r" (blk2) 
     466-        : "r" ((long)stride) 
     467+        : "r" ((long)stride), "m" (bone) 
     468     ); 
     469 } 
     470  
     471@@ -258,7 +258,7 @@ 
     472         "punpckhbw %%mm7, %%mm5         \n\t" 
     473         "paddw %%mm4, %%mm2             \n\t" 
     474         "paddw %%mm5, %%mm3             \n\t" 
     475-        "movq 16+"MANGLE(round_tab)", %%mm5 \n\t" 
     476+        "movq 16+%5, %%mm5 \n\t" 
     477         "paddw %%mm2, %%mm0             \n\t" 
     478         "paddw %%mm3, %%mm1             \n\t" 
     479         "paddw %%mm5, %%mm0             \n\t" 
     480@@ -281,7 +281,7 @@ 
     481         "add %4, %%"REG_a"              \n\t" 
     482         " js 1b                         \n\t" 
     483         : "+a" (len) 
     484-        : "r" (blk1 - len), "r" (blk1 -len + stride), "r" (blk2 - len), "r" ((long)stride) 
     485+        : "r" (blk1 - len), "r" (blk1 -len + stride), "r" (blk2 - len), "r" ((long)stride), "m" (round_tab[0]) 
     486     ); 
     487 } 
     488  
     489diff -ru ffmpeg/libavcodec/i386/simple_idct_mmx.c ffmpeg-/libavcodec/i386/simple_idct_mmx.c 
     490--- ffmpeg/libavcodec/i386/simple_idct_mmx.c    2008-01-20 15:05:31.000000000 -0500 
     491+++ ffmpeg-/libavcodec/i386/simple_idct_mmx.c   2008-01-20 17:03:15.000000000 -0500 
    386492@@ -363,7 +363,7 @@ 
    387493         "movq " #src4 ", %%mm1          \n\t" /* R6     R2      r6      r2 */\