[PATCH spice-server 2/2] jpeg-encoder: Remove JPEG_IMAGE_TYPE_RGB24

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Never used.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/jpeg-encoder.c | 16 ++--------------
 server/jpeg-encoder.h |  1 -
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/server/jpeg-encoder.c b/server/jpeg-encoder.c
index e6591876..a31d63d7 100644
--- a/server/jpeg-encoder.c
+++ b/server/jpeg-encoder.c
@@ -161,11 +161,6 @@ static void convert_BGRX32_to_RGB24(void *line, int width, uint8_t **out_line)
     }
 }
 
-static void convert_RGB24_to_RGB24(void *line, int width, uint8_t **out_line)
-{
-    *out_line = line;
-}
-
 
 #define FILL_LINES() {                                                  \
     if (lines == lines_end) {                                           \
@@ -186,9 +181,7 @@ static void do_jpeg_encode(JpegEncoder *jpeg, uint8_t *lines, unsigned int num_l
     width = jpeg->cur_image.width;
     stride = jpeg->cur_image.stride;
 
-    if (jpeg->cur_image.type != JPEG_IMAGE_TYPE_RGB24) {
-        RGB24_line = g_new(uint8_t, width*3);
-    }
+    RGB24_line = g_new(uint8_t, width*3);
 
     lines_end = lines + (stride * num_lines);
 
@@ -199,9 +192,7 @@ static void do_jpeg_encode(JpegEncoder *jpeg, uint8_t *lines, unsigned int num_l
         jpeg_write_scanlines(&jpeg->cinfo, row_pointer, 1);
     }
 
-    if (jpeg->cur_image.type != JPEG_IMAGE_TYPE_RGB24) {
-        g_free(RGB24_line);
-    }
+    g_free(RGB24_line);
 }
 
 int jpeg_encode(JpegEncoderContext *enc, int quality, JpegEncoderImageType type,
@@ -218,9 +209,6 @@ int jpeg_encode(JpegEncoderContext *enc, int quality, JpegEncoderImageType type,
     case JPEG_IMAGE_TYPE_RGB16:
         enc->cur_image.convert_line_to_RGB24 = convert_RGB16_to_RGB24;
         break;
-    case JPEG_IMAGE_TYPE_RGB24:
-        enc->cur_image.convert_line_to_RGB24 = convert_RGB24_to_RGB24;
-        break;
     case JPEG_IMAGE_TYPE_BGR24:
         enc->cur_image.convert_line_to_RGB24 = convert_BGR24_to_RGB24;
         break;
diff --git a/server/jpeg-encoder.h b/server/jpeg-encoder.h
index 0a1c2e78..4037a988 100644
--- a/server/jpeg-encoder.h
+++ b/server/jpeg-encoder.h
@@ -38,7 +38,6 @@ typedef enum {
     JPEG_IMAGE_TYPE_RGB16,
     /* in byte per color types, the notation is according to the order of the
        colors in the memory */
-    JPEG_IMAGE_TYPE_RGB24,
     JPEG_IMAGE_TYPE_BGR24,
     JPEG_IMAGE_TYPE_BGRX32,
 } JpegEncoderImageType;
-- 
2.17.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]