More tweaks

This commit is contained in:
Steve Underwood 2012-08-26 20:24:20 +08:00
parent e60d204a59
commit 3b4aafe945
2 changed files with 22 additions and 203 deletions

View File

@ -1,202 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="t38-terminal-tests"
ProjectGUID="{B5DECF33-1D06-459A-AE70-A06404909919}"
RootNamespace="t38terminaltests"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;..\src&quot;;&quot;..\spandsp-sim&quot;;..\..\libtiff\include;&quot;..\src\msvc&quot;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\src\Debug\spandsp.lib ..\spandsp-sim\Debug\spandsp.lib"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="fax_utils.c"
>
</File>
<File
RelativePath="..\src\msvc\getopt.c"
>
</File>
<File
RelativePath="media_monitor.cpp"
>
</File>
<File
RelativePath="t38_terminal_tests.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -45,6 +45,10 @@
#include "spandsp.h"
#if defined(SPANDSP_SUPPORT_TIFF_FX)
//#include <tif_dir.h>
#endif
//#define IN_FILE_NAME "../test-data/itu/t24/F21_200.TIF"
#define IN_FILE_NAME "../test-data/itu/t24/F21B400.TIF"
#define OUT_FILE_NAME "t42_tests_receive.tif"
@ -145,6 +149,7 @@ int main(int argc, char *argv[])
uint16_t *map_a;
uint16_t *map_b;
uint16_t *map_z;
uint32_t jpeg_table_len;
logging_state_t *logging;
printf("Demo of ITU/Lab library.\n");
@ -187,6 +192,7 @@ int main(int argc, char *argv[])
planar_config = 0;
TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &planar_config);
off = 0;
map_L = NULL;
map_a = NULL;
map_b = NULL;
@ -260,7 +266,19 @@ int main(int argc, char *argv[])
if (process_raw)
{
uint8_t *jpeg_table;
nstrips = TIFFNumberOfStrips(tif);
total_image_len = 0;
jpeg_table_len = 0;
if (TIFFGetField(tif, TIFFTAG_JPEGTABLES, &jpeg_table_len, &jpeg_table))
{
total_image_len += (jpeg_table_len - 4);
printf("JPEG tables %u\n", jpeg_table_len);
printf("YYY %d - %x %x %x %x\n", jpeg_table_len, jpeg_table[0], jpeg_table[1], jpeg_table[2], jpeg_table[3]);
}
for (i = 0, total_image_len = 0; i < nstrips; i++)
total_image_len += TIFFRawStripSize(tif, i);
data = malloc(total_image_len);
@ -272,6 +290,9 @@ int main(int argc, char *argv[])
return -1;
}
}
if (jpeg_table_len > 0)
memcpy(data, jpeg_table, jpeg_table_len - 2);
if (total_len != total_image_len)
printf("Size mismatch %ld %ld\n", total_len, total_image_len);
off = total_len;
@ -420,7 +441,7 @@ int main(int argc, char *argv[])
return 1;
off += bytes_per_row;
}
printf("total %d, off %ld\n", totdata, off);
printf("total %u, off %ld\n", totdata, off);
/* We now have the image in memory in RGB form */