Add BC7 support. It's incredibly slow - ~60 seconds to compress a 512x512 image, on a Core i7 - but it works.

- Added AVPCL compressor to projects and got it building with VC9 and VC10.
- Removed unused command line interface & file read/write code from AVPCL.
- Convert AVPCL to use NV vector math lib, asserts, etc.
- Convert AVPCL to use double instead of float.
- Added 4x4 symmetric eigensolver, for AVPCL; it's based on the existing 3x3 one, but I had to rewrite the Householder reduction stage.  As with ZOH, using the eigensolver (instead of SVD) gives a ~25% speedup without significantly affecting RMSE.
- Encapsulate ZOH and AVPCL stuff into their own namespaces to keep everything separate.
- Added some missing vector operators to the nvmath lib.
This commit is contained in:
nathaniel.reed@gmail.com
2013-12-07 02:17:08 +00:00
parent f2fa0517b5
commit ab316deeaa
86 changed files with 2944 additions and 11081 deletions

File diff suppressed because it is too large Load Diff

View File

@ -14,22 +14,32 @@ namespace nv
Vector3 computeCentroid(int n, const Vector3 * points);
Vector3 computeCentroid(int n, const Vector3 * points, const float * weights, const Vector3 & metric);
Vector4 computeCentroid(int n, const Vector4 * points);
Vector4 computeCentroid(int n, const Vector4 * points, const float * weights, const Vector4 & metric);
Vector3 computeCovariance(int n, const Vector3 * points, float * covariance);
Vector3 computeCovariance(int n, const Vector3 * points, const float * weights, const Vector3 & metric, float * covariance);
Vector4 computeCovariance(int n, const Vector4 * points, float * covariance);
Vector4 computeCovariance(int n, const Vector4 * points, const float * weights, const Vector4 & metric, float * covariance);
Vector3 computePrincipalComponent_PowerMethod(int n, const Vector3 * points);
Vector3 computePrincipalComponent_PowerMethod(int n, const Vector3 * points, const float * weights, const Vector3 & metric);
Vector3 computePrincipalComponent_EigenSolver(int n, const Vector3 * points);
Vector3 computePrincipalComponent_EigenSolver(int n, const Vector3 * points, const float * weights, const Vector3 & metric);
Vector4 computePrincipalComponent_EigenSolver(int n, const Vector4 * points);
Vector4 computePrincipalComponent_EigenSolver(int n, const Vector4 * points, const float * weights, const Vector4 & metric);
Vector3 computePrincipalComponent_SVD(int n, const Vector3 * points);
Vector4 computePrincipalComponent_SVD(int n, const Vector4 * points);
Plane bestPlane(int n, const Vector3 * points);
bool isPlanar(int n, const Vector3 * points, float epsilon = NV_EPSILON);
bool eigenSolveSymmetric (const float matrix[6], float eigenValues[3], Vector3 eigenVectors[3]);
bool eigenSolveSymmetric3(const float matrix[6], float eigenValues[3], Vector3 eigenVectors[3]);
bool eigenSolveSymmetric4(const float matrix[10], float eigenValues[4], Vector4 eigenVectors[4]);
// Returns number of clusters [1-4].
int compute4Means(int n, const Vector3 * points, const float * weights, const Vector3 & metric, Vector3 * cluster);

View File

@ -73,6 +73,7 @@ namespace nv
void operator*=(float s);
void operator/=(float s);
void operator*=(Vector3::Arg v);
void operator/=(Vector3::Arg v);
friend bool operator==(Vector3::Arg a, Vector3::Arg b);
friend bool operator!=(Vector3::Arg a, Vector3::Arg b);
@ -116,7 +117,9 @@ namespace nv
void operator+=(Vector4::Arg v);
void operator-=(Vector4::Arg v);
void operator*=(float s);
void operator/=(float s);
void operator*=(Vector4::Arg v);
void operator/=(Vector4::Arg v);
friend bool operator==(Vector4::Arg a, Vector4::Arg b);
friend bool operator!=(Vector4::Arg a, Vector4::Arg b);

View File

@ -158,6 +158,13 @@ namespace nv
z *= v.z;
}
inline void Vector3::operator/=(Vector3::Arg v)
{
x /= v.x;
y /= v.y;
z /= v.z;
}
inline bool operator==(Vector3::Arg a, Vector3::Arg b)
{
return a.x == b.x && a.y == b.y && a.z == b.z;
@ -243,6 +250,14 @@ namespace nv
w *= s;
}
inline void Vector4::operator/=(float s)
{
x /= s;
y /= s;
z /= s;
w /= s;
}
inline void Vector4::operator*=(Vector4::Arg v)
{
x *= v.x;
@ -251,6 +266,14 @@ namespace nv
w *= v.w;
}
inline void Vector4::operator/=(Vector4::Arg v)
{
x /= v.x;
y /= v.y;
z /= v.z;
w /= v.w;
}
inline bool operator==(Vector4::Arg a, Vector4::Arg b)
{
return a.x == b.x && a.y == b.y && a.z == b.z && a.w == b.w;
@ -677,6 +700,11 @@ namespace nv
return scale(v, s);
}
inline Vector4 operator*(Vector4::Arg v, Vector4::Arg s)
{
return scale(v, s);
}
inline Vector4 operator/(Vector4::Arg v, float s)
{
return scale(v, 1.0f/s);