yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
compression.cc File Reference
#include "compression.h"
#include <iostream>
#include <memory>
#include <string>
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
#include "app/core/constants.h"
#include "app/rom.h"
Include dependency graph for compression.cc:

Go to the source code of this file.

Namespaces

namespace  yaze
 
namespace  yaze::app
 Main namespace for the ImGui application.
 
namespace  yaze::app::gfx
 Contains classes for handling graphical data.
 
namespace  yaze::app::gfx::lc_lz2
 Contains the LC_LZ2 compression algorithm.
 

Macros

#define DEBUG_LOG(msg)
 

Functions

void yaze::app::gfx::lc_lz2::PrintCompressionPiece (const CompressionPiecePointer &piece)
 
void yaze::app::gfx::lc_lz2::PrintCompressionChain (const CompressionPiecePointer &chain_head)
 
void yaze::app::gfx::lc_lz2::CheckByteRepeat (const uchar *rom_data, DataSizeArray &data_size_taken, CommandArgumentArray &cmd_args, uint &src_data_pos, const uint last_pos)
 
void yaze::app::gfx::lc_lz2::CheckWordRepeat (const uchar *rom_data, DataSizeArray &data_size_taken, CommandArgumentArray &cmd_args, uint &src_data_pos, const uint last_pos)
 
void yaze::app::gfx::lc_lz2::CheckIncByte (const uchar *rom_data, DataSizeArray &data_size_taken, CommandArgumentArray &cmd_args, uint &src_data_pos, const uint last_pos)
 
void yaze::app::gfx::lc_lz2::CheckIntraCopy (const uchar *rom_data, DataSizeArray &data_size_taken, CommandArgumentArray &cmd_args, uint &src_data_pos, const uint last_pos, uint start)
 
void yaze::app::gfx::lc_lz2::ValidateForByteGain (const DataSizeArray &data_size_taken, const CommandSizeArray &cmd_size, uint &max_win, uint &cmd_with_max)
 
void yaze::app::gfx::lc_lz2::CompressionCommandAlternative (const uchar *rom_data, CompressionPiecePointer &compressed_chain, const CommandSizeArray &cmd_size, const CommandArgumentArray &cmd_args, uint &src_data_pos, uint &comp_accumulator, uint &cmd_with_max, uint &max_win)
 
void yaze::app::gfx::lc_lz2::CheckByteRepeatV2 (const uchar *data, uint &src_pos, const uint last_pos, CompressionCommand &cmd)
 
void yaze::app::gfx::lc_lz2::CheckWordRepeatV2 (const uchar *data, uint &src_pos, const uint last_pos, CompressionCommand &cmd)
 
void yaze::app::gfx::lc_lz2::CheckIncByteV2 (const uchar *rom_data, uint &src_data_pos, const uint last_pos, CompressionCommand &cmd)
 
void yaze::app::gfx::lc_lz2::CheckIntraCopyV2 (const uchar *rom_data, uint &src_data_pos, const uint last_pos, uint start, CompressionCommand &cmd)
 
void yaze::app::gfx::lc_lz2::ValidateForByteGainV2 (const CompressionCommand &cmd, uint &max_win, uint &cmd_with_max)
 
void yaze::app::gfx::lc_lz2::CompressionCommandAlternativeV2 (const uchar *rom_data, const CompressionCommand &cmd, CompressionPiecePointer &compressed_chain, uint &src_data_pos, uint &comp_accumulator, uint &cmd_with_max, uint &max_win)
 
void yaze::app::gfx::lc_lz2::AddAlternativeCompressionCommand (const uchar *rom_data, CompressionPiecePointer &compressed_chain, const CompressionCommand &command, uint &source_data_position, uint &uncompressed_data_size, uint &best_command, uint &best_command_gain)
 
absl::StatusOr< CompressionPiecePointeryaze::app::gfx::lc_lz2::SplitCompressionPiece (CompressionPiecePointer &piece, int mode)
 
std::vector< uint8_t > yaze::app::gfx::lc_lz2::CreateCompressionString (CompressionPiecePointer &start, int mode)
 
absl::Status yaze::app::gfx::lc_lz2::ValidateCompressionResult (CompressionPiecePointer &chain_head, int mode, int start, int src_data_pos)
 
