///////////////////////////////////////////////////////////////////////////1//2// Copyright (c) 2002, Industrial Light & Magic, a division of Lucas3// Digital Ltd. LLC4//5// All rights reserved.6//7// Redistribution and use in source and binary forms, with or without8// modification, are permitted provided that the following conditions are9// met:10// * Redistributions of source code must retain the above copyright11// notice, this list of conditions and the following disclaimer.12// * Redistributions in binary form must reproduce the above13// copyright notice, this list of conditions and the following disclaimer14// in the documentation and/or other materials provided with the15// distribution.16// * Neither the name of Industrial Light & Magic nor the names of17// its contributors may be used to endorse or promote products derived18// from this software without specific prior written permission.19//20// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS21// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT22// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR23// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT24// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,25// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT26// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,27// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY28// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT29// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE30// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.31//32///////////////////////////////////////////////////////////////////////////33343536#ifndef INCLUDED_IMF_HUF_H37#define INCLUDED_IMF_HUF_H383940//-----------------------------------------------------------------------------41//42// 16-bit Huffman compression and decompression:43//44// hufCompress (r, nr, c)45//46// Compresses the contents of array r (of length nr),47// stores the compressed data in array c, and returns48// the size of the compressed data (in bytes).49//50// To avoid buffer overflows, the size of array c should51// be at least 2 * nr + 65536.52//53// hufUncompress (c, nc, r, nr)54//55// Uncompresses the data in array c (with length nc),56// and stores the results in array r (with length nr).57//58//-----------------------------------------------------------------------------5960namespace Imf {616263int64hufCompress (const unsigned short raw[/*nRaw*/],65int nRaw,66char compressed[/*2 * nRaw + 65536*/]);676869void70hufUncompress (const char compressed[/*nCompressed*/],71int nCompressed,72unsigned short raw[/*nRaw*/],73int nRaw);747576} // namespace Imf7778#endif798081