]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Removed unnecessary fseeks from T.42, and change tried a test with different
authorSteve Underwood <steveu@haswell.coppice.org>
Fri, 16 Aug 2013 19:42:04 +0000 (03:42 +0800)
committerSteve Underwood <steveu@haswell.coppice.org>
Fri, 16 Aug 2013 19:42:04 +0000 (03:42 +0800)
default T.42 illuminant, to see if the colours suit screens better.

libs/spandsp/src/t42.c

index 3e7ea3070bf4780caa718512d5a4e116a3e78a7c..2fa943cb9c56541fed9172c93f3b84e47ea647d2 100644 (file)
@@ -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);
     }