CompressionPiecePointer yaze::app::gfx::lc_lz2::MergeCopy (CompressionPiecePointer &start)
 
absl::StatusOr< std::vector< uint8_t > > yaze::app::gfx::lc_lz2::CompressV2 (const uchar *data, const int start, const int length, int mode=1, bool check=false)
 Compresses a buffer of data using the LC_LZ2 algorithm.
 
uint8_t * yaze::app::gfx::lc_lz2::Compress (uint8_t const *const src, int const oldsize, int *const size, int const flag)
 
uint8_t * yaze::app::gfx::lc_lz2::Uncompress (uint8_t const *src, int *const size, int const p_big_endian)
 
absl::StatusOr< std::vector< uint8_t > > yaze::app::gfx::lc_lz2::CompressGraphics (const uchar *data, const int pos, const int length)
 
absl::StatusOr< std::vector< uint8_t > > yaze::app::gfx::lc_lz2::CompressOverworld (const uchar *data, const int pos, const int length)
 
absl::StatusOr< std::vector< uint8_t > > yaze::app::gfx::lc_lz2::CompressOverworld (const std::vector< uint8_t > data, const int pos, const int length)
 
void yaze::app::gfx::lc_lz2::CheckByteRepeatV3 (CompressionContext &context)
 
void yaze::app::gfx::lc_lz2::CheckWordRepeatV3 (CompressionContext &context)
 
void yaze::app::gfx::lc_lz2::CheckIncByteV3 (CompressionContext &context)
 
void yaze::app::gfx::lc_lz2::CheckIntraCopyV3 (CompressionContext &context)
 
void yaze::app::gfx::lc_lz2::InitializeCompression (CompressionContext &context)
 
void yaze::app::gfx::lc_lz2::CheckAvailableCompressionCommands (CompressionContext &context)
 
void yaze::app::gfx::lc_lz2::DetermineBestCompression (CompressionContext &context)
 
void yaze::app::gfx::lc_lz2::HandleDirectCopy (CompressionContext &context)
 
void yaze::app::gfx::lc_lz2::AddCompressionToChain (CompressionContext &context)
 
absl::Status yaze::app::gfx::lc_lz2::ValidateCompressionResultV3 (const CompressionContext &context)
 
absl::StatusOr< CompressionPieceyaze::app::gfx::lc_lz2::SplitCompressionPieceV3 (CompressionPiece &piece, int mode)
 
void yaze::app::gfx::lc_lz2::FinalizeCompression (CompressionContext &context)
 
absl::StatusOr< std::vector< uint8_t > > yaze::app::gfx::lc_lz2::CompressV3 (const std::vector< uint8_t > &data, const int start, const int length, int mode=1, bool check=false)
 Compresses a buffer of data using the LC_LZ2 algorithm.
 
std::string yaze::app::gfx::lc_lz2::SetBuffer (const uchar *data, int src_pos, int comp_accumulator)
 
std::string yaze::app::gfx::lc_lz2::SetBuffer (const std::vector< uint8_t > &data, int src_pos, int comp_accumulator)
 
void yaze::app::gfx::lc_lz2::memfill (const uchar *data, std::vector< uint8_t > &buffer, int buffer_pos, int offset, int length)
 
absl::StatusOr< std::vector< uint8_t > > yaze::app::gfx::lc_lz2::DecompressV2 (const uchar *data, int offset, int size=0x800, int mode=1)
 Decompresses a buffer of data using the LC_LZ2 algorithm.
 
absl::StatusOr< std::vector< uint8_t > > yaze::app::gfx::lc_lz2::DecompressGraphics (const uchar *data, int pos, int size)
 
absl::StatusOr< std::vector< uint8_t > > yaze::app::gfx::lc_lz2::DecompressOverworld (const uchar *data, int pos, int size)
 
absl::StatusOr< std::vector< uint8_t > > yaze::app::gfx::lc_lz2::DecompressOverworld (const std::vector< uint8_t > data, int pos, int size)
 

Variables

const std::array< int, 5 > yaze::app::gfx::lc_lz2::kCommandSizes = {1, 2, 2, 2, 3}
 

Macro Definition Documentation

◆ DEBUG_LOG