⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 samplecoder.cpp

📁 Octane v1.01.20 The Open Compression Toolkit for C++ . The Open Compression Toolkit is a set of mo
💻 CPP
字号:
/// @file samplecoder.cpp
/// Sample Coder useful as a skeleton for writing new coders
///
/// @note This coder ignores any statistics that the modeler may provide
/// @author mouser
/// @date   2003.07.29
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
// application includes
#include "samplecoder.hpp"
//---------------------------------------------------------------------------




//---------------------------------------------------------------------------
// Functions from CODER PUBLIC API
bool SampleCoder::WriteSymbolBits(int symbolnum,bitwriter &bw)
{
	// write compressed output for symbol specified
	// return true on success
	
	// for our sample coder, we will just write the raw binary data in an int
	bw.put(symbolnum);
	
	// return success
	return true;
}

bool SampleCoder::DecodeSymbolFromInput(int &symbolnum, bitreader &br)
{
	// decode a symbol from the input
	// return false on no symbols left in stream (or error)

	// input is empty yet?
	if (br.empty())
		return false;

	// for our sample coder, we just read the binary data for an int
	br.get(symbolnum);

	// return success
	return true;
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -