Skip to content

Commit

Permalink
fix CompressonatorLib.sln build: update header files for reserved new…
Browse files Browse the repository at this point in the history
… codec.
  • Loading branch information
xooiamd committed May 17, 2018
1 parent d89185f commit 5ab39d9
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 65 deletions.
4 changes: 2 additions & 2 deletions Compressonator/Header/Codec/ETC/Codec_ETC2_RGB.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CCodec_ETC2_RGB : public CCodec_ETC2
CMP_BYTE nBlockWidth, CMP_BYTE nBlockHeight, CMP_BYTE nBlockDepth,
CMP_DWORD dwWidth, CMP_DWORD dwHeight, CMP_DWORD dwPitch = 0, CMP_BYTE* pData = 0) const;

virtual CodecError Compress(CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = CMP_NULL, CMP_DWORD_PTR pUser2 = CMP_NULL);
virtual CodecError Decompress(CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = CMP_NULL, CMP_DWORD_PTR pUser2 = CMP_NULL);
virtual CodecError Compress(CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = NULL, CMP_DWORD_PTR pUser2 = NULL);
virtual CodecError Decompress(CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = NULL, CMP_DWORD_PTR pUser2 = NULL);
};
#endif // !defined(_Codec_ETC2_RGB_H_INCLUDED_)
4 changes: 2 additions & 2 deletions Compressonator/Header/Codec/ETC/Codec_ETC_RGB.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CCodec_ETC_RGB : public CCodec_ETC
CMP_BYTE nBlockWidth, CMP_BYTE nBlockHeight, CMP_BYTE nBlockDepth,
CMP_DWORD dwWidth, CMP_DWORD dwHeight, CMP_DWORD dwPitch = 0, CMP_BYTE* pData = 0) const;

virtual CodecError Compress(CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = CMP_NULL, CMP_DWORD_PTR pUser2 = CMP_NULL);
virtual CodecError Decompress(CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = CMP_NULL, CMP_DWORD_PTR pUser2 = CMP_NULL);
virtual CodecError Compress(CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = NULL, CMP_DWORD_PTR pUser2 = NULL);
virtual CodecError Decompress(CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = NULL, CMP_DWORD_PTR pUser2 = NULL);
};
#endif // !defined(_Codec_ETC_RGB_H_INCLUDED_)
59 changes: 44 additions & 15 deletions Compressonator/Header/Codec/GT/Codec_GT.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions :
//
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
Expand All @@ -35,6 +35,19 @@

#include <thread>

struct GTEncodeThreadParam
{
GTBlockEncoder *encoder;
#ifdef USE_GT_HDR
CMP_FLOAT in[MAX_SUBSET_SIZE][MAX_DIMENSION_BIG];
#else
CMP_BYTE in[MAX_SUBSET_SIZE][MAX_DIMENSION_BIG];
#endif
CMP_BYTE *out;
volatile CMP_BOOL run;
volatile CMP_BOOL exit;
};

