Table of Contents

NAME

QccENTGolombEncodeChannel, QccENTGolombDecodeChannel - Golomb encoding and decoding of binary channels

SYNOPSIS

#include "libQccPack.h"

int QccENTGolombEncodeChannel(const QccChannel *channel, QccBitBuffer *output_buffer, const float *p, const int *m);
int QccENTGolombDecodeChannel(QccBitBuffer *input_buffer, const QccChannel *channel);

DESCRIPTION

QccENTGolombEncodeChannel() encodes the binary symbol stream in channel using adaptive Golomb coding, outputting the binary codewords to output_buffer. channel should not contain any null symbols (see QccChannel(3) ); use QccChannelRemoveNullSymbols(3) to remove null symbols if needed. QccENTGolombEncode(3) is then called to produce the binary coding of the channel.

QccENTGolombDecodeChannel() performs decoding of the bits in the bitstream input_buffer, producing an output stream of binary channel symbols that are stored in channel. channel must be allocated prior to calling QccENTGolombDecodeChannel(); QccChannelGetBlockSize(3) is called to find out how many channel symbols are to be decoded from input_buffer. QccENTGolombDecodeChannel() calls QccENTGolombDecode(3) to actually do the Golomb decoding.

NOTES

QccBitBufferFlush(3) must be called after the call to QccENTGolombEncodeChannel() to ensure that the last few bits of the encoded bitstream are actually written to the output file.

QccENTGolombEncode() will fail if it encounters an invalid symbol (i.e., a symbol that is neither 0 or 1).

RETURN VALUE

Both routines return 0 on success, and 1 on failure.

SEE ALSO

QccENTGolombEncode(3) , QccENTGolombDecode(3) , QccChannel(3) , QccPackENT(3) , QccPack(3)

S. W. Golomb, "Run-Length Encodings," IEEE Transactions on Information Theory, vol. 12, pp. 399-401, July 1966.

AUTHOR

Written by Yufei Yuan <yuanyufei@hotmail.com>

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



Get QccPack at SourceForge.net. Fast, secure and Free Open Source software downloads