diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-02-08 13:14:19 +0000 |
---|---|---|
committer | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-02-08 13:14:19 +0000 |
commit | d4ade611df4e0a863869e37aec33090a362ffa54 (patch) | |
tree | e782caa9d824e78858eb5de8beed0bd70ea8d631 /postproc | |
parent | 8e5514a5d0f14a05efbad9ad3b84b71bc291ae10 (diff) | |
download | mpv-d4ade611df4e0a863869e37aec33090a362ffa54.tar.bz2 mpv-d4ade611df4e0a863869e37aec33090a362ffa54.tar.xz |
altivec_yuv2packedX() ignores the requested output format and unconditionally
outputs RGBA. This patch supports 6 output formats and prints an error message
if it is asked to provide an output format it is not capable of.
patch by Alan Curry, pacman_at_world_dot_std_dot_com
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17561 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'postproc')
-rw-r--r-- | postproc/yuv2rgb_altivec.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/postproc/yuv2rgb_altivec.c b/postproc/yuv2rgb_altivec.c index 69b5b302da..eea7134e96 100644 --- a/postproc/yuv2rgb_altivec.c +++ b/postproc/yuv2rgb_altivec.c @@ -867,7 +867,25 @@ altivec_yuv2packedX (SwsContext *c, G = vec_packclp (G0,G1); B = vec_packclp (B0,B1); - out_rgba (R,G,B,out); + switch(c->dstFormat) { + case IMGFMT_ABGR: out_abgr (R,G,B,out); break; + case IMGFMT_BGRA: out_bgra (R,G,B,out); break; + case IMGFMT_RGBA: out_rgba (R,G,B,out); break; + case IMGFMT_ARGB: out_argb (R,G,B,out); break; + case IMGFMT_RGB24: out_rgb24 (R,G,B,out); break; + case IMGFMT_BGR24: out_bgr24 (R,G,B,out); break; + default: + { + /* FIXME: either write more out_* macros or punt to yuv2packedXinC */ + static int printed_error_message; + if(!printed_error_message) { + MSG_ERR("altivec_yuv2packedX doesn't support %s output\n", + vo_format_name(c->dstFormat)); + printed_error_message=1; + } + return; + } + } } if (i < dstW) { @@ -927,7 +945,19 @@ altivec_yuv2packedX (SwsContext *c, B = vec_packclp (B0,B1); nout = (vector unsigned char *)scratch; - out_rgba (R,G,B,nout); + switch(c->dstFormat) { + case IMGFMT_ABGR: out_abgr (R,G,B,nout); break; + case IMGFMT_BGRA: out_bgra (R,G,B,nout); break; + case IMGFMT_RGBA: out_rgba (R,G,B,nout); break; + case IMGFMT_ARGB: out_argb (R,G,B,nout); break; + case IMGFMT_RGB24: out_rgb24 (R,G,B,nout); break; + case IMGFMT_BGR24: out_bgr24 (R,G,B,nout); break; + default: + /* Unreachable, I think. */ + MSG_ERR("altivec_yuv2packedX doesn't support %s output\n", + vo_format_name(c->dstFormat)); + return; + } memcpy (&((uint32_t*)dest)[i], scratch, (dstW-i)/4); } |