class CCodec_GT : public CCodec_DXTC
{
public:
Expand All @@ -46,31 +59,47 @@ class CCodec_GT : public CCodec_DXTC
virtual bool SetParameter(const CMP_CHAR* /*pszParamName*/, CODECFLOAT /*fValue*/);

// Required interfaces
virtual CodecError Compress (CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = CMP_NULL, CMP_DWORD_PTR pUser2 = CMP_NULL);
virtual CodecError Compress_Fast (CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = CMP_NULL, CMP_DWORD_PTR pUser2 = CMP_NULL);
virtual CodecError Compress_SuperFast (CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = CMP_NULL, CMP_DWORD_PTR pUser2 = CMP_NULL);
virtual CodecError Decompress (CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = CMP_NULL, CMP_DWORD_PTR pUser2 = CMP_NULL);
virtual CodecError Compress(CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = NULL, CMP_DWORD_PTR pUser2 = NULL);
virtual CodecError Compress_Fast(CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = NULL, CMP_DWORD_PTR pUser2 = NULL);
virtual CodecError Compress_SuperFast(CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = NULL, CMP_DWORD_PTR pUser2 = NULL);
virtual CodecError Decompress(CCodecBuffer& bufferIn, CCodecBuffer& bufferOut, Codec_Feedback_Proc pFeedbackProc = NULL, CMP_DWORD_PTR pUser1 = NULL, CMP_DWORD_PTR pUser2 = NULL);


private:

GTEncodeThreadParam *m_EncodeParameterStorage;

// NGT Quality level
double m_quality;
double m_performance;
double m_errorThreshold;

// GT User configurable variables
WORD m_NumThreads;
CMP_WORD m_NumThreads;

// GT Internal status
BOOL m_LibraryInitialized;
BOOL m_Use_MultiThreading;
WORD m_NumEncodingThreads;
WORD m_LiveThreads;
WORD m_LastThread;
// GT Internal status
CMP_BOOL m_LibraryInitialized;
CMP_BOOL m_Use_MultiThreading;
CMP_WORD m_NumEncodingThreads;
CMP_WORD m_LiveThreads;
CMP_WORD m_LastThread;

// GT Encoders and decoders: for encding use the interfaces below
std::thread* m_EncodingThreadHandle;
std::thread* m_EncodingThreadHandle;
GTBlockEncoder* m_encoder[128];
GTBlockDecoder* m_decoder;

// Encoder interfaces
CodecError InitializeGTLibrary();
CodecError EncodeGTBlock(CMP_BYTE in[MAX_SUBSET_SIZE][MAX_DIMENSION_BIG],BYTE *out);
CodecError EncodeGTBlock(
#ifdef USE_GT_HDR
CMP_FLOAT in[MAX_SUBSET_SIZE][MAX_DIMENSION_BIG],
CMP_FLOAT *out
#else
CMP_BYTE in[MAX_SUBSET_SIZE][MAX_DIMENSION_BIG],
CMP_BYTE *out
#endif
);
CodecError FinishGTEncoding(void);
};

Expand Down
16 changes: 9 additions & 7 deletions Compressonator/Header/Codec/GT/GT_Definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@
#ifndef _GT_DEFINITIONS_H_
#define _GT_DEFINITIONS_H_

#include <cstdint>

typedef std::uint8_t BYTE;
typedef std::uint16_t WORD;
typedef std::uint32_t DWORD;
typedef std::int32_t LONG;
typedef std::int32_t BOOL;
#include "Common.h"
// #define USE_GT_HDR

#define TRUE 1
#define FALSE 0
Expand All @@ -48,4 +43,11 @@ typedef std::int32_t BOOL;

#define MAX_DIMENSION_BIG 4

#ifndef min

#define min(a,b) ((a) < (b) ? (a) : (b))
#define max(a,b) ((a) > (b) ? (a) : (b))

#endif

#endif
4 changes: 2 additions & 2 deletions Compressonator/Source/Codec/GT/GT_Decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include "GT_Definitions.h"
#include "GT_Decode.h"

void GTBlockDecoder::DecompressBlock(BYTE out[MAX_SUBSET_SIZE][MAX_DIMENSION_BIG],
BYTE in[COMPRESSED_BLOCK_SIZE])
void GTBlockDecoder::DecompressBlock(CMP_BYTE out[MAX_SUBSET_SIZE][MAX_DIMENSION_BIG],
CMP_BYTE in[COMPRESSED_BLOCK_SIZE])
{
// Reserved for new code
}
5 changes: 2 additions & 3 deletions Compressonator/Source/Codec/GT/GT_Encode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
// SSE Implementation
#include <immintrin.h>

double GTBlockEncoder::CompressBlock(CMP_BYTE in[MAX_SUBSET_SIZE][MAX_DIMENSION_BIG], BYTE out[COMPRESSED_BLOCK_SIZE])
double GTBlockEncoder::CompressBlock(CMP_BYTE in[MAX_SUBSET_SIZE][MAX_DIMENSION_BIG], CMP_BYTE out[COMPRESSED_BLOCK_SIZE])
{
// Reserved for new code
return (0);
}

void GTCompressBlockSSE(DWORD *block_32, DWORD *block_dxtc)
void GTCompressBlockSSE(CMP_DWORD *block_32, CMP_DWORD *block_dxtc)
{

}

