Still a WIP - needs more testing (especially when video is disabled, which hasn't been tested on this branch yet):

- Adding conditional replenishment (CR) support to the system, so blocks which don't change their selectors or endpoints from the last frame don't need to be decoded. This can greatly increase the compression ratio on many video sequences.
- Updating help text.
- Adding support for slices to be marked as i-frames
- Updating transcoder to support CR
This commit is contained in:
richgel999
2019-05-18 17:54:52 -07:00
parent 2b08177cd8
commit 9529bdbff8
10 changed files with 448 additions and 157 deletions
+6 -1
View File
@@ -73,7 +73,8 @@ namespace basist
bool decode_tables(const uint8_t *pTable_data, uint32_t table_data_size);
bool transcode_slice(void *pDst_blocks, uint32_t num_blocks_x, uint32_t num_blocks_y, const uint8_t *pImage_data, uint32_t image_data_size, block_format fmt, uint32_t output_stride, bool wrap_addressing, bool bc1_allow_threecolor_blocks);
bool transcode_slice(void *pDst_blocks, uint32_t num_blocks_x, uint32_t num_blocks_y, const uint8_t *pImage_data, uint32_t image_data_size, block_format fmt, uint32_t output_stride,
bool wrap_addressing, bool bc1_allow_threecolor_blocks, const basis_file_header &header, const basis_slice_desc& slice_desc);
private:
struct endpoint
@@ -101,6 +102,10 @@ namespace basist
};
std::vector<block_preds> m_block_endpoint_preds[2];
// Only used when decoding videos, for conditional replenishment.
enum { cMaxPrevFrameLevels = 16 };
std::vector<uint32_t> m_prev_frame_indices[2][cMaxPrevFrameLevels]; // [alpha_flag][level_index]
};
struct basisu_slice_info