Table of Contents

NAME

QccENTAdaptiveGolombEncodeChannel, QccENTAdaptiveGolombDecodeChannel - adaptive Golomb (Langdon) encoding and decoding of binary channels

SYNOPSIS

#include "libQccPack.h"

int QccENTAdaptiveGolombEncodeChannel(const QccChannel *channel, QccBitBuffer *output_buffer);
int QccENTAdaptiveGolombDecodeChannel(QccBitBuffer *input_buffer, const QccChannel *channel);

DESCRIPTION

QccENTAdaptiveGolombEncodeChannel() 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. QccENTAdaptiveGolombEncode(3) is then called to produce the binary coding of the channel.

QccENTAdaptiveGolombDecodeChannel() 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 QccENTAdaptiveGolombDecodeChannel(); QccChannelGetBlockSize(3) is called to find out how many channel symbols are to be decoded from input_buffer. QccENTAdaptiveGolombDecodeChannel() calls QccENTAdaptiveGolombDecode(3) to actually do the adaptive Golomb decoding.

NOTES

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

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

Golomb coding originated in the 1966 paper by Golomb; the adaptive variant described here is due to Langdon. Apparently, this adaptive Golomb coding is also known as runlength/Rice coding.

RETURN VALUE

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

SEE ALSO

QccENTAdaptiveGolombEncode(3) , QccENTAdaptiveGolombDecode(3) , QccChannel(3) , QccPackENT(3) , QccPack(3)

G. G. Langdon, Jr., "An adaptive run-length coding algorithm," IBM Technical Disclosure Bulletin, vol. 26, no. 7B, pp. 3783-3785, December 1983.

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