Basis Universal v1.13:

- Optimized ETC1S encoder (3-4.5x faster)
- Added optional SSE 4.1 support to encoder
- Switched from std::vector to a custom vector in the encoder and transcoder
- Added CppSPMD (SSE only for now)
- UASTC RDO is now more effective, but the command line parameter controlling qualiy has changed (to "lambda")
This commit is contained in:
Rich Geldreich
2021-03-09 11:00:25 -05:00
parent 4299495f77
commit 2d4fe933b2
38 changed files with 1457 additions and 528 deletions

View File

@@ -1,5 +1,5 @@
// basisu_transcoder.cpp
// Copyright (C) 2019-2020 Binomial LLC. All Rights Reserved.
// Copyright (C) 2019-2021 Binomial LLC. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
#include "basisu_transcoder.h"
#include <limits.h>
#include <vector>
#include "basisu_containers_impl.h"
#ifndef BASISD_IS_BIG_ENDIAN
// TODO: This doesn't work on OSX. How can this be so difficult?
@@ -1342,8 +1342,8 @@ namespace basist
uint32_t m_base;
uint32_t m_table;
uint32_t m_multiplier;
std::vector<uint8_t> m_selectors;
std::vector<uint8_t> m_selectors_temp;
basisu::vector<uint8_t> m_selectors;
basisu::vector<uint8_t> m_selectors_temp;
};
static uint64_t pack_eac_a8_exhaustive(pack_eac_a8_results& results, const uint8_t* pPixels, uint32_t num_pixels)
@@ -1739,8 +1739,8 @@ namespace basist
uint32_t m_base;
uint32_t m_table;
uint32_t m_multiplier;
std::vector<uint8_t> m_selectors;
std::vector<uint8_t> m_selectors_temp;
basisu::vector<uint8_t> m_selectors;
basisu::vector<uint8_t> m_selectors_temp;
};
static uint64_t pack_eac_r11_exhaustive(pack_eac_r11_results& results, const uint8_t* pPixels, uint32_t num_pixels)
@@ -7914,7 +7914,7 @@ namespace basist
output_rows_in_pixels = orig_height;
}
std::vector<uint32_t>* pPrev_frame_indices = nullptr;
basisu::vector<uint32_t>* pPrev_frame_indices = nullptr;
if (is_video)
{
// TODO: Add check to make sure the caller hasn't tried skipping past p-frames
@@ -8874,7 +8874,7 @@ namespace basist
assert(alpha_length);
// Temp buffer to hold alpha block endpoint/selector indices
std::vector<uint32_t> temp_block_indices(total_slice_blocks);
basisu::vector<uint32_t> temp_block_indices(total_slice_blocks);
// First transcode alpha data to temp buffer
//status = transcode_slice(pData, data_size, slice_index + 1, &temp_block_indices[0], total_slice_blocks, block_format::cIndices, sizeof(uint32_t), decode_flags, pSlice_descs[slice_index].m_num_blocks_x, pState);
@@ -16446,7 +16446,7 @@ namespace basist
if (!basisu::is_pow2(width) || !basisu::is_pow2(height))
return false;
std::vector<uint32_t> temp_endpoints(num_blocks_x * num_blocks_y);
basisu::vector<uint32_t> temp_endpoints(num_blocks_x * num_blocks_y);
for (uint32_t y = 0; y < num_blocks_y; y++)
{
@@ -16505,7 +16505,7 @@ namespace basist
if (!basisu::is_pow2(width) || !basisu::is_pow2(height))
return false;
std::vector<uint32_t> temp_endpoints(num_blocks_x * num_blocks_y);
basisu::vector<uint32_t> temp_endpoints(num_blocks_x * num_blocks_y);
for (uint32_t y = 0; y < num_blocks_y; y++)
{