Revision c36a4294 libswscale/swscale.c

View differences:

libswscale/swscale.c
588 588
            }\
589 589
            A1>>=19;\
590 590
            A2>>=19;\
591
        }\
591
        }
592 592

  
593 593
#define YSCALE_YUV_2_PACKEDX_C(type,alpha) \
594 594
        YSCALE_YUV_2_PACKEDX_NOCLIP_C(type,alpha)\
......
633 633
            A >>=19;\
634 634
            if (A&256)\
635 635
                A = av_clip_uint8(A);\
636
        }\
636
        }
637 637

  
638 638
#define YSCALE_YUV_2_RGBX_FULL_C(rnd,alpha) \
639 639
    YSCALE_YUV_2_PACKEDX_FULL_C(rnd>>3,alpha)\
......
650 650
            else if (G<0)G=0;   \
651 651
            if (B>=(256<<22))   B=(256<<22)-1; \
652 652
            else if (B<0)B=0;   \
653
        }\
654

  
653
        }
655 654

  
656 655
#define YSCALE_YUV_2_GRAY16_C \
657 656
    for (i=0; i<(dstW>>1); i++) {\
......
680 679
    YSCALE_YUV_2_PACKEDX_C(type,alpha)  /* FIXME fix tables so that clipping is not needed and then use _NOCLIP*/\
681 680
    r = (type *)c->table_rV[V];   \
682 681
    g = (type *)(c->table_gU[U] + c->table_gV[V]); \
683
    b = (type *)c->table_bU[U];   \
682
    b = (type *)c->table_bU[U];
684 683

  
685 684
#define YSCALE_YUV_2_PACKED2_C(type,alpha)   \
686 685
    for (i=0; i<(dstW>>1); i++) { \
......
694 693
        if (alpha) {\
695 694
            A1= (abuf0[i2  ]*yalpha1+abuf1[i2  ]*yalpha)>>19;         \
696 695
            A2= (abuf0[i2+1]*yalpha1+abuf1[i2+1]*yalpha)>>19;         \
697
        }\
696
        }
698 697

  
699 698
#define YSCALE_YUV_2_GRAY16_2_C   \
700 699
    for (i=0; i<(dstW>>1); i++) { \
701 700
        const int i2= 2*i;       \
702 701
        int Y1= (buf0[i2  ]*yalpha1+buf1[i2  ]*yalpha)>>11;           \
703
        int Y2= (buf0[i2+1]*yalpha1+buf1[i2+1]*yalpha)>>11;           \
702
        int Y2= (buf0[i2+1]*yalpha1+buf1[i2+1]*yalpha)>>11;
704 703

  
705 704
#define YSCALE_YUV_2_RGB2_C(type,alpha) \
706 705
    YSCALE_YUV_2_PACKED2_C(type,alpha)\
707 706
    r = (type *)c->table_rV[V];\
708 707
    g = (type *)(c->table_gU[U] + c->table_gV[V]);\
709
    b = (type *)c->table_bU[U];\
708
    b = (type *)c->table_bU[U];
710 709

  
711 710
#define YSCALE_YUV_2_PACKED1_C(type,alpha) \
712 711
    for (i=0; i<(dstW>>1); i++) {\
......
720 719
        if (alpha) {\
721 720
            A1= abuf0[i2  ]>>7;\
722 721
            A2= abuf0[i2+1]>>7;\
723
        }\
722
        }
724 723

  
725 724
#define YSCALE_YUV_2_GRAY16_1_C \
726 725
    for (i=0; i<(dstW>>1); i++) {\
727 726
        const int i2= 2*i;\
728 727
        int Y1= buf0[i2  ]<<1;\
729
        int Y2= buf0[i2+1]<<1;\
728
        int Y2= buf0[i2+1]<<1;
730 729

  
731 730
#define YSCALE_YUV_2_RGB1_C(type,alpha) \
732 731
    YSCALE_YUV_2_PACKED1_C(type,alpha)\
733 732
    r = (type *)c->table_rV[V];\
734 733
    g = (type *)(c->table_gU[U] + c->table_gV[V]);\
735
    b = (type *)c->table_bU[U];\
734
    b = (type *)c->table_bU[U];
736 735

  
737 736
#define YSCALE_YUV_2_PACKED1B_C(type,alpha) \
738 737
    for (i=0; i<(dstW>>1); i++) {\
......
746 745
        if (alpha) {\
747 746
            A1= abuf0[i2  ]>>7;\
748 747
            A2= abuf0[i2+1]>>7;\
749
        }\
748
        }
750 749

  
751 750
#define YSCALE_YUV_2_RGB1B_C(type,alpha) \
752 751
    YSCALE_YUV_2_PACKED1B_C(type,alpha)\
753 752
    r = (type *)c->table_rV[V];\
754 753
    g = (type *)(c->table_gU[U] + c->table_gV[V]);\
755
    b = (type *)c->table_bU[U];\
754
    b = (type *)c->table_bU[U];
756 755

  
757 756
#define YSCALE_YUV_2_MONO2_C \
758 757
    const uint8_t * const d128=dither_8x8_220[y&7];\
......
769 768
        acc+= acc + g[((buf0[i+7]*yalpha1+buf1[i+7]*yalpha)>>19) + d128[7]];\
770 769
        ((uint8_t*)dest)[0]= c->dstFormat == PIX_FMT_MONOBLACK ? acc : ~acc;\
771 770
        dest++;\
772
    }\
771
    }
773 772

  
774 773
#define YSCALE_YUV_2_MONOX_C \
775 774
    const uint8_t * const d128=dither_8x8_220[y&7];\
......
987 986
            ((uint8_t*)dest)[2*i2+3]= Y2>>8;\
988 987
        }                \
989 988
        break;\
990
    }\
989
    }
991 990

  
992 991
static inline void yuv2packedXinC(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
993 992
                                  const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize,

Also available in: Unified diff