summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-09-13 18:36:04 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-09-13 18:36:04 +0000
commit62e3a9e6a6847680721a3065cd0ec16efe274054 (patch)
treed2311b7746d960dae769752bc63149e62add70b8
parent7d44f8c906d83abe8df52bc12a461e5c1057169d (diff)
downloadmpv-62e3a9e6a6847680721a3065cd0ec16efe274054.tar.bz2
mpv-62e3a9e6a6847680721a3065cd0ec16efe274054.tar.xz
Deobfuscate: use IMGFMT_RGB_DEPTH and IMGFMT_IS_BGR
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24451 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libmpcodecs/vf_palette.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libmpcodecs/vf_palette.c b/libmpcodecs/vf_palette.c
index 7aadc6ca87..7685c29f5a 100644
--- a/libmpcodecs/vf_palette.c
+++ b/libmpcodecs/vf_palette.c
@@ -93,27 +93,27 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
if(mpi->w==mpi->stride[0] && dmpi->w*(dmpi->bpp>>3)==dmpi->stride[0]){
// no stride conversion needed
- switch(dmpi->imgfmt&255){
+ switch(IMGFMT_RGB_DEPTH(dmpi->imgfmt)){
case 15:
- if (dmpi->flags & MP_IMGFLAG_SWAPPED)
+ if (IMGFMT_IS_BGR(dmpi->imgfmt))
palette8tobgr15(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
else
palette8torgb15(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
break;
case 16:
- if (dmpi->flags & MP_IMGFLAG_SWAPPED)
+ if (IMGFMT_IS_BGR(dmpi->imgfmt))
palette8tobgr16(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
else
palette8torgb16(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
break;
case 24:
- if (dmpi->flags & MP_IMGFLAG_SWAPPED)
+ if (IMGFMT_IS_BGR(dmpi->imgfmt))
palette8tobgr24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
else
palette8torgb24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
break;
case 32:
- if (dmpi->flags & MP_IMGFLAG_SWAPPED)
+ if (IMGFMT_IS_BGR(dmpi->imgfmt))
palette8tobgr32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
else
palette8torgb32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
@@ -124,27 +124,27 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
for(y=0;y<mpi->h;y++){
unsigned char* src=mpi->planes[0]+y*mpi->stride[0];
unsigned char* dst=dmpi->planes[0]+y*dmpi->stride[0];
- switch(dmpi->imgfmt&255){
+ switch(IMGFMT_RGB_DEPTH(dmpi->imgfmt)){
case 15:
- if (dmpi->flags & MP_IMGFLAG_SWAPPED)
+ if (IMGFMT_IS_BGR(dmpi->imgfmt))
palette8tobgr15(src,dst,mpi->w,mpi->planes[1]);
else
palette8torgb15(src,dst,mpi->w,mpi->planes[1]);
break;
case 16:
- if (dmpi->flags & MP_IMGFLAG_SWAPPED)
+ if (IMGFMT_IS_BGR(dmpi->imgfmt))
palette8tobgr16(src,dst,mpi->w,mpi->planes[1]);
else
palette8torgb16(src,dst,mpi->w,mpi->planes[1]);
break;
case 24:
- if (dmpi->flags & MP_IMGFLAG_SWAPPED)
+ if (IMGFMT_IS_BGR(dmpi->imgfmt))
palette8tobgr24(src,dst,mpi->w,mpi->planes[1]);
else
palette8torgb24(src,dst,mpi->w,mpi->planes[1]);
break;
case 32:
- if (dmpi->flags & MP_IMGFLAG_SWAPPED)
+ if (IMGFMT_IS_BGR(dmpi->imgfmt))
palette8tobgr32(src,dst,mpi->w,mpi->planes[1]);
else
palette8torgb32(src,dst,mpi->w,mpi->planes[1]);