jabcode
|
Data decoding. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "jabcode.h"
#include "detector.h"
#include "decoder.h"
#include "ldpc.h"
#include "encoder.h"
Functions | |
void | copyAndInterpolateSubblockFrom16To32 (jab_byte *palette, jab_int32 dst_offset, jab_int32 src_offset) |
Copy 16-color sub-blocks of 64-color palette into 32-color blocks of 256-color palette and interpolate into 32 colors. More... | |
void | interpolatePalette (jab_byte *palette, jab_int32 color_number) |
Interpolate 64-color palette into 128-/256-color palette. More... | |
jab_int32 | readColorPaletteInMaster (jab_bitmap *matrix, jab_decoded_symbol *symbol, jab_byte *data_map, jab_int32 *module_count, jab_int32 *x, jab_int32 *y) |
Read the color palettes in master symbol. More... | |
jab_int32 | readColorPaletteInSlave (jab_bitmap *matrix, jab_decoded_symbol *symbol, jab_byte *data_map) |
Read the color palettes in master symbol. More... | |
jab_byte | decodeModuleHD (jab_byte *palette, jab_int32 color_number, jab_byte r, jab_byte g, jab_byte b) |
Decode a module using hard decision. More... | |
jab_byte | decodeModule (jab_byte *palette, jab_int32 color_number, jab_float *ths, jab_float *rp, jab_byte *rgb, jab_float *p) |
Decode a module using soft decision. More... | |
jab_boolean | getPaletteThreshold (jab_byte *palette, jab_int32 color_number, jab_float **palette_ths, jab_float **palette_rp) |
Get the pixel value thresholds and reference points for each channel of the colors in the palette. More... | |
void | getNextMetadataModuleInMaster (jab_int32 matrix_height, jab_int32 matrix_width, jab_int32 next_module_count, jab_int32 *x, jab_int32 *y) |
Get the coordinate of the next metadata module in master symbol. More... | |
jab_int32 | decodeSlaveMetadata (jab_decoded_symbol *host_symbol, jab_int32 docked_position, jab_data *data, jab_int32 offset) |
Decode slave symbol metadata. More... | |
jab_int32 | decodeMasterMetadata (jab_bitmap *matrix, jab_decoded_symbol *symbol, jab_byte *data_map) |
Decode master symbol metadata. More... | |
jab_data * | readRawModuleData (jab_bitmap *matrix, jab_decoded_symbol *symbol, jab_byte *data_map, jab_float **bits_p) |
Decode data modules. More... | |
jab_data * | rawModuleData2RawData (jab_data *raw_module_data, jab_int32 bits_per_module) |
Convert multi-bit-per-byte raw module data to one-bit-per-byte raw data. More... | |
void | fillDataMap (jab_byte *data_map, jab_int32 width, jab_int32 height, jab_int32 type) |
Mark the positions of finder patterns and alignment patterns in the data map. More... | |
jab_int32 | loadDefaultMasterMetadata (jab_bitmap *matrix, jab_decoded_symbol *symbol, jab_byte *data_map) |
Load default metadata values and color palettes for master symbol. More... | |
jab_int32 | decodeSymbol (jab_bitmap *matrix, jab_decoded_symbol *symbol, jab_byte *data_map, jab_int32 type) |
Decode symbol. More... | |
jab_int32 | decodeMaster (jab_bitmap *matrix, jab_decoded_symbol *symbol) |
Decode master symbol. More... | |
jab_int32 | decodeSlave (jab_bitmap *matrix, jab_decoded_symbol *symbol) |
Decode slave symbol. More... | |
jab_int32 | readData (jab_data *data, jab_int32 start, jab_int32 length, jab_int32 *value) |
Read bit data. More... | |
jab_data * | decodeData (jab_data *bits) |
Interpret decoded bits. More... | |
Data decoding.
libjabcode - JABCode Encoding/Decoding Library
Copyright 2016 by Fraunhofer SIT. All rights reserved. See LICENSE file for full terms of use and distribution.
Contact: Huajian Liu liu@s Waldemar Berchtold it.f raunh ofer .dewalde mar. berch told @sit. frau nhofe r.de
void copyAndInterpolateSubblockFrom16To32 | ( | jab_byte * | palette, |
jab_int32 | dst_offset, | ||
jab_int32 | src_offset | ||
) |
Copy 16-color sub-blocks of 64-color palette into 32-color blocks of 256-color palette and interpolate into 32 colors.
palette | the color palette |
dst_offset | the start offset in the destination palette |
src_offset | the start offset in the source palette |
Interpret decoded bits.
bits | the input bits |
jab_int32 decodeMaster | ( | jab_bitmap * | matrix, |
jab_decoded_symbol * | symbol | ||
) |
Decode master symbol.
matrix | the symbol matrix |
symbol | the master symbol |
jab_int32 decodeMasterMetadata | ( | jab_bitmap * | matrix, |
jab_decoded_symbol * | symbol, | ||
jab_byte * | data_map | ||
) |
Decode master symbol metadata.
matrix | the symbol matrix |
symbol | the master symbol |
data_map | the data module positions |
jab_byte decodeModule | ( | jab_byte * | palette, |
jab_int32 | color_number, | ||
jab_float * | ths, | ||
jab_float * | rp, | ||
jab_byte * | rgb, | ||
jab_float * | p | ||
) |
Decode a module using soft decision.
palette | the color palette |
color_number | the number of colors |
ths | the pixel value thresholds |
rp | the reference pixel values |
rgb | the pixel value in RGB format |
p | the probability of the reliability of the decoded bits |
jab_byte decodeModuleHD | ( | jab_byte * | palette, |
jab_int32 | color_number, | ||
jab_byte | r, | ||
jab_byte | g, | ||
jab_byte | b | ||
) |
Decode a module using hard decision.
palette | the color palette |
color_number | the number of colors |
r | the red channel value |
g | the green channel value |
b | the blue channel value |
jab_int32 decodeSlave | ( | jab_bitmap * | matrix, |
jab_decoded_symbol * | symbol | ||
) |
Decode slave symbol.
matrix | the symbol matrix |
symbol | the slave symbol |
jab_int32 decodeSlaveMetadata | ( | jab_decoded_symbol * | host_symbol, |
jab_int32 | docked_position, | ||
jab_data * | data, | ||
jab_int32 | offset | ||
) |
Decode slave symbol metadata.
host_symbol | the host symbol |
docked_position | the docked position |
data | the data stream of the host symbol |
offset | the metadata start offset in the data stream |
jab_int32 decodeSymbol | ( | jab_bitmap * | matrix, |
jab_decoded_symbol * | symbol, | ||
jab_byte * | data_map, | ||
jab_int32 | type | ||
) |
Decode symbol.
matrix | the symbol matrix |
symbol | the symbol to be decoded |
data_map | the data module positions |
type | the symbol type, 0: master, 1: slave |
void fillDataMap | ( | jab_byte * | data_map, |
jab_int32 | width, | ||
jab_int32 | height, | ||
jab_int32 | type | ||
) |
Mark the positions of finder patterns and alignment patterns in the data map.
data_map | the data module positions |
width | the width of the data map |
height | the height of the data map |
type | the symbol type, 0: master, 1: slave |
void getNextMetadataModuleInMaster | ( | jab_int32 | matrix_height, |
jab_int32 | matrix_width, | ||
jab_int32 | next_module_count, | ||
jab_int32 * | x, | ||
jab_int32 * | y | ||
) |
Get the coordinate of the next metadata module in master symbol.
matrix_height | the height of the matrix |
matrix_width | the width of the matrix |
next_module_count | the index number of the next module |
x | the x coordinate of the current and the next module |
y | the y coordinate of the current and the next module |
jab_boolean getPaletteThreshold | ( | jab_byte * | palette, |
jab_int32 | color_number, | ||
jab_float ** | palette_ths, | ||
jab_float ** | palette_rp | ||
) |
Get the pixel value thresholds and reference points for each channel of the colors in the palette.
palette | the color palette |
color_number | the number of colors |
palette_ths | the pixel value thresholds |
palette_rp | the reference pixel values |
void interpolatePalette | ( | jab_byte * | palette, |
jab_int32 | color_number | ||
) |
Interpolate 64-color palette into 128-/256-color palette.
palette | the color palette |
color_number | the number of colors |
jab_int32 loadDefaultMasterMetadata | ( | jab_bitmap * | matrix, |
jab_decoded_symbol * | symbol, | ||
jab_byte * | data_map | ||
) |
Load default metadata values and color palettes for master symbol.
matrix | the symbol matrix |
symbol | the master symbol |
data_map | the data module positions |
Convert multi-bit-per-byte raw module data to one-bit-per-byte raw data.
raw_module_data | the input raw module data |
bits_per_module | the number of bits per module |
jab_int32 readColorPaletteInMaster | ( | jab_bitmap * | matrix, |
jab_decoded_symbol * | symbol, | ||
jab_byte * | data_map, | ||
jab_int32 * | module_count, | ||
jab_int32 * | x, | ||
jab_int32 * | y | ||
) |
Read the color palettes in master symbol.
matrix | the symbol matrix |
symbol | the master symbol |
data_map | the data module positions |
module_count | the start module index |
x | the x coordinate of the start module |
y | the y coordinate of the start module |
jab_int32 readColorPaletteInSlave | ( | jab_bitmap * | matrix, |
jab_decoded_symbol * | symbol, | ||
jab_byte * | data_map | ||
) |
Read the color palettes in master symbol.
matrix | the symbol matrix |
symbol | the slave symbol |
data_map | the data module positions |
jab_int32 readData | ( | jab_data * | data, |
jab_int32 | start, | ||
jab_int32 | length, | ||
jab_int32 * | value | ||
) |
Read bit data.
data | the data buffer |
start | the start reading offset |
length | the length of the data to be read |
value | the read data |
jab_data* readRawModuleData | ( | jab_bitmap * | matrix, |
jab_decoded_symbol * | symbol, | ||
jab_byte * | data_map, | ||
jab_float ** | bits_p | ||
) |
Decode data modules.
matrix | the symbol matrix |
symbol | the symbol to be decoded |
data_map | the data module positions |
bits_p | the probability of the reliability of the decoded bits |