Changeset 201

Show
Ignore:
Timestamp:
12/08/06 19:57:55 (2 years ago)
Author:
gbooker
Message:

Patch from Allan Hsu to do a better job with endian fun.
Use the carbon calls instead of ffmpeg's bswap.

Files:

Legend:

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

    r200 r201  
    3636#include "avcodec.h" 
    3737#include "postprocess.h" 
    38  
    39 //mru, in rev 7238, moved this into internal.h  I don't think this was a good idea and including internal.h is a worse idea. 
    40 #define always_inline __attribute__((always_inline)) inline 
    41  
    42 #include "bswap.h" 
    4338#include "Codecprintf.h" 
    44  
    45 #ifdef __BIG_ENDIAN__ 
    46 #define make_big_32(x) (x) 
    47 #else 
    48 #ifdef __LITTLE_ENDIAN__ 
    49 #define make_big_32(x) bswap_32(x) 
    50 #else 
    51 #error Endian is unknown 
    52 #endif //Little 
    53 #endif //Big 
    5439 
    5540void inline swapFrame(AVFrame * *a, AVFrame * *b) 
     
    13091294     
    13101295    // if ya can't set da poiners, set da offsets 
    1311     planar->componentInfoY.offset = make_big_32(picture->data[0] - baseAddr); 
    1312     planar->componentInfoCb.offset =  make_big_32(picture->data[1] - baseAddr); 
    1313     planar->componentInfoCr.offset =  make_big_32(picture->data[2] - baseAddr); 
     1296    planar->componentInfoY.offset = EndianU32_NtoB(picture->data[0] - baseAddr); 
     1297    planar->componentInfoCb.offset =  EndianU32_NtoB(picture->data[1] - baseAddr); 
     1298    planar->componentInfoCr.offset =  EndianU32_NtoB(picture->data[2] - baseAddr); 
    13141299     
    13151300    // for the 16/32 add look at EDGE in mpegvideo.c 
    1316     planar->componentInfoY.rowBytes = make_big_32(picture->linesize[0]); 
    1317     planar->componentInfoCb.rowBytes = make_big_32(picture->linesize[1]); 
    1318     planar->componentInfoCr.rowBytes = make_big_32(picture->linesize[2]); 
     1301    planar->componentInfoY.rowBytes = EndianU32_NtoB(picture->linesize[0]); 
     1302    planar->componentInfoCb.rowBytes = EndianU32_NtoB(picture->linesize[1]); 
     1303    planar->componentInfoCr.rowBytes = EndianU32_NtoB(picture->linesize[2]); 
    13191304} 
    13201305