mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2024-11-24 10:15:38 +01:00
Small refactoring changes.
This commit is contained in:
parent
8ca5d7ac44
commit
8cad373e8e
@ -103,19 +103,19 @@ namespace BC7C
|
|||||||
// Compress the image given as RGBA data to BC7 format. Width and Height are the dimensions of
|
// Compress the image given as RGBA data to BC7 format. Width and Height are the dimensions of
|
||||||
// the image in pixels.
|
// the image in pixels.
|
||||||
void CompressImageBC7(
|
void CompressImageBC7(
|
||||||
const unsigned char *inBuf,
|
const unsigned char *inBuf,
|
||||||
unsigned char *outBuf,
|
unsigned char *outBuf,
|
||||||
unsigned int width,
|
unsigned int width,
|
||||||
unsigned int height
|
unsigned int height
|
||||||
);
|
);
|
||||||
|
|
||||||
void CompressImageBC7Stats(
|
void CompressImageBC7Stats(
|
||||||
const unsigned char *inBuf,
|
const unsigned char *inBuf,
|
||||||
unsigned char *outBuf,
|
unsigned char *outBuf,
|
||||||
unsigned int width,
|
unsigned int width,
|
||||||
unsigned int height,
|
unsigned int height,
|
||||||
BlockStatManager &statManager
|
BlockStatManager &statManager
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifdef HAS_SSE_41
|
#ifdef HAS_SSE_41
|
||||||
// Compress the image given as RGBA data to BC7 format using an algorithm optimized for SIMD
|
// Compress the image given as RGBA data to BC7 format using an algorithm optimized for SIMD
|
||||||
|
@ -70,6 +70,7 @@
|
|||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class BitStream;
|
class BitStream;
|
||||||
|
struct VisitedState;
|
||||||
const int kMaxEndpoints = 3;
|
const int kMaxEndpoints = 3;
|
||||||
|
|
||||||
static const int kPBits[4][2] = {
|
static const int kPBits[4][2] = {
|
||||||
@ -187,9 +188,9 @@ private:
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return (
|
return (
|
||||||
((maskSeed >> (24 + m_Attributes->colorChannelPrecision - 1) & 0xFF) |
|
((maskSeed >> (24 + m_Attributes->colorChannelPrecision - 1) & 0xFF) |
|
||||||
(maskSeed >> (16 + m_Attributes->colorChannelPrecision - 1) & 0xFF00) |
|
(maskSeed >> (16 + m_Attributes->colorChannelPrecision - 1) & 0xFF00) |
|
||||||
(maskSeed >> (8 + m_Attributes->colorChannelPrecision - 1) & 0xFF0000)) &
|
(maskSeed >> (8 + m_Attributes->colorChannelPrecision - 1) & 0xFF0000)) &
|
||||||
(0x00FFFFFF)
|
(0x00FFFFFF)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -213,13 +214,12 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
double OptimizeEndpointsForCluster(const RGBACluster &cluster, RGBAVector &p1, RGBAVector &p2, int *bestIndices, int &bestPbitCombo) const;
|
double OptimizeEndpointsForCluster(
|
||||||
|
const RGBACluster &cluster,
|
||||||
struct VisitedState {
|
RGBAVector &p1, RGBAVector &p2,
|
||||||
RGBAVector p1;
|
int *bestIndices,
|
||||||
RGBAVector p2;
|
int &bestPbitCombo
|
||||||
int pBitCombo;
|
) const;
|
||||||
};
|
|
||||||
|
|
||||||
void PickBestNeighboringEndpoints(
|
void PickBestNeighboringEndpoints(
|
||||||
const RGBACluster &cluster,
|
const RGBACluster &cluster,
|
||||||
|
@ -517,7 +517,19 @@ static void ChangePointForDirWithPbitChange(RGBAVector &v, int dir, int oldPbit,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BC7CompressionMode::PickBestNeighboringEndpoints(const RGBACluster &cluster, const RGBAVector &p1, const RGBAVector &p2, const int curPbitCombo, RGBAVector &np1, RGBAVector &np2, int &nPbitCombo, const VisitedState *visitedStates, int nVisited, float stepSz) const {
|
struct VisitedState {
|
||||||
|
RGBAVector p1;
|
||||||
|
RGBAVector p2;
|
||||||
|
int pBitCombo;
|
||||||
|
};
|
||||||
|
|
||||||
|
void BC7CompressionMode::PickBestNeighboringEndpoints(
|
||||||
|
const RGBACluster &cluster,
|
||||||
|
const RGBAVector &p1, const RGBAVector &p2, const int curPbitCombo,
|
||||||
|
RGBAVector &np1, RGBAVector &np2, int &nPbitCombo,
|
||||||
|
const VisitedState *visitedStates, int nVisited,
|
||||||
|
float stepSz
|
||||||
|
) const {
|
||||||
|
|
||||||
// !SPEED! There might be a way to make this faster since we're working
|
// !SPEED! There might be a way to make this faster since we're working
|
||||||
// with floating point values that are powers of two. We should be able
|
// with floating point values that are powers of two. We should be able
|
||||||
|
Loading…
Reference in New Issue
Block a user