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

local int speck_process_S ( int **  channel,
int  channel_size,
list_node node,
linked_list slot,
linked_list **  LIS_slots,
linked_list LSP,
bit_buffer bb,
int  threshold,
int  coding_stage 
)

Process set of type 'S'

This function extracts pixel_set structure from the node, and encodes it using speck_encode_S function.

Parameters:
channelChannel
channel_sizeChannel size
nodeCurrent node
slotCurrent LIS slot
LIS_slotsArray of LIS slots
LSPList of Significant Pixels
bbBit-buffer
thresholdThreshold
coding_stageEither STAGE_S or STAGE_I
Returns:
Either BIT_BUFFER_OK or BIT_BUFFER_OVERFLOW

Definition at line 485 of file speck.c.

References append_list_node(), BIT_BUFFER_OK, free_list_node(), PIXEL_SET, prepend_list_node(), remove_list_node(), remove_list_node_link(), RETURN_IF_OVERFLOW, significance_test(), SLOT_INDEX, speck_encode_S(), STAGE_I, STAGE_S, TYPE_POINT, write_0, and write_1.

Referenced by encode_sorting_pass(), and speck_encode_I().

{
    pixel_set *set;
    int result;
    int st;

    /* Test the set for significance */
    set = PIXEL_SET(node);
    st = significance_test(set, threshold, channel, channel_size);

    result = st ? write_1(bb) : write_0(bb);
    RETURN_IF_OVERFLOW(result);

    if (st) {
        /* Significant set */
        if (set->type == TYPE_POINT) {
            /* Single point: encode coefficient sign */
            result = channel[set->x][set->y] > 0 ? write_0(bb) : write_1(bb);
            RETURN_IF_OVERFLOW(result);

            if (coding_stage == STAGE_S) {
                remove_list_node_link(slot, node);
            }

            append_list_node(LSP, node);
        } else {
            /* Encode set of type 'S' */
            result = speck_encode_S(channel, channel_size, set,
                                    LIS_slots, LSP, bb, threshold);

            RETURN_IF_OVERFLOW(result);

            if (coding_stage == STAGE_S) {
                remove_list_node(slot, node);
            } else {
                free_list_node(node);
            }
        }
    } else {
        /* Insignificant set */
        if (coding_stage == STAGE_I) {
            prepend_list_node(LIS_slots[SLOT_INDEX(set)], node);
        }
    }

    return BIT_BUFFER_OK;
}

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