This commit is contained in:
Steve Underwood 2012-08-08 21:16:38 +08:00 committed by Ken Rice
parent 35cf575e12
commit ffcf6443f0
4 changed files with 0 additions and 40 deletions

View File

@ -109,9 +109,7 @@ struct t4_rx_state_s
union union
{ {
t4_t6_decode_state_t t4_t6; t4_t6_decode_state_t t4_t6;
#if defined(SPANDSP_SUPPORT_T42)
t42_decode_state_t t42; t42_decode_state_t t42;
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
t43_decode_state_t t43; t43_decode_state_t t43;
#endif #endif

View File

@ -133,9 +133,7 @@ struct t4_tx_state_s
union union
{ {
t4_t6_encode_state_t t4_t6; t4_t6_encode_state_t t4_t6;
#if defined(SPANDSP_SUPPORT_T42)
t42_encode_state_t t42; t42_encode_state_t t42;
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
t43_encode_state_t t43; t43_encode_state_t t43;
#endif #endif

View File

@ -253,11 +253,9 @@ static int set_tiff_directory_info(t4_rx_state_t *s)
case T4_COMPRESSION_ITU_T6: case T4_COMPRESSION_ITU_T6:
TIFFSetField(t->tiff_file, TIFFTAG_IMAGELENGTH, t4_t6_decode_get_image_length(&s->decoder.t4_t6)); TIFFSetField(t->tiff_file, TIFFTAG_IMAGELENGTH, t4_t6_decode_get_image_length(&s->decoder.t4_t6));
break; break;
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
TIFFSetField(t->tiff_file, TIFFTAG_IMAGELENGTH, t42_decode_get_image_length(&s->decoder.t42)); TIFFSetField(t->tiff_file, TIFFTAG_IMAGELENGTH, t42_decode_get_image_length(&s->decoder.t42));
break; break;
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
TIFFSetField(t->tiff_file, TIFFTAG_IMAGELENGTH, t43_decode_get_image_length(&s->decoder.t43)); TIFFSetField(t->tiff_file, TIFFTAG_IMAGELENGTH, t43_decode_get_image_length(&s->decoder.t43));
@ -360,10 +358,8 @@ SPAN_DECLARE(int) t4_rx_put_byte(t4_rx_state_t *s, uint8_t byte)
case T4_COMPRESSION_ITU_T4_2D: case T4_COMPRESSION_ITU_T4_2D:
case T4_COMPRESSION_ITU_T6: case T4_COMPRESSION_ITU_T6:
return t4_t6_decode_put_byte(&s->decoder.t4_t6, byte); return t4_t6_decode_put_byte(&s->decoder.t4_t6, byte);
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
return t42_decode_put_byte(&s->decoder.t42, byte); return t42_decode_put_byte(&s->decoder.t42, byte);
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
return t43_decode_put_byte(&s->decoder.t43, byte); return t43_decode_put_byte(&s->decoder.t43, byte);
@ -385,10 +381,8 @@ SPAN_DECLARE(int) t4_rx_put_chunk(t4_rx_state_t *s, const uint8_t buf[], int len
case T4_COMPRESSION_ITU_T4_2D: case T4_COMPRESSION_ITU_T4_2D:
case T4_COMPRESSION_ITU_T6: case T4_COMPRESSION_ITU_T6:
return t4_t6_decode_put_chunk(&s->decoder.t4_t6, buf, len); return t4_t6_decode_put_chunk(&s->decoder.t4_t6, buf, len);
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
return t42_decode_put_chunk(&s->decoder.t42, buf, len); return t42_decode_put_chunk(&s->decoder.t42, buf, len);
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
return t43_decode_put_chunk(&s->decoder.t43, buf, len); return t43_decode_put_chunk(&s->decoder.t43, buf, len);
@ -462,7 +456,6 @@ SPAN_DECLARE(int) t4_rx_set_rx_encoding(t4_rx_state_t *s, int encoding)
} }
s->line_encoding = encoding; s->line_encoding = encoding;
return t4_t6_decode_set_encoding(&s->decoder.t4_t6, encoding); return t4_t6_decode_set_encoding(&s->decoder.t4_t6, encoding);
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
switch (s->line_encoding) switch (s->line_encoding)
{ {
@ -478,7 +471,6 @@ SPAN_DECLARE(int) t4_rx_set_rx_encoding(t4_rx_state_t *s, int encoding)
} }
s->line_encoding = encoding; s->line_encoding = encoding;
return 0; return 0;
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
switch (s->line_encoding) switch (s->line_encoding)
@ -534,10 +526,8 @@ SPAN_DECLARE(int) t4_rx_set_row_write_handler(t4_rx_state_t *s, t4_row_write_han
case T4_COMPRESSION_ITU_T4_2D: case T4_COMPRESSION_ITU_T4_2D:
case T4_COMPRESSION_ITU_T6: case T4_COMPRESSION_ITU_T6:
return t4_t6_decode_set_row_write_handler(&s->decoder.t4_t6, handler, user_data); return t4_t6_decode_set_row_write_handler(&s->decoder.t4_t6, handler, user_data);
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
return t42_decode_set_row_write_handler(&s->decoder.t42, handler, user_data); return t42_decode_set_row_write_handler(&s->decoder.t42, handler, user_data);
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
return t43_decode_set_row_write_handler(&s->decoder.t43, handler, user_data); return t43_decode_set_row_write_handler(&s->decoder.t43, handler, user_data);
@ -569,13 +559,11 @@ SPAN_DECLARE(void) t4_rx_get_transfer_statistics(t4_rx_state_t *s, t4_stats_t *t
t->bad_rows = s->decoder.t4_t6.bad_rows; t->bad_rows = s->decoder.t4_t6.bad_rows;
t->longest_bad_row_run = s->decoder.t4_t6.longest_bad_row_run; t->longest_bad_row_run = s->decoder.t4_t6.longest_bad_row_run;
break; break;
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
t->width = t42_decode_get_image_width(&s->decoder.t42); t->width = t42_decode_get_image_width(&s->decoder.t42);
t->length = t42_decode_get_image_length(&s->decoder.t42); t->length = t42_decode_get_image_length(&s->decoder.t42);
t->line_image_size = t42_decode_get_compressed_image_size(&s->decoder.t42)/8; t->line_image_size = t42_decode_get_compressed_image_size(&s->decoder.t42)/8;
break; break;
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
t->width = t43_decode_get_image_width(&s->decoder.t43); t->width = t43_decode_get_image_width(&s->decoder.t43);
@ -604,11 +592,9 @@ SPAN_DECLARE(int) t4_rx_start_page(t4_rx_state_t *s)
case T4_COMPRESSION_ITU_T6: case T4_COMPRESSION_ITU_T6:
t4_t6_decode_restart(&s->decoder.t4_t6, s->image_width); t4_t6_decode_restart(&s->decoder.t4_t6, s->image_width);
break; break;
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
t42_decode_restart(&s->decoder.t42); t42_decode_restart(&s->decoder.t42);
break; break;
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
t43_decode_restart(&s->decoder.t43); t43_decode_restart(&s->decoder.t43);
@ -663,12 +649,10 @@ SPAN_DECLARE(int) t4_rx_end_page(t4_rx_state_t *s)
t4_t6_decode_put_byte(&s->decoder.t4_t6, SIG_STATUS_END_OF_DATA); t4_t6_decode_put_byte(&s->decoder.t4_t6, SIG_STATUS_END_OF_DATA);
length = t4_t6_decode_get_image_length(&s->decoder.t4_t6); length = t4_t6_decode_get_image_length(&s->decoder.t4_t6);
break; break;
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
t42_decode_put_byte(&s->decoder.t42, SIG_STATUS_END_OF_DATA); t42_decode_put_byte(&s->decoder.t42, SIG_STATUS_END_OF_DATA);
length = t42_decode_get_image_length(&s->decoder.t42); length = t42_decode_get_image_length(&s->decoder.t42);
break; break;
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
t43_decode_put_byte(&s->decoder.t43, SIG_STATUS_END_OF_DATA); t43_decode_put_byte(&s->decoder.t43, SIG_STATUS_END_OF_DATA);
@ -759,10 +743,8 @@ SPAN_DECLARE(int) t4_rx_release(t4_rx_state_t *s)
case T4_COMPRESSION_ITU_T4_2D: case T4_COMPRESSION_ITU_T4_2D:
case T4_COMPRESSION_ITU_T6: case T4_COMPRESSION_ITU_T6:
return t4_t6_decode_release(&s->decoder.t4_t6); return t4_t6_decode_release(&s->decoder.t4_t6);
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
return t42_decode_release(&s->decoder.t42); return t42_decode_release(&s->decoder.t42);
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
return t43_decode_release(&s->decoder.t43); return t43_decode_release(&s->decoder.t43);

View File

@ -524,10 +524,8 @@ static int set_row_read_handler(t4_tx_state_t *s, t4_row_read_handler_t handler,
case T4_COMPRESSION_ITU_T4_2D: case T4_COMPRESSION_ITU_T4_2D:
case T4_COMPRESSION_ITU_T6: case T4_COMPRESSION_ITU_T6:
return t4_t6_encode_set_row_read_handler(&s->encoder.t4_t6, handler, user_data); return t4_t6_encode_set_row_read_handler(&s->encoder.t4_t6, handler, user_data);
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
return t42_encode_set_row_read_handler(&s->encoder.t42, handler, user_data); return t42_encode_set_row_read_handler(&s->encoder.t42, handler, user_data);
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
return t43_encode_set_row_read_handler(&s->encoder.t43, handler, user_data); return t43_encode_set_row_read_handler(&s->encoder.t43, handler, user_data);
@ -686,7 +684,6 @@ SPAN_DECLARE(int) t4_tx_set_tx_encoding(t4_tx_state_t *s, int encoding)
} }
s->line_encoding = encoding; s->line_encoding = encoding;
return t4_t6_encode_set_encoding(&s->encoder.t4_t6, encoding); return t4_t6_encode_set_encoding(&s->encoder.t4_t6, encoding);
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
switch (s->line_encoding) switch (s->line_encoding)
{ {
@ -698,7 +695,6 @@ SPAN_DECLARE(int) t4_tx_set_tx_encoding(t4_tx_state_t *s, int encoding)
} }
s->line_encoding = encoding; s->line_encoding = encoding;
return 0; return 0;
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
switch (s->line_encoding) switch (s->line_encoding)
@ -753,11 +749,9 @@ SPAN_DECLARE(void) t4_tx_set_image_width(t4_tx_state_t *s, int image_width)
case T4_COMPRESSION_ITU_T6: case T4_COMPRESSION_ITU_T6:
t4_t6_encode_set_image_width(&s->encoder.t4_t6, image_width); t4_t6_encode_set_image_width(&s->encoder.t4_t6, image_width);
break; break;
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
t42_encode_set_image_width(&s->encoder.t42, image_width); t42_encode_set_image_width(&s->encoder.t42, image_width);
break; break;
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
t43_encode_set_image_width(&s->encoder.t43, image_width); t43_encode_set_image_width(&s->encoder.t43, image_width);
@ -776,11 +770,9 @@ static void t4_tx_set_image_length(t4_tx_state_t *s, int image_length)
s->image_length = image_length; s->image_length = image_length;
switch (s->line_encoding) switch (s->line_encoding)
{ {
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
t42_encode_set_image_length(&s->encoder.t42, image_length); t42_encode_set_image_length(&s->encoder.t42, image_length);
break; break;
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
t43_encode_set_image_length(&s->encoder.t43, image_length); t43_encode_set_image_length(&s->encoder.t43, image_length);
@ -886,13 +878,11 @@ SPAN_DECLARE(void) t4_tx_get_transfer_statistics(t4_tx_state_t *s, t4_stats_t *t
t->length = t4_t6_encode_get_image_length(&s->encoder.t4_t6); t->length = t4_t6_encode_get_image_length(&s->encoder.t4_t6);
t->line_image_size = t4_t6_encode_get_compressed_image_size(&s->encoder.t4_t6)/8; t->line_image_size = t4_t6_encode_get_compressed_image_size(&s->encoder.t4_t6)/8;
break; break;
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
t->width = t42_encode_get_image_width(&s->encoder.t42); t->width = t42_encode_get_image_width(&s->encoder.t42);
t->length = t42_encode_get_image_length(&s->encoder.t42); t->length = t42_encode_get_image_length(&s->encoder.t42);
t->line_image_size = t42_encode_get_compressed_image_size(&s->encoder.t42)/8; t->line_image_size = t42_encode_get_compressed_image_size(&s->encoder.t42)/8;
break; break;
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
t->width = t43_encode_get_image_width(&s->encoder.t43); t->width = t43_encode_get_image_width(&s->encoder.t43);
@ -930,10 +920,8 @@ SPAN_DECLARE(int) t4_tx_get_byte(t4_tx_state_t *s)
case T4_COMPRESSION_ITU_T4_2D: case T4_COMPRESSION_ITU_T4_2D:
case T4_COMPRESSION_ITU_T6: case T4_COMPRESSION_ITU_T6:
return t4_t6_encode_get_byte(&s->encoder.t4_t6); return t4_t6_encode_get_byte(&s->encoder.t4_t6);
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
return t42_encode_get_byte(&s->encoder.t42); return t42_encode_get_byte(&s->encoder.t42);
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
return t43_encode_get_byte(&s->encoder.t43); return t43_encode_get_byte(&s->encoder.t43);
@ -954,10 +942,8 @@ SPAN_DECLARE(int) t4_tx_get_chunk(t4_tx_state_t *s, uint8_t buf[], int max_len)
case T4_COMPRESSION_ITU_T4_2D: case T4_COMPRESSION_ITU_T4_2D:
case T4_COMPRESSION_ITU_T6: case T4_COMPRESSION_ITU_T6:
return t4_t6_encode_get_chunk(&s->encoder.t4_t6, buf, max_len); return t4_t6_encode_get_chunk(&s->encoder.t4_t6, buf, max_len);
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
return t42_encode_get_chunk(&s->encoder.t42, buf, max_len); return t42_encode_get_chunk(&s->encoder.t42, buf, max_len);
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
return t43_encode_get_chunk(&s->encoder.t43, buf, max_len); return t43_encode_get_chunk(&s->encoder.t43, buf, max_len);
@ -995,11 +981,9 @@ SPAN_DECLARE(int) t4_tx_start_page(t4_tx_state_t *s)
case T4_COMPRESSION_ITU_T6: case T4_COMPRESSION_ITU_T6:
t4_t6_encode_restart(&s->encoder.t4_t6, s->image_width); t4_t6_encode_restart(&s->encoder.t4_t6, s->image_width);
break; break;
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
t42_encode_restart(&s->encoder.t42, s->image_width, s->image_length); t42_encode_restart(&s->encoder.t42, s->image_width, s->image_length);
break; break;
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
t43_encode_restart(&s->encoder.t43, s->image_width, s->image_length); t43_encode_restart(&s->encoder.t43, s->image_width, s->image_length);
@ -1106,10 +1090,8 @@ SPAN_DECLARE(int) t4_tx_release(t4_tx_state_t *s)
case T4_COMPRESSION_ITU_T4_2D: case T4_COMPRESSION_ITU_T4_2D:
case T4_COMPRESSION_ITU_T6: case T4_COMPRESSION_ITU_T6:
return t4_t6_encode_release(&s->encoder.t4_t6); return t4_t6_encode_release(&s->encoder.t4_t6);
#if defined(SPANDSP_SUPPORT_T42)
case T4_COMPRESSION_ITU_T42: case T4_COMPRESSION_ITU_T42:
return t42_encode_release(&s->encoder.t42); return t42_encode_release(&s->encoder.t42);
#endif
#if defined(SPANDSP_SUPPORT_T43) #if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_ITU_T43: case T4_COMPRESSION_ITU_T43:
return t43_encode_release(&s->encoder.t43); return t43_encode_release(&s->encoder.t43);