~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libswscale/ppc/yuv2rgb_altivec.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:23:28 UTC
  • mfrom: (0.4.7 sid)
  • mto: This revision was merged to the branch mainline in revision 76.
  • Revision ID: package-import@ubuntu.com-20120112222328-8jqdyodym3p84ygu
Tags: 2:1.0~rc4.dfsg1+svn34540-1
* New upstream snapshot
* upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
626
626
}
627
627
 
628
628
 
629
 
void
 
629
static av_always_inline void
630
630
ff_yuv2packedX_altivec(SwsContext *c, const int16_t *lumFilter,
631
631
                       const int16_t **lumSrc, int lumFilterSize,
632
632
                       const int16_t *chrFilter, const int16_t **chrUSrc,
633
633
                       const int16_t **chrVSrc, int chrFilterSize,
634
634
                       const int16_t **alpSrc, uint8_t *dest,
635
 
                       int dstW, int dstY)
 
635
                       int dstW, int dstY, enum PixelFormat target)
636
636
{
637
637
    int i,j;
638
638
    vector signed short X,X0,X1,Y0,U0,V0,Y1,U1,V1,U,V;
706
706
        G  = vec_packclp (G0,G1);
707
707
        B  = vec_packclp (B0,B1);
708
708
 
709
 
        switch(c->dstFormat) {
 
709
        switch(target) {
710
710
        case PIX_FMT_ABGR:  out_abgr  (R,G,B,out); break;
711
711
        case PIX_FMT_BGRA:  out_bgra  (R,G,B,out); break;
712
712
        case PIX_FMT_RGBA:  out_rgba  (R,G,B,out); break;
785
785
        B  = vec_packclp (B0,B1);
786
786
 
787
787
        nout = (vector unsigned char *)scratch;
788
 
        switch(c->dstFormat) {
 
788
        switch(target) {
789
789
        case PIX_FMT_ABGR:  out_abgr  (R,G,B,nout); break;
790
790
        case PIX_FMT_BGRA:  out_bgra  (R,G,B,nout); break;
791
791
        case PIX_FMT_RGBA:  out_rgba  (R,G,B,nout); break;
803
803
    }
804
804
 
805
805
}
 
806
 
 
807
#define YUV2PACKEDX_WRAPPER(suffix, pixfmt) \
 
808
void ff_yuv2 ## suffix ## _X_altivec(SwsContext *c, const int16_t *lumFilter, \
 
809
                            const int16_t **lumSrc, int lumFilterSize, \
 
810
                            const int16_t *chrFilter, const int16_t **chrUSrc, \
 
811
                            const int16_t **chrVSrc, int chrFilterSize, \
 
812
                            const int16_t **alpSrc, uint8_t *dest, \
 
813
                            int dstW, int dstY) \
 
814
{ \
 
815
    ff_yuv2packedX_altivec(c, lumFilter, lumSrc, lumFilterSize, \
 
816
                           chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
 
817
                           alpSrc, dest, dstW, dstY, pixfmt); \
 
818
}
 
819
 
 
820
YUV2PACKEDX_WRAPPER(abgr,  PIX_FMT_ABGR);
 
821
YUV2PACKEDX_WRAPPER(bgra,  PIX_FMT_BGRA);
 
822
YUV2PACKEDX_WRAPPER(argb,  PIX_FMT_ARGB);
 
823
YUV2PACKEDX_WRAPPER(rgba,  PIX_FMT_RGBA);
 
824
YUV2PACKEDX_WRAPPER(rgb24, PIX_FMT_RGB24);
 
825
YUV2PACKEDX_WRAPPER(bgr24, PIX_FMT_BGR24);