Revision 1379b584 libswscale/yuv2rgb.c

View differences:

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