Revision 896a22b8

View differences:

libswscale/swscale_template.c
1731 1731

  
1732 1732
//FIXME yuy2* can read up to 7 samples too much
1733 1733

  
1734
static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, long width)
1734
static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
1735 1735
{
1736 1736
#ifdef HAVE_MMX
1737 1737
    asm volatile(
......
1756 1756
#endif
1757 1757
}
1758 1758

  
1759
static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width)
1759
static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
1760 1760
{
1761 1761
#ifdef HAVE_MMX
1762 1762
    asm volatile(
......
1793 1793

  
1794 1794
/* This is almost identical to the previous, end exists only because
1795 1795
 * yuy2ToY/UV)(dst, src+1, ...) would have 100% unaligned accesses. */
1796
static inline void RENAME(uyvyToY)(uint8_t *dst, uint8_t *src, long width)
1796
static inline void RENAME(uyvyToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
1797 1797
{
1798 1798
#ifdef HAVE_MMX
1799 1799
    asm volatile(
......
1817 1817
#endif
1818 1818
}
1819 1819

  
1820
static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width)
1820
static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
1821 1821
{
1822 1822
#ifdef HAVE_MMX
1823 1823
    asm volatile(
......
1853 1853
}
1854 1854

  
1855 1855
#define BGR2Y(type, name, shr, shg, shb, maskr, maskg, maskb, RY, GY, BY, S)\
1856
static inline void RENAME(name)(uint8_t *dst, uint8_t *src, long width)\
1856
static inline void RENAME(name)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)\
1857 1857
{\
1858 1858
    int i;\
1859 1859
    for (i=0; i<width; i++)\
......
1874 1874
BGR2Y(uint16_t, rgb15ToY, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, RY    , GY<<5, BY<<10, RGB2YUV_SHIFT+7)
1875 1875

  
1876 1876
#define BGR2UV(type, name, shr, shg, shb, maskr, maskg, maskb, RU, GU, BU, RV, GV, BV, S)\
1877
static inline void RENAME(name)(uint8_t *dstU, uint8_t *dstV, uint8_t *src, uint8_t *dummy, long width)\
1877
static inline void RENAME(name)(uint8_t *dstU, uint8_t *dstV, uint8_t *src, uint8_t *dummy, long width, uint32_t *unused)\
1878 1878
{\
1879 1879
    int i;\
1880 1880
    for (i=0; i<width; i++)\
......
1887 1887
        dstV[i]= ((RV)*r + (GV)*g + (BV)*b + (257<<((S)-1)))>>(S);\
1888 1888
    }\
1889 1889
}\
1890
static inline void RENAME(name ## _half)(uint8_t *dstU, uint8_t *dstV, uint8_t *src, uint8_t *dummy, long width)\
1890
static inline void RENAME(name ## _half)(uint8_t *dstU, uint8_t *dstV, uint8_t *src, uint8_t *dummy, long width, uint32_t *unused)\
1891 1891
{\
1892 1892
    int i;\
1893 1893
    for (i=0; i<width; i++)\
......
2025 2025
}
2026 2026
#endif
2027 2027

  
2028
static inline void RENAME(bgr24ToY)(uint8_t *dst, uint8_t *src, long width)
2028
static inline void RENAME(bgr24ToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
2029 2029
{
2030 2030
#ifdef HAVE_MMX
2031 2031
    RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_BGR24);
......
2042 2042
#endif /* HAVE_MMX */
2043 2043
}
2044 2044

  
2045
static inline void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width)
2045
static inline void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
2046 2046
{
2047 2047
#ifdef HAVE_MMX
2048 2048
    RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_BGR24);
......
2061 2061
    assert(src1 == src2);
2062 2062
}
2063 2063

  
2064
static inline void RENAME(bgr24ToUV_half)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width)
2064
static inline void RENAME(bgr24ToUV_half)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
2065 2065
{
2066 2066
    int i;
2067 2067
    for (i=0; i<width; i++)
......
2076 2076
    assert(src1 == src2);
2077 2077
}
2078 2078

  
2079
static inline void RENAME(rgb24ToY)(uint8_t *dst, uint8_t *src, long width)
2079
static inline void RENAME(rgb24ToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
2080 2080
{
2081 2081
#ifdef HAVE_MMX
2082 2082
    RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_RGB24);
......
2093 2093
#endif
2094 2094
}
2095 2095

  
2096
static inline void RENAME(rgb24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width)
2096
static inline void RENAME(rgb24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
2097 2097
{
2098 2098
    int i;
2099 2099
    assert(src1==src2);
......
2112 2112
#endif
2113 2113
}
2114 2114

  
2115
static inline void RENAME(rgb24ToUV_half)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width)
2115
static inline void RENAME(rgb24ToUV_half)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
2116 2116
{
2117 2117
    int i;
2118 2118
    assert(src1==src2);
......
2152 2152
    }
2153 2153
}
2154 2154

  
2155
static inline void RENAME(monowhite2Y)(uint8_t *dst, uint8_t *src, long width)
2155
static inline void RENAME(monowhite2Y)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
2156 2156
{
2157 2157
    int i, j;
2158 2158
    for (i=0; i<width/8; i++){
......
2162 2162
    }
2163 2163
}
2164 2164

  
2165
static inline void RENAME(monoblack2Y)(uint8_t *dst, uint8_t *src, long width)
2165
static inline void RENAME(monoblack2Y)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
2166 2166
{
2167 2167
    int i, j;
2168 2168
    for (i=0; i<width/8; i++){
......
2363 2363
{
2364 2364
    if (srcFormat==PIX_FMT_YUYV422 || srcFormat==PIX_FMT_GRAY16BE)
2365 2365
    {
2366
        RENAME(yuy2ToY)(formatConvBuffer, src, srcW);
2366
        RENAME(yuy2ToY)(formatConvBuffer, src, srcW, pal);
2367 2367
        src= formatConvBuffer;
2368 2368
    }
2369 2369
    else if (srcFormat==PIX_FMT_UYVY422 || srcFormat==PIX_FMT_GRAY16LE)
2370 2370
    {
2371
        RENAME(uyvyToY)(formatConvBuffer, src, srcW);
2371
        RENAME(uyvyToY)(formatConvBuffer, src, srcW, pal);
2372 2372
        src= formatConvBuffer;
2373 2373
    }
2374 2374
    else if (srcFormat==PIX_FMT_RGB32)
2375 2375
    {
2376
        RENAME(bgr32ToY)(formatConvBuffer, src, srcW);
2376
        RENAME(bgr32ToY)(formatConvBuffer, src, srcW, pal);
2377 2377
        src= formatConvBuffer;
2378 2378
    }
2379 2379
    else if (srcFormat==PIX_FMT_RGB32_1)
2380 2380
    {
2381
        RENAME(bgr32ToY)(formatConvBuffer, src+ALT32_CORR, srcW);
2381
        RENAME(bgr32ToY)(formatConvBuffer, src+ALT32_CORR, srcW, pal);
2382 2382
        src= formatConvBuffer;
2383 2383
    }
2384 2384
    else if (srcFormat==PIX_FMT_BGR24)
2385 2385
    {
2386
        RENAME(bgr24ToY)(formatConvBuffer, src, srcW);
2386
        RENAME(bgr24ToY)(formatConvBuffer, src, srcW, pal);
2387 2387
        src= formatConvBuffer;
2388 2388
    }
2389 2389
    else if (srcFormat==PIX_FMT_BGR565)
2390 2390
    {
2391
        RENAME(bgr16ToY)(formatConvBuffer, src, srcW);
2391
        RENAME(bgr16ToY)(formatConvBuffer, src, srcW, pal);
2392 2392
        src= formatConvBuffer;
2393 2393
    }
2394 2394
    else if (srcFormat==PIX_FMT_BGR555)
2395 2395
    {
2396
        RENAME(bgr15ToY)(formatConvBuffer, src, srcW);
2396
        RENAME(bgr15ToY)(formatConvBuffer, src, srcW, pal);
2397 2397
        src= formatConvBuffer;
2398 2398
    }
2399 2399
    else if (srcFormat==PIX_FMT_BGR32)
2400 2400
    {
2401
        RENAME(rgb32ToY)(formatConvBuffer, src, srcW);
2401
        RENAME(rgb32ToY)(formatConvBuffer, src, srcW, pal);
2402 2402
        src= formatConvBuffer;
2403 2403
    }
2404 2404
    else if (srcFormat==PIX_FMT_BGR32_1)
2405 2405
    {
2406
        RENAME(rgb32ToY)(formatConvBuffer, src+ALT32_CORR, srcW);
2406
        RENAME(rgb32ToY)(formatConvBuffer, src+ALT32_CORR, srcW, pal);
2407 2407
        src= formatConvBuffer;
2408 2408
    }
2409 2409
    else if (srcFormat==PIX_FMT_RGB24)
2410 2410
    {
2411
        RENAME(rgb24ToY)(formatConvBuffer, src, srcW);
2411
        RENAME(rgb24ToY)(formatConvBuffer, src, srcW, pal);
2412 2412
        src= formatConvBuffer;
2413 2413
    }
2414 2414
    else if (srcFormat==PIX_FMT_RGB565)
2415 2415
    {
2416
        RENAME(rgb16ToY)(formatConvBuffer, src, srcW);
2416
        RENAME(rgb16ToY)(formatConvBuffer, src, srcW, pal);
2417 2417
        src= formatConvBuffer;
2418 2418
    }
2419 2419
    else if (srcFormat==PIX_FMT_RGB555)
2420 2420
    {
2421
        RENAME(rgb15ToY)(formatConvBuffer, src, srcW);
2421
        RENAME(rgb15ToY)(formatConvBuffer, src, srcW, pal);
2422 2422
        src= formatConvBuffer;
2423 2423
    }
2424 2424
    else if (srcFormat==PIX_FMT_RGB8 || srcFormat==PIX_FMT_BGR8 || srcFormat==PIX_FMT_PAL8 || srcFormat==PIX_FMT_BGR4_BYTE  || srcFormat==PIX_FMT_RGB4_BYTE)
......
2428 2428
    }
2429 2429
    else if (srcFormat==PIX_FMT_MONOBLACK)
2430 2430
    {
2431
        RENAME(monoblack2Y)(formatConvBuffer, src, srcW);
2431
        RENAME(monoblack2Y)(formatConvBuffer, src, srcW, pal);
2432 2432
        src= formatConvBuffer;
2433 2433
    }
2434 2434
    else if (srcFormat==PIX_FMT_MONOWHITE)
2435 2435
    {
2436
        RENAME(monowhite2Y)(formatConvBuffer, src, srcW);
2436
        RENAME(monowhite2Y)(formatConvBuffer, src, srcW, pal);
2437 2437
        src= formatConvBuffer;
2438 2438
    }
2439 2439

  
......
2598 2598
{
2599 2599
    if (srcFormat==PIX_FMT_YUYV422)
2600 2600
    {
2601
        RENAME(yuy2ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2601
        RENAME(yuy2ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2602 2602
        src1= formatConvBuffer;
2603 2603
        src2= formatConvBuffer+VOFW;
2604 2604
    }
2605 2605
    else if (srcFormat==PIX_FMT_UYVY422)
2606 2606
    {
2607
        RENAME(uyvyToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2607
        RENAME(uyvyToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2608 2608
        src1= formatConvBuffer;
2609 2609
        src2= formatConvBuffer+VOFW;
2610 2610
    }
2611 2611
    else if (srcFormat==PIX_FMT_RGB32)
2612 2612
    {
2613 2613
        if(c->chrSrcHSubSample)
2614
            RENAME(bgr32ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2614
            RENAME(bgr32ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2615 2615
        else
2616
            RENAME(bgr32ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2616
            RENAME(bgr32ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2617 2617
        src1= formatConvBuffer;
2618 2618
        src2= formatConvBuffer+VOFW;
2619 2619
    }
2620 2620
    else if (srcFormat==PIX_FMT_RGB32_1)
2621 2621
    {
2622 2622
        if(c->chrSrcHSubSample)
2623
            RENAME(bgr32ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1+ALT32_CORR, src2+ALT32_CORR, srcW);
2623
            RENAME(bgr32ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1+ALT32_CORR, src2+ALT32_CORR, srcW, pal);
2624 2624
        else
2625
            RENAME(bgr32ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1+ALT32_CORR, src2+ALT32_CORR, srcW);
2625
            RENAME(bgr32ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1+ALT32_CORR, src2+ALT32_CORR, srcW, pal);
2626 2626
        src1= formatConvBuffer;
2627 2627
        src2= formatConvBuffer+VOFW;
2628 2628
    }
2629 2629
    else if (srcFormat==PIX_FMT_BGR24)
2630 2630
    {
2631 2631
        if(c->chrSrcHSubSample)
2632
            RENAME(bgr24ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2632
            RENAME(bgr24ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2633 2633
        else
2634
            RENAME(bgr24ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2634
            RENAME(bgr24ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2635 2635
        src1= formatConvBuffer;
2636 2636
        src2= formatConvBuffer+VOFW;
2637 2637
    }
2638 2638
    else if (srcFormat==PIX_FMT_BGR565)
2639 2639
    {
2640 2640
        if(c->chrSrcHSubSample)
2641
            RENAME(bgr16ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2641
            RENAME(bgr16ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2642 2642
        else
2643
            RENAME(bgr16ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2643
            RENAME(bgr16ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2644 2644
        src1= formatConvBuffer;
2645 2645
        src2= formatConvBuffer+VOFW;
2646 2646
    }
2647 2647
    else if (srcFormat==PIX_FMT_BGR555)
2648 2648
    {
2649 2649
        if(c->chrSrcHSubSample)
2650
            RENAME(bgr15ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2650
            RENAME(bgr15ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2651 2651
        else
2652
            RENAME(bgr15ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2652
            RENAME(bgr15ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2653 2653
        src1= formatConvBuffer;
2654 2654
        src2= formatConvBuffer+VOFW;
2655 2655
    }
2656 2656
    else if (srcFormat==PIX_FMT_BGR32)
2657 2657
    {
2658 2658
        if(c->chrSrcHSubSample)
2659
            RENAME(rgb32ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2659
            RENAME(rgb32ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2660 2660
        else
2661
            RENAME(rgb32ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2661
            RENAME(rgb32ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2662 2662
        src1= formatConvBuffer;
2663 2663
        src2= formatConvBuffer+VOFW;
2664 2664
    }
2665 2665
    else if (srcFormat==PIX_FMT_BGR32_1)
2666 2666
    {
2667 2667
        if(c->chrSrcHSubSample)
2668
            RENAME(rgb32ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1+ALT32_CORR, src2+ALT32_CORR, srcW);
2668
            RENAME(rgb32ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1+ALT32_CORR, src2+ALT32_CORR, srcW, pal);
2669 2669
        else
2670
            RENAME(rgb32ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1+ALT32_CORR, src2+ALT32_CORR, srcW);
2670
            RENAME(rgb32ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1+ALT32_CORR, src2+ALT32_CORR, srcW, pal);
2671 2671
        src1= formatConvBuffer;
2672 2672
        src2= formatConvBuffer+VOFW;
2673 2673
    }
2674 2674
    else if (srcFormat==PIX_FMT_RGB24)
2675 2675
    {
2676 2676
        if(c->chrSrcHSubSample)
2677
            RENAME(rgb24ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2677
            RENAME(rgb24ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2678 2678
        else
2679
            RENAME(rgb24ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2679
            RENAME(rgb24ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2680 2680
        src1= formatConvBuffer;
2681 2681
        src2= formatConvBuffer+VOFW;
2682 2682
    }
2683 2683
    else if (srcFormat==PIX_FMT_RGB565)
2684 2684
    {
2685 2685
        if(c->chrSrcHSubSample)
2686
            RENAME(rgb16ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2686
            RENAME(rgb16ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2687 2687
        else
2688
            RENAME(rgb16ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2688
            RENAME(rgb16ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2689 2689
        src1= formatConvBuffer;
2690 2690
        src2= formatConvBuffer+VOFW;
2691 2691
    }
2692 2692
    else if (srcFormat==PIX_FMT_RGB555)
2693 2693
    {
2694 2694
        if(c->chrSrcHSubSample)
2695
            RENAME(rgb15ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2695
            RENAME(rgb15ToUV_half)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2696 2696
        else
2697
            RENAME(rgb15ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW);
2697
            RENAME(rgb15ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
2698 2698
        src1= formatConvBuffer;
2699 2699
        src2= formatConvBuffer+VOFW;
2700 2700
    }

Also available in: Unified diff