Logo Search packages:      
Sourcecode: librasterlite version File versions  Download package

local void speck_init ( linked_list **  LIS_slots,
pixel_set I,
int  channel_size,
int  mode 
)

Initialize SPECK encoder or decoder

This function initializes SPECK encoder or decoder.

Parameters:
LIS_slotsArray of LIS slots
ISet of type I
channel_sizeChannel size
modeEither MODE_NORMAL or MODE_OTLPF
Returns:
VOID

Definition at line 961 of file speck.c.

References alloc_list_node(), pixel_set_tag::height, MODE_NORMAL, PIXEL_SET, prepend_list_node(), pixel_set_tag::type, TYPE_I, TYPE_POINT, TYPE_S, pixel_set_tag::width, pixel_set_tag::x, and pixel_set_tag::y.

Referenced by speck_decode(), and speck_encode().

{
    list_node *root;

    root = alloc_list_node(sizeof(pixel_set));

    /* Setup root node */
    if (mode == MODE_NORMAL) {
        PIXEL_SET(root)->type = TYPE_POINT;
        PIXEL_SET(root)->x = PIXEL_SET(root)->y = 0;
        PIXEL_SET(root)->width = PIXEL_SET(root)->height = 1;

        I->type = TYPE_I;
        I->x = I->y = 1;
        I->width = I->height = channel_size - 1;

        prepend_list_node(LIS_slots[0], root);
    } else {
        PIXEL_SET(root)->type = TYPE_S;
        PIXEL_SET(root)->x = PIXEL_SET(root)->y = 0;
        PIXEL_SET(root)->width = PIXEL_SET(root)->height = 2;

        I->type = TYPE_I;
        I->x = I->y = 2;
        I->width = I->height = channel_size - 2;

        prepend_list_node(LIS_slots[1], root);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index