aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/yuv2rgb.c
diff options
context:
space:
mode:
authorJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>2010-03-06 11:27:31 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-03-06 11:27:31 +0000
commita4e441301d55693454d07e0b940e4f427105e255 (patch)
treed6e4bfe442a3dcf502453c1f06825469601e18e0 /libswscale/yuv2rgb.c
parent5988dc9eeca1afbacc5e9873714341e09b64afe8 (diff)
downloadffmpeg-a4e441301d55693454d07e0b940e4f427105e255.tar.gz
Add support to BGR444/RGB444 foreign endian output in libswscale.
Patch by Janusz Krzysztofik |jkrzyszt ^ tis icnet pl|. Originally committed as revision 30855 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale/yuv2rgb.c')
-rw-r--r--libswscale/yuv2rgb.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
index c7afb18deb..6883f774e2 100644
--- a/libswscale/yuv2rgb.c
+++ b/libswscale/yuv2rgb.c
@@ -630,15 +630,18 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int
|| c->dstFormat==PIX_FMT_RGB565LE
|| c->dstFormat==PIX_FMT_RGB555BE
|| c->dstFormat==PIX_FMT_RGB555LE
- || c->dstFormat==PIX_FMT_RGB444
+ || c->dstFormat==PIX_FMT_RGB444BE
+ || c->dstFormat==PIX_FMT_RGB444LE
|| c->dstFormat==PIX_FMT_RGB8
|| c->dstFormat==PIX_FMT_RGB4
|| c->dstFormat==PIX_FMT_RGB4_BYTE
|| c->dstFormat==PIX_FMT_MONOBLACK;
const int isNotNe = c->dstFormat==PIX_FMT_NE(RGB565LE,RGB565BE)
|| c->dstFormat==PIX_FMT_NE(RGB555LE,RGB555BE)
+ || c->dstFormat==PIX_FMT_NE(RGB444LE,RGB444BE)
|| c->dstFormat==PIX_FMT_NE(BGR565LE,BGR565BE)
- || c->dstFormat==PIX_FMT_NE(BGR555LE,BGR555BE);
+ || c->dstFormat==PIX_FMT_NE(BGR555LE,BGR555BE)
+ || c->dstFormat==PIX_FMT_NE(BGR444LE,BGR444BE);
const int bpp = c->dstFormatBpp;
uint8_t *y_table;
uint16_t *y_table16;
@@ -745,6 +748,9 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int
y_table16[i+2048] = (yval >> 4) << bbase;
yb += cy;
}
+ if (isNotNe)
+ for (i = 0; i < 1024*3; i++)
+ y_table16[i] = bswap_16(y_table16[i]);
fill_table(c->table_rV, 2, crv, y_table16 + yoffs);
fill_table(c->table_gU, 2, cgu, y_table16 + yoffs + 1024);
fill_table(c->table_bU, 2, cbu, y_table16 + yoffs + 2048);