Revision 1379b584

View differences:

libswscale/swscale.c
765 765
            dest+=6;\
766 766
        }\
767 767
        break;\
768
    case PIX_FMT_RGB565:\
769
    case PIX_FMT_BGR565:\
768
    case PIX_FMT_RGB565BE:\
769
    case PIX_FMT_RGB565LE:\
770
    case PIX_FMT_BGR565BE:\
771
    case PIX_FMT_BGR565LE:\
770 772
        {\
771 773
            const int dr1= dither_2x2_8[y&1    ][0];\
772 774
            const int dg1= dither_2x2_4[y&1    ][0];\
......
780 782
            }\
781 783
        }\
782 784
        break;\
783
    case PIX_FMT_RGB555:\
784
    case PIX_FMT_BGR555:\
785
    case PIX_FMT_RGB555BE:\
786
    case PIX_FMT_RGB555LE:\
787
    case PIX_FMT_BGR555BE:\
788
    case PIX_FMT_BGR555LE:\
785 789
        {\
786 790
            const int dr1= dither_2x2_8[y&1    ][0];\
787 791
            const int dg1= dither_2x2_8[y&1    ][1];\
libswscale/swscale_internal.h
391 391
        || (x)==PIX_FMT_RGB32       \
392 392
        || (x)==PIX_FMT_RGB32_1     \
393 393
        || (x)==PIX_FMT_RGB24       \
394
        || (x)==PIX_FMT_RGB565      \
395
        || (x)==PIX_FMT_RGB555      \
394
        || (x)==PIX_FMT_RGB565BE    \
395
        || (x)==PIX_FMT_RGB565LE    \
396
        || (x)==PIX_FMT_RGB555BE    \
397
        || (x)==PIX_FMT_RGB555LE    \
396 398
        || (x)==PIX_FMT_RGB8        \
397 399
        || (x)==PIX_FMT_RGB4        \
398 400
        || (x)==PIX_FMT_RGB4_BYTE   \
......
403 405
           (x)==PIX_FMT_BGR32       \
404 406
        || (x)==PIX_FMT_BGR32_1     \
405 407
        || (x)==PIX_FMT_BGR24       \
406
        || (x)==PIX_FMT_BGR565      \
407
        || (x)==PIX_FMT_BGR555      \
408
        || (x)==PIX_FMT_BGR565BE    \
409
        || (x)==PIX_FMT_BGR565LE    \
410
        || (x)==PIX_FMT_BGR555BE    \
411
        || (x)==PIX_FMT_BGR555LE    \
408 412
        || (x)==PIX_FMT_BGR8        \
409 413
        || (x)==PIX_FMT_BGR4        \
410 414
        || (x)==PIX_FMT_BGR4_BYTE   \
libswscale/yuv2rgb.c
33 33
#include "swscale.h"
34 34
#include "swscale_internal.h"
35 35
#include "libavutil/x86_cpu.h"
36
#include "libavutil/bswap.h"
36 37

  
37 38
extern const uint8_t dither_8x8_32[8][8];
38 39
extern const uint8_t dither_8x8_73[8][8];
......
596 597
    const int isRgb =      c->dstFormat==PIX_FMT_RGB32
597 598
                        || c->dstFormat==PIX_FMT_RGB32_1
598 599
                        || c->dstFormat==PIX_FMT_BGR24
599
                        || c->dstFormat==PIX_FMT_RGB565
600
                        || c->dstFormat==PIX_FMT_RGB555
600
                        || c->dstFormat==PIX_FMT_RGB565BE
601
                        || c->dstFormat==PIX_FMT_RGB565LE
602
                        || c->dstFormat==PIX_FMT_RGB555BE
603
                        || c->dstFormat==PIX_FMT_RGB555LE
601 604
                        || c->dstFormat==PIX_FMT_RGB8
602 605
                        || c->dstFormat==PIX_FMT_RGB4
603 606
                        || c->dstFormat==PIX_FMT_RGB4_BYTE
604 607
                        || c->dstFormat==PIX_FMT_MONOBLACK;
608
    const int isNotNe =    c->dstFormat==PIX_FMT_NE(RGB565LE,RGB565BE)
609
                        || c->dstFormat==PIX_FMT_NE(RGB555LE,RGB555BE)
610
                        || c->dstFormat==PIX_FMT_NE(BGR565LE,BGR565BE)
611
                        || c->dstFormat==PIX_FMT_NE(BGR555LE,BGR555BE);
605 612
    const int bpp = c->dstFormatBpp;
606 613
    uint8_t *y_table;
607 614
    uint16_t *y_table16;
......
709 716
            y_table16[i+2048] = (yval >> 3)          << bbase;
710 717
            yb += cy;
711 718
        }
719
        if(isNotNe)
720
            for (i = 0; i < 1024*3; i++)
721
                y_table16[i] = bswap_16(y_table16[i]);
712 722
        fill_table(c->table_rV, 2, crv, y_table16 + yoffs);
713 723
        fill_table(c->table_gU, 2, cgu, y_table16 + yoffs + 1024);
714 724
        fill_table(c->table_bU, 2, cbu, y_table16 + yoffs + 2048);

Also available in: Unified diff