[Spice-devel] [PATCH spice-server 2/2] jpeg-encoder: Remove JPEG_IMAGE_TYPE_RGB24
Christophe Fergeau
cfergeau at redhat.com
Tue Jun 26 12:59:38 UTC 2018
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
On Tue, Jun 19, 2018 at 11:05:25AM +0100, Frediano Ziglio wrote:
> Never used.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> 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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180626/32c421bf/attachment.sig>
More information about the Spice-devel
mailing list