Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the correct integer compression to get decompression working space size #2435

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pxr/usd/usd/integerCoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,14 @@ template <class Int>
size_t _DecompressIntegers(char const *compressed, size_t compressedSize,
Int *ints, size_t numInts, char *workingSpace)
{
using Compressor = typename std::conditional<
sizeof(Int) == 4,
Usd_IntegerCompression,
Usd_IntegerCompression64>::type;

// Working space.
size_t workingSpaceSize =
Usd_IntegerCompression::GetDecompressionWorkingSpaceSize(numInts);
Compressor::GetDecompressionWorkingSpaceSize(numInts);
std::unique_ptr<char[]> tmpSpace;
if (!workingSpace) {
tmpSpace.reset(new char[workingSpaceSize]);
Expand Down