/// @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;
}
//---------------------------------------------------------------------------
