channel.h File Reference

Single-channel processing (prepare for en-/decoding). More...


Data Structures

struct  t_wv_bitplane
 Information about a single (or multiple agglomerated) bit-planes, needed for scheduling. More...
struct  t_wv_block
 Information about a block of wavelet coefficients. More...
struct  t_wv_schedule_entry
 Entry in the scheduler about the order in which we write blocks. More...
struct  t_wv_channel
 Channel of wavelet coefficients to be compressed. More...

Defines

#define wv_MAX_BLOCKS   (1 + 12*3)
 Maximum amount of blocks we can have (which is for a 32768x32768 image).
#define wv_MAX_BLOCK_STORE   4
 Amount of bits needed to store wv_MAX_BLOCKS (as we know it's 1 + multiple of 3).

Typedefs

typedef void(*) wv_progress_function (int Current, int End, void *UserData)
 Progress callback for wv_channel_compact().

Functions

t_wv_channelwv_channel_compact (const int Width, const int Height, const unsigned char DataFormat, wv_pel *Data, const int Approximate, const t_reorder_table *ReorderTable, wv_progress_function Progress, void *UserData)
 Initializes a channel for subsequent encoding.
void wv_channel_uncompact (const t_wv_channel *CC, const t_reorder_table *ReorderTable, wv_pel *Data)
 Converts compacted channel data back to its original representation.
void wv_channel_free (t_wv_channel *CC)
 Frees a compacted channel and all its associated data.
unsigned char wv_channel_get_data_format (const t_wv_channel *CC)
 Gets the data format (retained data) of a channel.
int wv_channel_get_width (const t_wv_channel *CC)
 Gets the width of a (usually decoded) channel.
int wv_channel_get_height (const t_wv_channel *CC)
 Gets the height of a (usually decoded) channel.


Detailed Description

Single-channel processing (prepare for en-/decoding).


Define Documentation

#define wv_MAX_BLOCKS   (1 + 12*3)

Maximum amount of blocks we can have (which is for a 32768x32768 image).


Typedef Documentation

typedef void(*) wv_progress_function(int Current, int End, void *UserData)

Progress callback for wv_channel_compact().


Function Documentation

t_wv_channel* wv_channel_compact ( const int  Width,
const int  Height,
const unsigned char  DataFormat,
wv_pel Data,
const int  Approximate,
const t_reorder_table ReorderTable,
wv_progress_function  Progress,
void *  UserData 
)

Initializes a channel for subsequent encoding.

(Lossless) Inverse of wv_channel_uncompact().

Warning:
The actual width and height of the data in Data has to be the next larger power of 2!

The data in Data is modified!

Parameters:
[in] Width Width of the used data in Data.
[in] Height Height of the used data in Data.
[in] DataFormat Format of the data stored, or any other 8-bit value you want to store in an encoded channel. This information can be queried with wv_channel_get_data_format().
[in,out] Data Pixel data of the channel on input; receives the wavelet transformed coefficients. This has to be stored with a width and height that are the next-bigger power of 2 to Width and Height given above. A suitable extension should be done on the boundary, e.g. source data is 720x512, then Width = 720 and Height = 512, but the data in Data has to be 1024x512!
[in] Approximate Flag which can be set > 0 to indicate the error computation should be more approximate. This results in less than ideal compression estimates.
[in] ReorderTable Permutation table used to reorder the wavelet coefficients. Has to have been initialized at least the dimensions of the given image. Larger tables can be reused for smaller images. Can be freed after wv_channel_compact() has returned; should be shared between multiple channels with the same (or smaller) dimensions.
[in] Progress Callback to a user-function with the progress of the compaction procedure. Can be NULL.
[in] UserData Userdata passed to Progress.
Returns:
The compacted channel to be used in conjunction with wv_encode().

void wv_channel_free ( t_wv_channel CC  ) 

Frees a compacted channel and all its associated data.

Parameters:
[in] CC Channel to be freed.

unsigned char wv_channel_get_data_format ( const t_wv_channel CC  ) 

Gets the data format (retained data) of a channel.

This information was kept when encoding the channel and is set when encoding a channel.

Parameters:
[in] CC Channel whose retained data you want to know.
Returns:
User-data that was stored (8 bits).

int wv_channel_get_height ( const t_wv_channel CC  ) 

Gets the height of a (usually decoded) channel.

Parameters:
[in] CC Channel whose height you are interested in.
Returns:
Height of the channel, 0 on error

int wv_channel_get_width ( const t_wv_channel CC  ) 

Gets the width of a (usually decoded) channel.

Parameters:
[in] CC Channel whose width you are interested in.
Returns:
Width of the channel, 0 on error

void wv_channel_uncompact ( const t_wv_channel CC,
const t_reorder_table ReorderTable,
wv_pel Data 
)

Converts compacted channel data back to its original representation.

(Lossless) Inverse of wv_channel_compact().

Warning:
The actual width and height of the free space at Data has to be the next larger power of 2 of CC->width and CC->height!
Parameters:
[in] CC Compacted channel data (usually gotten from wv_decode()).
[in] ReorderTable Permutation table used to reorder the wavelet coefficients. Has to have been initialized with exact same width and height as given here (or an identical integer multiple of both dimensions), e.g. for our 720x512 data, we can also use a table created for 1440x1024, but not 1440x512. Should be shared between multiple channels with the same dimensions.
[out] Data Receives the original pixel data of the compacted channel. This has to provide space for a width and height that are the next-bigger power of 2 to CC->width and CC->height, e.g. CC is 720x512, then Data has to allocated for 1024x512!


Generated on Tue Jul 10 20:44:34 2007 for wavelet by  doxygen 1.5.2