mirror of
https://github.com/BinomialLLC/basis_universal.git
synced 2026-10-25 02:10:53 +00:00
- Adding UASTC support to encoder, transcoder, .basis file format
- Removing BC7 mode 6 support from transcoder (will alway use the much smaller mode 5 tables now) - Adding BMP support - Adding -bench mode, for development - CMakeLists.txt file now compatible with Visual Studio 2019 (MSVC)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// basisu_backend.cpp
|
||||
// Copyright (C) 2019 Binomial LLC. All Rights Reserved.
|
||||
// Copyright (C) 2019-2020 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.
|
||||
@@ -176,7 +176,7 @@ namespace basisu
|
||||
void basisu_backend::reoptimize_and_sort_endpoints_codebook(uint32_t total_block_endpoints_remapped, uint_vec& all_endpoint_indices)
|
||||
{
|
||||
basisu_frontend& r = *m_pFront_end;
|
||||
const bool is_video = r.get_params().m_tex_type == basist::cBASISTexTypeVideoFrames;
|
||||
//const bool is_video = r.get_params().m_tex_type == basist::cBASISTexTypeVideoFrames;
|
||||
|
||||
if ((total_block_endpoints_remapped) && (m_params.m_compression_level > 0))
|
||||
{
|
||||
@@ -201,10 +201,10 @@ namespace basisu
|
||||
|
||||
for (uint32_t slice_index = 0; slice_index < m_slices.size(); slice_index++)
|
||||
{
|
||||
const uint32_t first_block_index = m_slices[slice_index].m_first_block_index;
|
||||
//const uint32_t first_block_index = m_slices[slice_index].m_first_block_index;
|
||||
|
||||
const uint32_t width = m_slices[slice_index].m_width;
|
||||
const uint32_t height = m_slices[slice_index].m_height;
|
||||
//const uint32_t width = m_slices[slice_index].m_width;
|
||||
//const uint32_t height = m_slices[slice_index].m_height;
|
||||
const uint32_t num_blocks_x = m_slices[slice_index].m_num_blocks_x;
|
||||
const uint32_t num_blocks_y = m_slices[slice_index].m_num_blocks_y;
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace basisu
|
||||
{
|
||||
for (uint32_t block_x = 0; block_x < num_blocks_x; block_x++)
|
||||
{
|
||||
const uint32_t block_index = first_block_index + block_x + block_y * num_blocks_x;
|
||||
//const uint32_t block_index = first_block_index + block_x + block_y * num_blocks_x;
|
||||
|
||||
encoder_block& m = m_slice_encoder_blocks[slice_index](block_x, block_y);
|
||||
|
||||
@@ -336,10 +336,10 @@ namespace basisu
|
||||
for (uint32_t slice_index = 0; slice_index < m_slices.size(); slice_index++)
|
||||
{
|
||||
const bool is_iframe = m_slices[slice_index].m_iframe;
|
||||
const uint32_t first_block_index = m_slices[slice_index].m_first_block_index;
|
||||
//const uint32_t first_block_index = m_slices[slice_index].m_first_block_index;
|
||||
|
||||
const uint32_t width = m_slices[slice_index].m_width;
|
||||
const uint32_t height = m_slices[slice_index].m_height;
|
||||
//const uint32_t width = m_slices[slice_index].m_width;
|
||||
//const uint32_t height = m_slices[slice_index].m_height;
|
||||
const uint32_t num_blocks_x = m_slices[slice_index].m_num_blocks_x;
|
||||
const uint32_t num_blocks_y = m_slices[slice_index].m_num_blocks_y;
|
||||
const int prev_frame_slice_index = find_video_frame(slice_index, -1);
|
||||
@@ -411,8 +411,8 @@ namespace basisu
|
||||
const bool is_iframe = m_slices[slice_index].m_iframe;
|
||||
const uint32_t first_block_index = m_slices[slice_index].m_first_block_index;
|
||||
|
||||
const uint32_t width = m_slices[slice_index].m_width;
|
||||
const uint32_t height = m_slices[slice_index].m_height;
|
||||
//const uint32_t width = m_slices[slice_index].m_width;
|
||||
//const uint32_t height = m_slices[slice_index].m_height;
|
||||
const uint32_t num_blocks_x = m_slices[slice_index].m_num_blocks_x;
|
||||
const uint32_t num_blocks_y = m_slices[slice_index].m_num_blocks_y;
|
||||
|
||||
@@ -590,7 +590,7 @@ namespace basisu
|
||||
{
|
||||
for (uint32_t slice_index = 0; slice_index < m_slices.size(); slice_index++)
|
||||
{
|
||||
const uint32_t first_block_index = m_slices[slice_index].m_first_block_index;
|
||||
//const uint32_t first_block_index = m_slices[slice_index].m_first_block_index;
|
||||
const uint32_t width = m_slices[slice_index].m_width;
|
||||
const uint32_t height = m_slices[slice_index].m_height;
|
||||
const uint32_t num_blocks_x = m_slices[slice_index].m_num_blocks_x;
|
||||
@@ -603,7 +603,7 @@ namespace basisu
|
||||
{
|
||||
for (uint32_t block_x = 0; block_x < num_blocks_x; block_x++)
|
||||
{
|
||||
const uint32_t block_index = first_block_index + block_x + block_y * num_blocks_x;
|
||||
//const uint32_t block_index = first_block_index + block_x + block_y * num_blocks_x;
|
||||
|
||||
encoder_block& m = m_slice_encoder_blocks[slice_index](block_x, block_y);
|
||||
|
||||
@@ -680,11 +680,11 @@ namespace basisu
|
||||
|
||||
for (uint32_t slice_index = 0; slice_index < m_slices.size(); slice_index++)
|
||||
{
|
||||
const int prev_frame_slice_index = is_video ? find_video_frame(slice_index, -1) : -1;
|
||||
const int next_frame_slice_index = is_video ? find_video_frame(slice_index, 1) : -1;
|
||||
//const int prev_frame_slice_index = is_video ? find_video_frame(slice_index, -1) : -1;
|
||||
//const int next_frame_slice_index = is_video ? find_video_frame(slice_index, 1) : -1;
|
||||
const uint32_t first_block_index = m_slices[slice_index].m_first_block_index;
|
||||
const uint32_t width = m_slices[slice_index].m_width;
|
||||
const uint32_t height = m_slices[slice_index].m_height;
|
||||
//const uint32_t width = m_slices[slice_index].m_width;
|
||||
//const uint32_t height = m_slices[slice_index].m_height;
|
||||
const uint32_t num_blocks_x = m_slices[slice_index].m_num_blocks_x;
|
||||
const uint32_t num_blocks_y = m_slices[slice_index].m_num_blocks_y;
|
||||
|
||||
@@ -702,7 +702,7 @@ namespace basisu
|
||||
{
|
||||
for (uint32_t block_x = 0; block_x < num_blocks_x; block_x++)
|
||||
{
|
||||
const uint32_t block_index = first_block_index + block_x + block_y * num_blocks_x;
|
||||
//const uint32_t block_index = first_block_index + block_x + block_y * num_blocks_x;
|
||||
|
||||
encoder_block& m = m_slice_encoder_blocks[slice_index](block_x, block_y);
|
||||
|
||||
@@ -1168,8 +1168,8 @@ namespace basisu
|
||||
|
||||
for (uint32_t slice_index = 0; slice_index < m_slices.size(); slice_index++)
|
||||
{
|
||||
const uint32_t width = m_slices[slice_index].m_width;
|
||||
const uint32_t height = m_slices[slice_index].m_height;
|
||||
//const uint32_t width = m_slices[slice_index].m_width;
|
||||
//const uint32_t height = m_slices[slice_index].m_height;
|
||||
const uint32_t num_blocks_x = m_slices[slice_index].m_num_blocks_x;
|
||||
const uint32_t num_blocks_y = m_slices[slice_index].m_num_blocks_y;
|
||||
|
||||
@@ -1644,7 +1644,7 @@ namespace basisu
|
||||
|
||||
uint32_t basisu_backend::encode()
|
||||
{
|
||||
const bool is_video = m_pFront_end->get_params().m_tex_type == basist::cBASISTexTypeVideoFrames;
|
||||
//const bool is_video = m_pFront_end->get_params().m_tex_type == basist::cBASISTexTypeVideoFrames;
|
||||
m_output.m_slice_desc = m_slices;
|
||||
m_output.m_etc1s = m_params.m_etc1s;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user