68 changes: 34 additions & 34 deletions Compressonator/VS2015/CompressonatorLib.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
VisualStudioVersion = 14.0.25402.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompressonatorLib", "CompressonatorLib.vcxproj", "{B439F755-9F29-480A-BB3E-C055C682E796}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Compressonator", "CompressonatorLib.vcxproj", "{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -25,38 +25,38 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug_DLL|Win32.ActiveCfg = Debug_DLL|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug_DLL|Win32.Build.0 = Debug_DLL|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug_DLL|x64.ActiveCfg = Debug_DLL|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug_DLL|x64.Build.0 = Debug_DLL|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug_MD_DLL|Win32.ActiveCfg = Debug_MD_DLL|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug_MD_DLL|Win32.Build.0 = Debug_MD_DLL|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug_MD_DLL|x64.ActiveCfg = Debug_MD_DLL|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug_MD_DLL|x64.Build.0 = Debug_MD_DLL|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug_MD|Win32.ActiveCfg = Debug_MD|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug_MD|Win32.Build.0 = Debug_MD|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug_MD|x64.ActiveCfg = Debug_MD|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug_MD|x64.Build.0 = Debug_MD|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug|Win32.ActiveCfg = Debug|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug|Win32.Build.0 = Debug|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug|x64.ActiveCfg = Debug|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Debug|x64.Build.0 = Debug|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Release_DLL|Win32.ActiveCfg = Release_DLL|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Release_DLL|Win32.Build.0 = Release_DLL|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Release_DLL|x64.ActiveCfg = Release_DLL|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Release_DLL|x64.Build.0 = Release_DLL|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Release_MD_DLL|Win32.ActiveCfg = Release_MD_DLL|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Release_MD_DLL|Win32.Build.0 = Release_MD_DLL|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Release_MD_DLL|x64.ActiveCfg = Release_MD_DLL|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Release_MD_DLL|x64.Build.0 = Release_MD_DLL|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Release_MD|Win32.ActiveCfg = Release_MD|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Release_MD|Win32.Build.0 = Release_MD|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Release_MD|x64.ActiveCfg = Release_MD|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Release_MD|x64.Build.0 = Release_MD|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Release|Win32.ActiveCfg = Release|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Release|Win32.Build.0 = Release|Win32
{B439F755-9F29-480A-BB3E-C055C682E796}.Release|x64.ActiveCfg = Release|x64
{B439F755-9F29-480A-BB3E-C055C682E796}.Release|x64.Build.0 = Release|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug_DLL|Win32.ActiveCfg = Debug_DLL|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug_DLL|Win32.Build.0 = Debug_DLL|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug_DLL|x64.ActiveCfg = Debug_DLL|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug_DLL|x64.Build.0 = Debug_DLL|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug_MD_DLL|Win32.ActiveCfg = Debug_MD_DLL|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug_MD_DLL|Win32.Build.0 = Debug_MD_DLL|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug_MD_DLL|x64.ActiveCfg = Debug_MD_DLL|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug_MD_DLL|x64.Build.0 = Debug_MD_DLL|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug_MD|Win32.ActiveCfg = Debug_MD|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug_MD|Win32.Build.0 = Debug_MD|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug_MD|x64.ActiveCfg = Debug_MD|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug_MD|x64.Build.0 = Debug_MD|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug|Win32.ActiveCfg = Debug|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug|Win32.Build.0 = Debug|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug|x64.ActiveCfg = Debug|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Debug|x64.Build.0 = Debug|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release_DLL|Win32.ActiveCfg = Release_DLL|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release_DLL|Win32.Build.0 = Release_DLL|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release_DLL|x64.ActiveCfg = Release_DLL|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release_DLL|x64.Build.0 = Release_DLL|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release_MD_DLL|Win32.ActiveCfg = Release_MD_DLL|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release_MD_DLL|Win32.Build.0 = Release_MD_DLL|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release_MD_DLL|x64.ActiveCfg = Release_MD_DLL|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release_MD_DLL|x64.Build.0 = Release_MD_DLL|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release_MD|Win32.ActiveCfg = Release_MD|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release_MD|Win32.Build.0 = Release_MD|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release_MD|x64.ActiveCfg = Release_MD|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release_MD|x64.Build.0 = Release_MD|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release|Win32.ActiveCfg = Release|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release|Win32.Build.0 = Release|Win32
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release|x64.ActiveCfg = Release|x64
{9EE67DB2-4AD8-4B9A-AE58-2E536412033C}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 5ab39d9

Please sign in to comment.