Move bitstream to FasTC base lib

This commit is contained in:
Pavel Krajcevski 2014-01-21 15:04:39 -05:00
parent f12ee09f7e
commit ea953979fe
5 changed files with 58 additions and 38 deletions

View File

@ -106,7 +106,6 @@ SET( HEADERS
config/BPTCConfig.h.in config/BPTCConfig.h.in
include/BPTCCompressor.h include/BPTCCompressor.h
src/CompressionMode.h src/CompressionMode.h
src/BitStream.h
src/RGBAEndpoints.h src/RGBAEndpoints.h
src/ParallelStage.h src/ParallelStage.h
) )

View File

@ -78,7 +78,9 @@
#include "RGBAEndpoints.h" #include "RGBAEndpoints.h"
namespace FasTC {
class BitStream; class BitStream;
} // namespace FasTC
namespace BPTCC { namespace BPTCC {
@ -113,7 +115,7 @@ class CompressionMode {
// This function compresses a group of clusters into the passed bitstream. The // This function compresses a group of clusters into the passed bitstream. The
// size of the clusters array is determined by the BC7 compression mode. // size of the clusters array is determined by the BC7 compression mode.
double Compress(BitStream &stream, double Compress(FasTC::BitStream &stream,
const int shapeIdx, const RGBACluster *clusters); const int shapeIdx, const RGBACluster *clusters);
// This switch controls the quality of the simulated annealing optimizer. We // This switch controls the quality of the simulated annealing optimizer. We

View File

@ -79,7 +79,10 @@
#include "TexCompTypes.h" #include "TexCompTypes.h"
#include "BCLookupTables.h" #include "BCLookupTables.h"
#include "RGBAEndpoints.h" #include "RGBAEndpoints.h"
#include "BitStream.h" #include "BitStream.h"
using FasTC::BitStream;
using FasTC::BitStreamReadOnly;
#ifdef HAS_MSVC_ATOMICS #ifdef HAS_MSVC_ATOMICS
# include "Windows.h" # include "Windows.h"

View File

@ -58,6 +58,7 @@ SET( SOURCES
) )
SET( HEADERS SET( HEADERS
"include/BitStream.h"
"include/TexCompTypes.h" "include/TexCompTypes.h"
"include/Image.h" "include/Image.h"
"include/Color.h" "include/Color.h"

View File

@ -1,30 +1,39 @@
/* FasTC /* FasTC
* Copyright (c) 2012 University of North Carolina at Chapel Hill. All rights reserved. * Copyright (c) 2012 University of North Carolina at Chapel Hill.
* All rights reserved.
* *
* Permission to use, copy, modify, and distribute this software and its documentation for educational, * Permission to use, copy, modify, and distribute this software and its
* research, and non-profit purposes, without fee, and without a written agreement is hereby granted, * documentation for educational, research, and non-profit purposes, without
* provided that the above copyright notice, this paragraph, and the following four paragraphs appear * fee, and without a written agreement is hereby granted, provided that the
* in all copies. * above copyright notice, this paragraph, and the following four paragraphs
* appear in all copies.
* *
* Permission to incorporate this software into commercial products may be obtained by contacting the * Permission to incorporate this software into commercial products may be
* authors or the Office of Technology Development at the University of North Carolina at Chapel Hill <otd@unc.edu>. * obtained by contacting the authors or the Office of Technology Development
* at the University of North Carolina at Chapel Hill <otd@unc.edu>.
* *
* This software program and documentation are copyrighted by the University of North Carolina at Chapel Hill. * This software program and documentation are copyrighted by the University of
* The software program and documentation are supplied "as is," without any accompanying services from the * North Carolina at Chapel Hill. The software program and documentation are
* University of North Carolina at Chapel Hill or the authors. The University of North Carolina at Chapel Hill * supplied "as is," without any accompanying services from the University of
* and the authors do not warrant that the operation of the program will be uninterrupted or error-free. The * North Carolina at Chapel Hill or the authors. The University of North
* end-user understands that the program was developed for research purposes and is advised not to rely * Carolina at Chapel Hill and the authors do not warrant that the operation of
* exclusively on the program for any reason. * the program will be uninterrupted or error-free. The end-user understands
* that the program was developed for research purposes and is advised not to
* rely exclusively on the program for any reason.
* *
* IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE AUTHORS BE LIABLE TO ANY PARTY FOR * IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE * AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL,
* USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE * OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF
* AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF NORTH CAROLINA
* AT CHAPEL HILL OR THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
* *
* THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, * THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS SPECIFICALLY
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY * DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* STATUTORY WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY
* OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, * STATUTORY WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE PROVIDED HEREUNDER IS ON
* AN "AS IS" BASIS, AND THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND
* THE AUTHORS HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
* ENHANCEMENTS, OR MODIFICATIONS. * ENHANCEMENTS, OR MODIFICATIONS.
* *
* Please send all BUG REPORTS to <pavel@cs.unc.edu>. * Please send all BUG REPORTS to <pavel@cs.unc.edu>.
@ -46,25 +55,28 @@
// //
// This code has been modified significantly from the original. // This code has been modified significantly from the original.
//-------------------------------------------------------------------------------------- //------------------------------------------------------------------------------
// Copyright 2011 Intel Corporation // Copyright 2011 Intel Corporation
// All Rights Reserved // All Rights Reserved
// //
// Permission is granted to use, copy, distribute and prepare derivative works of this // Permission is granted to use, copy, distribute and prepare derivative works
// software for any purpose and without fee, provided, that the above copyright notice // of this software for any purpose and without fee, provided, that the above
// and this statement appear in all copies. Intel makes no representations about the // copyright notice and this statement appear in all copies. Intel makes no
// suitability of this software for any purpose. THIS SOFTWARE IS PROVIDED "AS IS." // representations about the suitability of this software for any purpose. THIS
// INTEL SPECIFICALLY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, AND ALL LIABILITY, // SOFTWARE IS PROVIDED "AS IS." INTEL SPECIFICALLY DISCLAIMS ALL WARRANTIES,
// INCLUDING CONSEQUENTIAL AND OTHER INDIRECT DAMAGES, FOR THE USE OF THIS SOFTWARE, // EXPRESS OR IMPLIED, AND ALL LIABILITY, INCLUDING CONSEQUENTIAL AND OTHER
// INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PROPRIETARY RIGHTS, AND INCLUDING THE // INDIRECT DAMAGES, FOR THE USE OF THIS SOFTWARE, INCLUDING LIABILITY FOR
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Intel does not // INFRINGEMENT OF ANY PROPRIETARY RIGHTS, AND INCLUDING THE WARRANTIES OF
// assume any responsibility for any errors which may appear in this software nor any // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Intel does not assume
// any responsibility for any errors which may appear in this software nor any
// responsibility to update it. // responsibility to update it.
// //
//-------------------------------------------------------------------------------------- //------------------------------------------------------------------------------
#ifndef __BITSTREAM_H__ #ifndef __BASE_INCLUDE_BITSTREAM_H__
#define __BITSTREAM_H__ #define __BASE_INCLUDE_BITSTREAM_H__
namespace FasTC {
class BitStream { class BitStream {
public: public:
@ -158,4 +170,7 @@ class BitStreamReadOnly {
const unsigned char *m_CurByte; const unsigned char *m_CurByte;
int m_NextBit; int m_NextBit;
}; };
#endif //__BITSTREAM_H__
} // namespace FasTC
#endif //__BASE_INCLUDE_BITSTREAM_H__