VideoCodec/Modules/StreamCoding/HuffmanEntropyEncoder.h
#ifndef HUFFMANENTROPYENCODER_H_
#define HUFFMANENTROPYENCODER_H_
#include "../Module.h"
#include "../../Configuration/ConfigurationElement.h"
#include "../../Data/Constants.h"
#include "../../Data/PictureInfo.h"
#include "../../Data/MPEGVLCTables.h"
#include "../../Encoder/BinaryStreamBuilder.h"
#include "../../Logger.h"
namespace VideoCodec
{
class HuffmanEntropyEncoder : public VideoCodec::Module
{
public:
HuffmanEntropyEncoder();
virtual ~HuffmanEntropyEncoder();
ConfigurationStatus Configure(ConfigurationElement* configuration);
void EncodeFrame(PictureInfo* transformedData, BinaryStreamBuilder* streamBuilder, bool mv4);
FrameDataBitLength GetFrameCodedLength(PictureInfo* transformedData, bool mv4);
private:
// TODO: Name variables consistently.
FrameDataBitLength encodeFrame(PictureInfo* transformedData, BinaryStreamBuilder* streamBuilder, bool lengthOnly, bool mv4);
FrameDataBitLength encodeInterFrame(PictureInfo* picture, BinaryStreamBuilder* streamBuilder, bool lengthOnly, bool mv4);
void encodeInterBlock(SignedShort* workSpace, SignedShort* encodeValues, BinaryStreamBuilder* streamBuilder, bool lengthOnly, FrameDataBitLength* streamLength);
void encodeZeroMBs(unsigned short int zeroMBCount, BinaryStreamBuilder* streamBuilder, bool lengthOnly, FrameDataBitLength* streamLength);
void zigZagScan(short int* blockData, short int* output);
MBTypeVLC getVLCForMacroblock(bool pPicture, bool quant, bool motionForward, bool motionBackward, bool pattern, bool intraCoding);
UnsignedByte getVLCForMacroblockLengthOnly(bool pPicture, bool quant, bool motionForward, bool motionBackward, bool pattern, bool intraCoding);
VLCTableEntry getVLCForIntraACCoefficient(unsigned char zeroRun, unsigned short int level);
VLCTableEntry getVLCForInterACCoefficient(unsigned char zeroRun, unsigned short int level);
EncoderMV getVLCForMotionVector(signed char component);
UnsignedByte getVLCForMotionVectorLengthOnly(signed char component);
};
}
#endif /*HUFFMANENTROPYENCODER_H_*/