changeset 31232:9f894134a0b3

remove palette8torgb15 and palette8tobgr15 They contain exactly the same code as their 16bit variants, so this is effectively code de-duplication.
author siretart
date Tue, 01 Jun 2010 06:53:56 +0000
parents 77bdb012aaae
children 01fdbb0aaa5c
files libmpcodecs/vf_palette.c libswscale/rgb2rgb.c libswscale/rgb2rgb.h
diffstat 3 files changed, 0 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_palette.c	Mon May 31 21:24:00 2010 +0000
+++ b/libmpcodecs/vf_palette.c	Tue Jun 01 06:53:56 2010 +0000
@@ -114,11 +114,6 @@
 	// no stride conversion needed
 	switch(IMGFMT_RGB_DEPTH(dmpi->imgfmt)){
 	case 15:
-	    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 (IMGFMT_IS_BGR(dmpi->imgfmt))
 		palette8tobgr16(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
@@ -145,11 +140,6 @@
 	    unsigned char* dst=dmpi->planes[0]+y*dmpi->stride[0];
 	    switch(IMGFMT_RGB_DEPTH(dmpi->imgfmt)){
 	    case 15:
-		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 (IMGFMT_IS_BGR(dmpi->imgfmt))
 		    palette8tobgr16(src,dst,mpi->w,mpi->planes[1]);
--- a/libswscale/rgb2rgb.c	Mon May 31 21:24:00 2010 +0000
+++ b/libswscale/rgb2rgb.c	Tue Jun 01 06:53:56 2010 +0000
@@ -250,22 +250,6 @@
         ((uint16_t *)dst)[i] = bswap_16(((const uint16_t *)palette)[src[i]]);
 }
 
-/**
- * Palette is assumed to contain BGR15, see rgb32to15 to convert the palette.
- */
-void palette8torgb15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
-{
-    long i;
-    for (i=0; i<num_pixels; i++)
-        ((uint16_t *)dst)[i] = ((const uint16_t *)palette)[src[i]];
-}
-void palette8tobgr15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
-{
-    long i;
-    for (i=0; i<num_pixels; i++)
-        ((uint16_t *)dst)[i] = bswap_16(((const uint16_t *)palette)[src[i]]);
-}
-
 void rgb32to24(const uint8_t *src, uint8_t *dst, long src_size)
 {
     long i;
--- a/libswscale/rgb2rgb.h	Mon May 31 21:24:00 2010 +0000
+++ b/libswscale/rgb2rgb.h	Tue Jun 01 06:53:56 2010 +0000
@@ -70,8 +70,6 @@
 void palette8topacked24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
 void palette8torgb16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
 void palette8tobgr16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
-void palette8torgb15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
-void palette8tobgr15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
 
 /**
  * Height should be a multiple of 2 and width should be a multiple of 16.