Changeset 231

Show
Ignore:
Timestamp:
01/04/07 14:32:11 (2 years ago)
Author:
dconrad
Message:

Fix HuffYUV decoder for RGB. Still needs YUV copying. Refs #68.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/FFusionCodec.c

    r230 r231  
    573573                                DisposeHandle(imgDescExt); 
    574574                        } 
     575                } else { 
     576                        CountImageDescriptionExtensionType(p->imageDescription, 'strf', &count); 
     577                         
     578                        if (count >= 1) { 
     579                                imgDescExt = NewHandle(0); 
     580                                GetImageDescriptionExtension(p->imageDescription, &imgDescExt, 'strf', 1); 
     581                                 
     582                                if (GetHandleSize(imgDescExt) - 40 > 0) { 
     583                                        glob->avContext->extradata = calloc(1, GetHandleSize(imgDescExt) - 40 + FF_INPUT_BUFFER_PADDING_SIZE); 
     584                                        memcpy(glob->avContext->extradata, *imgDescExt + 40, GetHandleSize(imgDescExt) - 40); 
     585                                        glob->avContext->extradata_size = GetHandleSize(imgDescExt) - 40; 
     586                                } 
     587                                DisposeHandle(imgDescExt); 
     588                        } 
    575589                } 
    576590                 
     
    635649                case PIX_FMT_BGR24: 
    636650                        pos[index++] = k24RGBPixelFormat; 
     651                        break; 
     652                case PIX_FMT_RGB32: 
     653                        pos[index++] = k32ARGBPixelFormat; 
    637654                        break; 
    638655                case PIX_FMT_YUV420P: 
     
    900917        { 
    901918                BGR24toRGB24((UInt8 *)drp->baseAddr, drp->rowBytes, myDrp->width, myDrp->height, picture); 
     919        } 
     920        else if (myDrp->pixelFormat == k32ARGBPixelFormat && glob->avContext->pix_fmt == PIX_FMT_RGB32) 
     921        { 
     922                Ptr dest = drp->baseAddr; 
     923                Ptr src = (Ptr) picture->data[0]; 
     924                for (i = 0; i < myDrp->height; i++) { 
     925                        memcpy(dest, src, FFMIN(drp->rowBytes, picture->linesize[0])); 
     926                        dest += drp->rowBytes; 
     927                        src += picture->linesize[0]; 
     928                } 
    902929        } 
    903930        else 
  • trunk/FFusionCodec.r

    r230 r231  
    458458 
    459459//--------------------------------------------------------------------------- 
     460// Huffyuv Description Resources 
     461//--------------------------------------------------------------------------- 
     462 
     463resource 'cdci' (kHuffYUVCodecInfoResID) { 
     464        kHuffYUVName,                           // Type 
     465        1,                                      // Version 
     466        1,                                      // Revision level 
     467        kFFusionCodecManufacturer,                      // Manufacturer 
     468        kFFusionDecompressionFlags,             // Decompression Flags 
     469        0,                                      // Compression Flags 
     470        kFFusionFormatFlags,                    // Format Flags 
     471        128,                                    // Compression Accuracy 
     472        128,                                    // Decomression Accuracy 
     473        200,                                    // Compression Speed 
     474        200,                                    // Decompression Speed 
     475        128,                                    // Compression Level 
     476        0,                                      // Reserved 
     477        1,                                      // Minimum Height 
     478        1,                                      // Minimum Width 
     479        0,                                      // Decompression Pipeline Latency 
     480        0,                                      // Compression Pipeline Latency 
     481        0                                       // Private Data 
     482}; 
     483 
     484//--------------------------------------------------------------------------- 
    460485// MS-MPEG4 v1 Component 
    461486//---------------------------------------------------------------------------