Skip to content

Commit

Permalink
Update byte compressor profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Eilemann authored and Stefan Eilemann committed Oct 7, 2016
1 parent 0e88791 commit 8fbb897
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 41 deletions.
6 changes: 3 additions & 3 deletions pression/compressor/compressorFastLZ.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/* Copyright (c) 2012-2013, Stefan Eilemann <[email protected]>
/* Copyright (c) 2012-2016, Stefan Eilemann <[email protected]>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 2.1 as published
Expand Down Expand Up @@ -30,8 +30,8 @@ static void _getInfo( EqCompressorInfo* const info )
info->version = EQ_COMPRESSOR_VERSION;
info->capabilities = EQ_COMPRESSOR_DATA_1D | EQ_COMPRESSOR_DATA_2D;
info->quality = 1.f;
info->ratio = .50f;
info->speed = .22f;
info->ratio = .60f;
info->speed = .26f;
info->name = EQ_COMPRESSOR_FASTLZ_BYTE;
info->tokenType = EQ_COMPRESSOR_DATATYPE_BYTE;
}
Expand Down
6 changes: 3 additions & 3 deletions pression/compressor/compressorLZF.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/* Copyright (c) 2012-2013, Stefan Eilemann <[email protected]>
/* Copyright (c) 2012-2016, Stefan Eilemann <[email protected]>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 2.1 as published
Expand Down Expand Up @@ -32,8 +32,8 @@ static void _getInfo( EqCompressorInfo* const info )
info->version = EQ_COMPRESSOR_VERSION;
info->capabilities = EQ_COMPRESSOR_DATA_1D | EQ_COMPRESSOR_DATA_2D;
info->quality = 1.f;
info->ratio = .52f;
info->speed = .21f;
info->ratio = .60f;
info->speed = .26f;
info->name = EQ_COMPRESSOR_LZF_BYTE;
info->tokenType = EQ_COMPRESSOR_DATATYPE_BYTE;
}
Expand Down
6 changes: 3 additions & 3 deletions pression/compressor/compressorRLEB.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/* Copyright (c) 2010, Cedric Stalder <[email protected]>
* 2010-2013, Stefan Eilemann <[email protected]>
/* Copyright (c) 2010-2016, Cedric Stalder <[email protected]>
* Stefan Eilemann <[email protected]>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 2.1 as published
Expand Down Expand Up @@ -32,7 +32,7 @@ namespace plugin
{
namespace
{
REGISTER_ENGINE( CompressorRLEB, BYTE, BYTE, 1., 0.93, 1., false );
REGISTER_ENGINE( CompressorRLEB, BYTE, BYTE, 1., 0.97, 1., false );
}

template< typename T >
Expand Down
6 changes: 3 additions & 3 deletions pression/compressor/compressorSnappy.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/* Copyright (c) 2012-2013, Stefan Eilemann <[email protected]>
/* Copyright (c) 2012-2016, Stefan Eilemann <[email protected]>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 2.1 as published
Expand Down Expand Up @@ -31,8 +31,8 @@ static void _getInfo( EqCompressorInfo* const info )
info->version = EQ_COMPRESSOR_VERSION;
info->capabilities = EQ_COMPRESSOR_DATA_1D | EQ_COMPRESSOR_DATA_2D;
info->quality = 1.f;
info->ratio = .53f;
info->speed = .34f;
info->ratio = .60f;
info->speed = .55f;
info->name = EQ_COMPRESSOR_SNAPPY_BYTE;
info->tokenType = EQ_COMPRESSOR_DATATYPE_BYTE;
}
Expand Down
6 changes: 3 additions & 3 deletions pression/compressor/compressorZSTD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ static void _getInfo( EqCompressorInfo* const info )
info->version = EQ_COMPRESSOR_VERSION;
info->capabilities = EQ_COMPRESSOR_DATA_1D | EQ_COMPRESSOR_DATA_2D;
info->quality = 1.f;
info->ratio = .37f;
info->speed = .17f;
info->ratio = .47f;
info->speed = .25f;
info->name = EQ_COMPRESSOR_ZSTD_BYTE;
info->tokenType = EQ_COMPRESSOR_DATATYPE_BYTE;
}
Expand Down Expand Up @@ -60,7 +60,7 @@ void CompressorZSTD::compress( const void* const inData,
size_t size = ZSTD_compressBound( nPixels );
_results[0]->reserve( size );

size = ZSTD_compress( _results[0]->getData(), size, inData, nPixels, 0 );
size = ZSTD_compress( _results[0]->getData(), size, inData, nPixels, 2 );
assert( size != 0 );
_results[0]->setSize( size );
}
Expand Down
57 changes: 31 additions & 26 deletions tests/compressor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/* Copyright (c) 2010, Cedric Stalder <[email protected]>
* 2010-2014, Stefan Eilemann <[email protected]>
/* Copyright (c) 2010-2016, Cedric Stalder <[email protected]>
* Stefan Eilemann <[email protected]>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 2.1 as published
Expand Down Expand Up @@ -41,9 +41,7 @@ void _testRandom();
void _testData( const uint32_t nameCompressor, const std::string& name,
const uint8_t* data, const uint64_t size );

std::vector< uint32_t > getCompressorNames( const uint32_t tokenType );
Strings getFiles( const std::string& path, Strings& files,
const std::string& ext );
Strings getFiles( Strings& files, const std::string& ext );

PluginRegistry registry;
uint64_t _result = 0;
Expand All @@ -55,6 +53,17 @@ float _baseTime = 0.f;
int main( int, char** )
{
registry.addDirectory( std::string( PRESSION_BUILD_DIR ) + "/lib" );
registry.addDirectory( "../bin" );
registry.addDirectory( "../lib" );
registry.addDirectory( "../../install/bin" );
registry.addDirectory( "../../install/lib" );
registry.addDirectory( "images" );
registry.addDirectory(
"/nfs4/bbp.epfl.ch/visualization/resources/meshes/mediumPly/" );
registry.addDirectory(
"/nfs4/bbp.epfl.ch/visualization/circuits/KaustCircuit/meshes" );
registry.addDirectory(
"/nfs4/bbp.epfl.ch/visualization/circuits/KaustCircuit/simulations/run_1k/20.02.13/" );
TEST( registry.addLunchboxPlugins( ));
registry.init();

Expand Down Expand Up @@ -151,26 +160,22 @@ void _testData( const uint32_t compressorName, const std::string& name,

void _testFile()
{
std::vector< uint32_t >compressorNames =
std::vector< uint32_t > compressorNames =
getCompressorNames( EQ_COMPRESSOR_DATATYPE_BYTE );

std::vector< std::string > files;

getFiles( "", files, ".*\\.dll" );
getFiles( "", files, ".*\\.exe" );
getFiles( "", files, ".*\\.so" );
getFiles( "../bin", files, ".*\\.dll" );
getFiles( "../lib", files, ".*\\.so" );
getFiles( "../../install/bin", files, ".*\\.dll" );
getFiles( "../../install/lib", files, ".*\\.so" );
getFiles( "images", files, ".*\\.rgb" );
getFiles( "", files, ".*\\.a" );
getFiles( "", files, ".*\\.dylib" );
getFiles( "/Users/eile/Library/Models/mediumPly/", files, ".*\\.bin" );
getFiles( "/Users/eile/Library/Models/mediumPly/", files, ".*\\.ply" );
getFiles( "/home/eilemann/Software/Models/mediumPly/", files, ".*\\.bin" );
getFiles( "/home/eilemann/Software/Models/mediumPly/", files, ".*\\.ply" );

getFiles( files, ".*\\.dll" );
getFiles( files, ".*\\.exe" );
getFiles( files, ".*\\.so" );
getFiles( files, ".*\\.a" );
getFiles( files, ".*\\.dylib" );
getFiles( files, ".*\\.rgb" );
getFiles( files, ".*\\.bin" );
getFiles( files, ".*\\.ply" );
getFiles( files, ".*\\.bbp" );

#if 1
// Limit to 30 files using a pseudo-random selection for reproducability
const size_t maxFiles = 30;
if( files.size() > maxFiles )
Expand All @@ -179,6 +184,7 @@ void _testFile()
for( size_t i = 0; i < cut; ++i )
files.erase( files.begin() + (i * 997 /*prime*/) % files.size( ));
}
#endif

std::cout.setf( std::ios::right, std::ios::adjustfield );
std::cout.precision( 5 );
Expand All @@ -204,6 +210,9 @@ void _testFile()
}

const size_t size = file.getSize();
if( size > LB_1GB )
continue;

const std::string name = lunchbox::getFilename( *j );

_testData( *i, name, data, size );
Expand Down Expand Up @@ -265,13 +274,9 @@ void _testRandom()
delete [] data;
}

Strings getFiles( const std::string& path, Strings& files,
const std::string& ext )
Strings getFiles( Strings& files, const std::string& ext )
{
Strings paths = registry.getDirectories();
if( !path.empty( ))
paths.push_back( path );

for( uint64_t j = 0; j < paths.size(); ++j )
{
const Strings& candidates = lunchbox::searchDirectory( paths[j], ext );
Expand Down

0 comments on commit 8fbb897

Please sign in to comment.