From: Steve Underwood Date: Fri, 16 Aug 2013 19:42:04 +0000 (+0800) Subject: Removed unnecessary fseeks from T.42, and change tried a test with different X-Git-Tag: v1.5.5~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6daf13208103b6e9a9412fbb2dfcedc5146c9cfc;p=thirdparty%2Ffreeswitch.git Removed unnecessary fseeks from T.42, and change tried a test with different default T.42 illuminant, to see if the colours suit screens better. --- diff --git a/libs/spandsp/src/t42.c b/libs/spandsp/src/t42.c index 3e7ea3070b..2fa943cb9c 100644 --- a/libs/spandsp/src/t42.c +++ b/libs/spandsp/src/t42.c @@ -949,6 +949,7 @@ SPAN_DECLARE(int) t42_encode_restart(t42_encode_state_t *s, uint32_t image_width /* ITULAB */ /* Illuminant D50 */ set_lab_illuminant(&s->lab, 96.422f, 100.000f, 82.521f); +set_lab_illuminant(&s->lab, 95.047f, 100.000f, 108.883f); set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, false); } s->compressed_image_size = 0; @@ -965,12 +966,6 @@ SPAN_DECLARE(int) t42_encode_restart(t42_encode_state_t *s, uint32_t image_width span_log(&s->logging, SPAN_LOG_FLOW, "Failed to open_memstream().\n"); return -1; } - if (fseek(s->out, 0, SEEK_SET) != 0) - { - fclose(s->out); - s->out = NULL; - return -1; - } #else if ((s->out = tmpfile()) == NULL) { @@ -1114,14 +1109,6 @@ static int t42_itulab_jpeg_to_srgb(t42_decode_state_t *s) for (i = 0; i < 16; i++) jpeg_save_markers(&s->decompressor, JPEG_APP0 + i, 0xFFFF); - /* Rewind the file */ - if (fseek(s->in, 0, SEEK_SET) != 0) - { - fclose(s->in); - s->in = NULL; - return -1; - } - /* Take the header */ jpeg_read_header(&s->decompressor, false); /* Sanity check and parameter check */ @@ -1328,6 +1315,7 @@ SPAN_DECLARE(int) t42_decode_restart(t42_decode_state_t *s) /* ITULAB */ /* Illuminant D50 */ set_lab_illuminant(&s->lab, 96.422f, 100.000f, 82.521f); +set_lab_illuminant(&s->lab, 95.047f, 100.000f, 108.883f); set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, false); }