SVN file properties modified
This commit is contained in:
parent
d53edb5ea7
commit
34661c5aea
744
jpwl/jpwl.h
744
jpwl/jpwl.h
|
@ -1,372 +1,372 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001-2003, David Janssens
|
* Copyright (c) 2001-2003, David Janssens
|
||||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||||
* Copyright (c) 2003-2005, Francois Devaux and Antonin Descampe
|
* Copyright (c) 2003-2005, Francois Devaux and Antonin Descampe
|
||||||
* Copyright (c) 2005, Hervé Drolon, FreeImage Team
|
* Copyright (c) 2005, Hervé Drolon, FreeImage Team
|
||||||
* Copyright (c) 2002-2005, Communications and remote sensing Laboratory, Universite catholique de Louvain, Belgium
|
* Copyright (c) 2002-2005, Communications and remote sensing Laboratory, Universite catholique de Louvain, Belgium
|
||||||
* Copyright (c) 2005-2006, Dept. of Electronic and Information Engineering, Universita' degli Studi di Perugia, Italy
|
* Copyright (c) 2005-2006, Dept. of Electronic and Information Engineering, Universita' degli Studi di Perugia, Italy
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifndef __JPWL_H
|
#ifndef __JPWL_H
|
||||||
#define __JPWL_H
|
#define __JPWL_H
|
||||||
|
|
||||||
#ifdef USE_JPWL
|
#ifdef USE_JPWL
|
||||||
|
|
||||||
#include "crc.h"
|
#include "crc.h"
|
||||||
#include "rs.h"
|
#include "rs.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@file jpwl.h
|
@file jpwl.h
|
||||||
@brief The JPEG-2000 Part11 (JPWL) marker segments manager
|
@brief The JPEG-2000 Part11 (JPWL) marker segments manager
|
||||||
|
|
||||||
The functions in JPWL.C have for goal to read/write the markers added by JPWL.
|
The functions in JPWL.C have for goal to read/write the markers added by JPWL.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @defgroup JPWL JPWL - JPEG-2000 Part11 (JPWL) codestream manager */
|
/** @defgroup JPWL JPWL - JPEG-2000 Part11 (JPWL) codestream manager */
|
||||||
/*@{*/
|
/*@{*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Assume a basic codestream structure, so you can resort better from uncorrected errors
|
Assume a basic codestream structure, so you can resort better from uncorrected errors
|
||||||
*/
|
*/
|
||||||
#define JPWL_ASSUME true
|
#define JPWL_ASSUME true
|
||||||
|
|
||||||
/**
|
/**
|
||||||
EPB (Error Protection Block) Marker segment
|
EPB (Error Protection Block) Marker segment
|
||||||
*/
|
*/
|
||||||
typedef struct jpwl_epb_ms {
|
typedef struct jpwl_epb_ms {
|
||||||
/**@name Private fields set by epb_create */
|
/**@name Private fields set by epb_create */
|
||||||
/*@{*/
|
/*@{*/
|
||||||
/** is the latest in header? */
|
/** is the latest in header? */
|
||||||
bool latest;
|
bool latest;
|
||||||
/** is it in packed mode? */
|
/** is it in packed mode? */
|
||||||
bool packed;
|
bool packed;
|
||||||
/** TH where this marker has been placed (-1 means MH) */
|
/** TH where this marker has been placed (-1 means MH) */
|
||||||
int tileno;
|
int tileno;
|
||||||
/** index in current header (0-63) */
|
/** index in current header (0-63) */
|
||||||
unsigned char index;
|
unsigned char index;
|
||||||
/** error protection method [-1=absent 0=none 1=predefined 16=CRC-16 32=CRC-32 37-128=RS] */
|
/** error protection method [-1=absent 0=none 1=predefined 16=CRC-16 32=CRC-32 37-128=RS] */
|
||||||
int hprot;
|
int hprot;
|
||||||
/** message word length of pre-data */
|
/** message word length of pre-data */
|
||||||
int k_pre;
|
int k_pre;
|
||||||
/** code word length of pre-data */
|
/** code word length of pre-data */
|
||||||
int n_pre;
|
int n_pre;
|
||||||
/** length of pre-data */
|
/** length of pre-data */
|
||||||
int pre_len;
|
int pre_len;
|
||||||
/** message word length of post-data */
|
/** message word length of post-data */
|
||||||
int k_post;
|
int k_post;
|
||||||
/** code word length of post-data */
|
/** code word length of post-data */
|
||||||
int n_post;
|
int n_post;
|
||||||
/** length of post-data */
|
/** length of post-data */
|
||||||
int post_len;
|
int post_len;
|
||||||
/*@}*/
|
/*@}*/
|
||||||
/**@name Marker segment fields */
|
/**@name Marker segment fields */
|
||||||
/*@{*/
|
/*@{*/
|
||||||
/** two bytes for the length of EPB MS, exluding the marker itself (11 to 65535 bytes) */
|
/** two bytes for the length of EPB MS, exluding the marker itself (11 to 65535 bytes) */
|
||||||
unsigned short int Lepb;
|
unsigned short int Lepb;
|
||||||
/** single byte for the style */
|
/** single byte for the style */
|
||||||
unsigned char Depb;
|
unsigned char Depb;
|
||||||
/** four bytes, from 0 to 2^31-1 */
|
/** four bytes, from 0 to 2^31-1 */
|
||||||
unsigned long int LDPepb;
|
unsigned long int LDPepb;
|
||||||
/** four bytes, next error management method */
|
/** four bytes, next error management method */
|
||||||
unsigned long int Pepb;
|
unsigned long int Pepb;
|
||||||
/** EPB data, variable size */
|
/** EPB data, variable size */
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
/*@}*/
|
/*@}*/
|
||||||
} jpwl_epb_ms_t;
|
} jpwl_epb_ms_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
EPC (Error Protection Capability) Marker segment
|
EPC (Error Protection Capability) Marker segment
|
||||||
*/
|
*/
|
||||||
typedef struct jpwl_epc_ms {
|
typedef struct jpwl_epc_ms {
|
||||||
/** is ESD active? */
|
/** is ESD active? */
|
||||||
bool esd_on;
|
bool esd_on;
|
||||||
/** is RED active? */
|
/** is RED active? */
|
||||||
bool red_on;
|
bool red_on;
|
||||||
/** is EPB active? */
|
/** is EPB active? */
|
||||||
bool epb_on;
|
bool epb_on;
|
||||||
/** are informative techniques active? */
|
/** are informative techniques active? */
|
||||||
bool info_on;
|
bool info_on;
|
||||||
/**@name Marker segment fields */
|
/**@name Marker segment fields */
|
||||||
/*@{*/
|
/*@{*/
|
||||||
/** two bytes for the length of EPC MS, exluding the marker itself (9 to 65535 bytes) */
|
/** two bytes for the length of EPC MS, exluding the marker itself (9 to 65535 bytes) */
|
||||||
unsigned short int Lepc;
|
unsigned short int Lepc;
|
||||||
/** two bytes, CRC for the EPC, excluding Pcrc itself */
|
/** two bytes, CRC for the EPC, excluding Pcrc itself */
|
||||||
unsigned short int Pcrc;
|
unsigned short int Pcrc;
|
||||||
/** four bytes, the codestream length from SOC to EOC */
|
/** four bytes, the codestream length from SOC to EOC */
|
||||||
unsigned long int DL;
|
unsigned long int DL;
|
||||||
/** one byte, signals JPWL techniques adoption */
|
/** one byte, signals JPWL techniques adoption */
|
||||||
unsigned char Pepc;
|
unsigned char Pepc;
|
||||||
/** EPC data, variable length */
|
/** EPC data, variable length */
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
/*@}*/
|
/*@}*/
|
||||||
} jpwl_epc_ms_t;
|
} jpwl_epc_ms_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
ESD (Error Sensitivity Descriptor) Marker segment
|
ESD (Error Sensitivity Descriptor) Marker segment
|
||||||
*/
|
*/
|
||||||
typedef struct jpwl_esd_ms {
|
typedef struct jpwl_esd_ms {
|
||||||
/** codestream addressing mode [0=packet, 1=byte range, 2=packet range, 3=reserved] */
|
/** codestream addressing mode [0=packet, 1=byte range, 2=packet range, 3=reserved] */
|
||||||
unsigned char addrm;
|
unsigned char addrm;
|
||||||
/** size of codestream addresses [2/4 bytes] */
|
/** size of codestream addresses [2/4 bytes] */
|
||||||
unsigned char ad_size;
|
unsigned char ad_size;
|
||||||
/** type of sensitivity
|
/** type of sensitivity
|
||||||
[0=relative error, 1=MSE, 2=MSE reduction, 3=PSNR, 4=PSNR increment,
|
[0=relative error, 1=MSE, 2=MSE reduction, 3=PSNR, 4=PSNR increment,
|
||||||
5=MAXERR (absolute peak error), 6=TSE (total squared error), 7=reserved */
|
5=MAXERR (absolute peak error), 6=TSE (total squared error), 7=reserved */
|
||||||
unsigned char senst;
|
unsigned char senst;
|
||||||
/** size of sensitivity data (1/2 bytes) */
|
/** size of sensitivity data (1/2 bytes) */
|
||||||
unsigned char se_size;
|
unsigned char se_size;
|
||||||
/**@name Marker segment fields */
|
/**@name Marker segment fields */
|
||||||
/*@{*/
|
/*@{*/
|
||||||
/** two bytes for the length of ESD MS, exluding the marker itself (4 to 65535 bytes) */
|
/** two bytes for the length of ESD MS, exluding the marker itself (4 to 65535 bytes) */
|
||||||
unsigned short int Lesd;
|
unsigned short int Lesd;
|
||||||
/** two bytes, component of error sensitivity */
|
/** two bytes, component of error sensitivity */
|
||||||
unsigned short int Cesd;
|
unsigned short int Cesd;
|
||||||
/** one byte, signals JPWL techniques adoption */
|
/** one byte, signals JPWL techniques adoption */
|
||||||
unsigned char Pesd;
|
unsigned char Pesd;
|
||||||
/** ESD data, variable length */
|
/** ESD data, variable length */
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
/*@}*/
|
/*@}*/
|
||||||
/**@name Fields set by esd_create (only internal use) */
|
/**@name Fields set by esd_create (only internal use) */
|
||||||
/*@{*/
|
/*@{*/
|
||||||
/** number of components in the image */
|
/** number of components in the image */
|
||||||
int numcomps;
|
int numcomps;
|
||||||
/** tile where this marker has been placed (-1 means MH) */
|
/** tile where this marker has been placed (-1 means MH) */
|
||||||
int tileno;
|
int tileno;
|
||||||
/** number of sensitivity values */
|
/** number of sensitivity values */
|
||||||
unsigned long int svalnum;
|
unsigned long int svalnum;
|
||||||
/** size of a single sensitivity pair (address+value) */
|
/** size of a single sensitivity pair (address+value) */
|
||||||
size_t sensval_size;
|
size_t sensval_size;
|
||||||
/*@}*/
|
/*@}*/
|
||||||
} jpwl_esd_ms_t;
|
} jpwl_esd_ms_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
RED (Residual Error Descriptor) Marker segment
|
RED (Residual Error Descriptor) Marker segment
|
||||||
*/
|
*/
|
||||||
typedef struct jpwl_red_ms {
|
typedef struct jpwl_red_ms {
|
||||||
/** two bytes for the length of RED MS, exluding the marker itself (3 to 65535 bytes) */
|
/** two bytes for the length of RED MS, exluding the marker itself (3 to 65535 bytes) */
|
||||||
unsigned short int Lred;
|
unsigned short int Lred;
|
||||||
/** one byte, signals JPWL techniques adoption */
|
/** one byte, signals JPWL techniques adoption */
|
||||||
unsigned char Pred;
|
unsigned char Pred;
|
||||||
/** RED data, variable length */
|
/** RED data, variable length */
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
} jpwl_red_ms_t;
|
} jpwl_red_ms_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Structure used to store JPWL markers temporary position and readyness
|
Structure used to store JPWL markers temporary position and readyness
|
||||||
*/
|
*/
|
||||||
typedef struct jpwl_marker {
|
typedef struct jpwl_marker {
|
||||||
/** marker value (J2K_MS_EPC, etc.) */
|
/** marker value (J2K_MS_EPC, etc.) */
|
||||||
int id;
|
int id;
|
||||||
/** union keeping the pointer to the real marker struct */
|
/** union keeping the pointer to the real marker struct */
|
||||||
union {
|
union {
|
||||||
/** pointer to EPB marker */
|
/** pointer to EPB marker */
|
||||||
jpwl_epb_ms_t *epbmark;
|
jpwl_epb_ms_t *epbmark;
|
||||||
/** pointer to EPC marker */
|
/** pointer to EPC marker */
|
||||||
jpwl_epc_ms_t *epcmark;
|
jpwl_epc_ms_t *epcmark;
|
||||||
/** pointer to ESD marker */
|
/** pointer to ESD marker */
|
||||||
jpwl_esd_ms_t *esdmark;
|
jpwl_esd_ms_t *esdmark;
|
||||||
/** pointer to RED marker */
|
/** pointer to RED marker */
|
||||||
jpwl_red_ms_t *redmark;
|
jpwl_red_ms_t *redmark;
|
||||||
};
|
};
|
||||||
/** position where the marker should go, in the pre-JPWL codestream */
|
/** position where the marker should go, in the pre-JPWL codestream */
|
||||||
unsigned long int pos;
|
unsigned long int pos;
|
||||||
/** same as before, only written as a double, so we can sort it better */
|
/** same as before, only written as a double, so we can sort it better */
|
||||||
double dpos;
|
double dpos;
|
||||||
/** length of the marker segment (marker excluded) */
|
/** length of the marker segment (marker excluded) */
|
||||||
unsigned short int len;
|
unsigned short int len;
|
||||||
/** the marker length is ready or not? */
|
/** the marker length is ready or not? */
|
||||||
bool len_ready;
|
bool len_ready;
|
||||||
/** the marker position is ready or not? */
|
/** the marker position is ready or not? */
|
||||||
bool pos_ready;
|
bool pos_ready;
|
||||||
/** the marker parameters are ready or not? */
|
/** the marker parameters are ready or not? */
|
||||||
bool parms_ready;
|
bool parms_ready;
|
||||||
/** are the written data ready or not */
|
/** are the written data ready or not */
|
||||||
bool data_ready;
|
bool data_ready;
|
||||||
} jpwl_marker_t;
|
} jpwl_marker_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Prepare the list of JPWL markers, after the Part 1 codestream
|
Prepare the list of JPWL markers, after the Part 1 codestream
|
||||||
has been finalized (index struct is full)
|
has been finalized (index struct is full)
|
||||||
@param j2k J2K handle
|
@param j2k J2K handle
|
||||||
@param cio codestream handle
|
@param cio codestream handle
|
||||||
@param image image handle
|
@param image image handle
|
||||||
*/
|
*/
|
||||||
void jpwl_prepare_marks(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image);
|
void jpwl_prepare_marks(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Dump the list of JPWL markers, after it has been prepared
|
Dump the list of JPWL markers, after it has been prepared
|
||||||
@param j2k J2K handle
|
@param j2k J2K handle
|
||||||
@param cio codestream handle
|
@param cio codestream handle
|
||||||
@param image image handle
|
@param image image handle
|
||||||
*/
|
*/
|
||||||
void jpwl_dump_marks(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image);
|
void jpwl_dump_marks(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Read the EPC marker (Error Protection Capability)
|
Read the EPC marker (Error Protection Capability)
|
||||||
@param j2k J2K handle
|
@param j2k J2K handle
|
||||||
*/
|
*/
|
||||||
void j2k_read_epc(opj_j2k_t *j2k);
|
void j2k_read_epc(opj_j2k_t *j2k);
|
||||||
/**
|
/**
|
||||||
Write the EPC marker (Error Protection Capability), BUT the DL field is always set to 0
|
Write the EPC marker (Error Protection Capability), BUT the DL field is always set to 0
|
||||||
(this simplifies the management of EPBs and it is openly stated in the standard
|
(this simplifies the management of EPBs and it is openly stated in the standard
|
||||||
as a possible value, mening that the information is not available) and the informative techniques
|
as a possible value, mening that the information is not available) and the informative techniques
|
||||||
are not yet implemented
|
are not yet implemented
|
||||||
@param j2k J2K handle
|
@param j2k J2K handle
|
||||||
*/
|
*/
|
||||||
void j2k_write_epc(opj_j2k_t *j2k);
|
void j2k_write_epc(opj_j2k_t *j2k);
|
||||||
/**
|
/**
|
||||||
Read the EPB marker (Error Protection Block)
|
Read the EPB marker (Error Protection Block)
|
||||||
@param j2k J2K handle
|
@param j2k J2K handle
|
||||||
*/
|
*/
|
||||||
void j2k_read_epb(opj_j2k_t *j2k);
|
void j2k_read_epb(opj_j2k_t *j2k);
|
||||||
/**
|
/**
|
||||||
Write the EPB marker (Error Protection Block)
|
Write the EPB marker (Error Protection Block)
|
||||||
@param j2k J2K handle
|
@param j2k J2K handle
|
||||||
*/
|
*/
|
||||||
void j2k_write_epb(opj_j2k_t *j2k);
|
void j2k_write_epb(opj_j2k_t *j2k);
|
||||||
/**
|
/**
|
||||||
Read the ESD marker (Error Sensitivity Descriptor)
|
Read the ESD marker (Error Sensitivity Descriptor)
|
||||||
@param j2k J2K handle
|
@param j2k J2K handle
|
||||||
*/
|
*/
|
||||||
void j2k_read_esd(opj_j2k_t *j2k);
|
void j2k_read_esd(opj_j2k_t *j2k);
|
||||||
/**
|
/**
|
||||||
Read the RED marker (Residual Error Descriptor)
|
Read the RED marker (Residual Error Descriptor)
|
||||||
@param j2k J2K handle
|
@param j2k J2K handle
|
||||||
*/
|
*/
|
||||||
void j2k_read_red(opj_j2k_t *j2k);
|
void j2k_read_red(opj_j2k_t *j2k);
|
||||||
|
|
||||||
/** create an EPB marker segment
|
/** create an EPB marker segment
|
||||||
@param j2k J2K compressor handle
|
@param j2k J2K compressor handle
|
||||||
@param latest it is the latest EPB in the header
|
@param latest it is the latest EPB in the header
|
||||||
@param packed EPB is in packed style
|
@param packed EPB is in packed style
|
||||||
@param tileno tile number where the marker has been placed (-1 means MH)
|
@param tileno tile number where the marker has been placed (-1 means MH)
|
||||||
@param idx current EPB running index
|
@param idx current EPB running index
|
||||||
@param hprot applied protection type (-1/0,1,16,32,37-128)
|
@param hprot applied protection type (-1/0,1,16,32,37-128)
|
||||||
@param pre_len length of pre-protected data
|
@param pre_len length of pre-protected data
|
||||||
@param post_len length of post-protected data
|
@param post_len length of post-protected data
|
||||||
@return returns the freshly created EPB
|
@return returns the freshly created EPB
|
||||||
*/
|
*/
|
||||||
jpwl_epb_ms_t *jpwl_epb_create(opj_j2k_t *j2k, bool latest, bool packed, int tileno, int idx, int hprot,
|
jpwl_epb_ms_t *jpwl_epb_create(opj_j2k_t *j2k, bool latest, bool packed, int tileno, int idx, int hprot,
|
||||||
unsigned long int pre_len, unsigned long int post_len);
|
unsigned long int pre_len, unsigned long int post_len);
|
||||||
|
|
||||||
/** add a number of EPB marker segments
|
/** add a number of EPB marker segments
|
||||||
@param j2k J2K compressor handle
|
@param j2k J2K compressor handle
|
||||||
@param jwmarker pointer to the JPWL markers list
|
@param jwmarker pointer to the JPWL markers list
|
||||||
@param jwmarker_num pointer to the number of JPWL markers (gets updated)
|
@param jwmarker_num pointer to the number of JPWL markers (gets updated)
|
||||||
@param latest it is the latest group of EPBs in the header
|
@param latest it is the latest group of EPBs in the header
|
||||||
@param packed EPBs are in packed style
|
@param packed EPBs are in packed style
|
||||||
@param insideMH it is in the MH
|
@param insideMH it is in the MH
|
||||||
@param idx pointer to the starting EPB running index (gets updated)
|
@param idx pointer to the starting EPB running index (gets updated)
|
||||||
@param hprot applied protection type (-1/0,1,16,32,37-128)
|
@param hprot applied protection type (-1/0,1,16,32,37-128)
|
||||||
@param place_pos place in original codestream where EPBs should go
|
@param place_pos place in original codestream where EPBs should go
|
||||||
@param tileno tile number of these EPBs
|
@param tileno tile number of these EPBs
|
||||||
@param pre_len length of pre-protected data
|
@param pre_len length of pre-protected data
|
||||||
@param post_len length of post-protected data
|
@param post_len length of post-protected data
|
||||||
@return returns the length of all added markers
|
@return returns the length of all added markers
|
||||||
*/
|
*/
|
||||||
int jpwl_epbs_add(opj_j2k_t *j2k, jpwl_marker_t *jwmarker, int *jwmarker_num,
|
int jpwl_epbs_add(opj_j2k_t *j2k, jpwl_marker_t *jwmarker, int *jwmarker_num,
|
||||||
bool latest, bool packed, bool insideMH, int *idx, int hprot,
|
bool latest, bool packed, bool insideMH, int *idx, int hprot,
|
||||||
double place_pos, int tileno,
|
double place_pos, int tileno,
|
||||||
unsigned long int pre_len, unsigned long int post_len);
|
unsigned long int pre_len, unsigned long int post_len);
|
||||||
|
|
||||||
/** add a number of ESD marker segments
|
/** add a number of ESD marker segments
|
||||||
@param j2k J2K compressor handle
|
@param j2k J2K compressor handle
|
||||||
@param jwmarker pointer to the JPWL markers list
|
@param jwmarker pointer to the JPWL markers list
|
||||||
@param jwmarker_num pointer to the number of JPWL markers (gets updated)
|
@param jwmarker_num pointer to the number of JPWL markers (gets updated)
|
||||||
@param comps considered component (-1=average, 0/1/2/...=component no.)
|
@param comps considered component (-1=average, 0/1/2/...=component no.)
|
||||||
@param addrm addressing mode (0=packet, 1=byte range, 2=packet range, 3=reserved)
|
@param addrm addressing mode (0=packet, 1=byte range, 2=packet range, 3=reserved)
|
||||||
@param ad_size size of addresses (2/4 bytes)
|
@param ad_size size of addresses (2/4 bytes)
|
||||||
@param senst sensitivity type
|
@param senst sensitivity type
|
||||||
@param se_size sensitivity values size (1/2 bytes)
|
@param se_size sensitivity values size (1/2 bytes)
|
||||||
@param place_pos place in original codestream where EPBs should go
|
@param place_pos place in original codestream where EPBs should go
|
||||||
@param tileno tile number of these EPBs
|
@param tileno tile number of these EPBs
|
||||||
@return returns the length of all added markers
|
@return returns the length of all added markers
|
||||||
*/
|
*/
|
||||||
int jpwl_esds_add(opj_j2k_t *j2k, jpwl_marker_t *jwmarker, int *jwmarker_num,
|
int jpwl_esds_add(opj_j2k_t *j2k, jpwl_marker_t *jwmarker, int *jwmarker_num,
|
||||||
int comps, unsigned char addrm, unsigned char ad_size,
|
int comps, unsigned char addrm, unsigned char ad_size,
|
||||||
unsigned char senst, unsigned char se_size,
|
unsigned char senst, unsigned char se_size,
|
||||||
double place_pos, int tileno);
|
double place_pos, int tileno);
|
||||||
|
|
||||||
/** updates the information structure by modifying the positions and lengths
|
/** updates the information structure by modifying the positions and lengths
|
||||||
@param j2k J2K compressor handle
|
@param j2k J2K compressor handle
|
||||||
@param jwmarker pointer to JPWL markers list
|
@param jwmarker pointer to JPWL markers list
|
||||||
@param jwmarker_num number of JPWL markers
|
@param jwmarker_num number of JPWL markers
|
||||||
@return returns true in case of success
|
@return returns true in case of success
|
||||||
*/
|
*/
|
||||||
bool jpwl_update_info(opj_j2k_t *j2k, jpwl_marker_t *jwmarker, int jwmarker_num);
|
bool jpwl_update_info(opj_j2k_t *j2k, jpwl_marker_t *jwmarker, int jwmarker_num);
|
||||||
|
|
||||||
|
|
||||||
bool jpwl_esd_fill(opj_j2k_t *j2k, jpwl_esd_ms_t *esdmark, unsigned char *buf);
|
bool jpwl_esd_fill(opj_j2k_t *j2k, jpwl_esd_ms_t *esdmark, unsigned char *buf);
|
||||||
|
|
||||||
bool jpwl_epb_fill(opj_j2k_t *j2k, jpwl_epb_ms_t *epbmark, unsigned char *buf, unsigned char *post_buf);
|
bool jpwl_epb_fill(opj_j2k_t *j2k, jpwl_epb_ms_t *epbmark, unsigned char *buf, unsigned char *post_buf);
|
||||||
|
|
||||||
/** corrects the data in the JPWL codestream
|
/** corrects the data in the JPWL codestream
|
||||||
@param j2k J2K compressor handle
|
@param j2k J2K compressor handle
|
||||||
@return true if correction is performed correctly
|
@return true if correction is performed correctly
|
||||||
*/
|
*/
|
||||||
bool jpwl_correct(opj_j2k_t *j2k);
|
bool jpwl_correct(opj_j2k_t *j2k);
|
||||||
|
|
||||||
/** corrects the data protected by an EPB
|
/** corrects the data protected by an EPB
|
||||||
@param j2k J2K compressor handle
|
@param j2k J2K compressor handle
|
||||||
@param buffer pointer to the EPB position
|
@param buffer pointer to the EPB position
|
||||||
@param type type of EPB: 0=MH, 1=TPH, 2=other, 3=auto
|
@param type type of EPB: 0=MH, 1=TPH, 2=other, 3=auto
|
||||||
@param pre_len length of pre-data
|
@param pre_len length of pre-data
|
||||||
@param post_len length of post_data
|
@param post_len length of post_data
|
||||||
@param conn is a pointer to the length of all connected (packed) EPBs
|
@param conn is a pointer to the length of all connected (packed) EPBs
|
||||||
@param L4_bufp is a pointer to the buffer pointer of redundancy data
|
@param L4_bufp is a pointer to the buffer pointer of redundancy data
|
||||||
@return returns true if correction could be succesfully performed
|
@return returns true if correction could be succesfully performed
|
||||||
*/
|
*/
|
||||||
bool jpwl_epb_correct(opj_j2k_t *j2k, unsigned char *buffer, int type, int pre_len, int post_len, int *conn,
|
bool jpwl_epb_correct(opj_j2k_t *j2k, unsigned char *buffer, int type, int pre_len, int post_len, int *conn,
|
||||||
unsigned char **L4_bufp);
|
unsigned char **L4_bufp);
|
||||||
|
|
||||||
/** check that a tile and its children have valid data
|
/** check that a tile and its children have valid data
|
||||||
@param j2k J2K decompressor handle
|
@param j2k J2K decompressor handle
|
||||||
@param tcd Tile decompressor handle
|
@param tcd Tile decompressor handle
|
||||||
@param tileno number of the tile to check
|
@param tileno number of the tile to check
|
||||||
*/
|
*/
|
||||||
bool jpwl_check_tile(opj_j2k_t *j2k, opj_tcd_t *tcd, int tileno);
|
bool jpwl_check_tile(opj_j2k_t *j2k, opj_tcd_t *tcd, int tileno);
|
||||||
|
|
||||||
/** Macro functions for CRC computation */
|
/** Macro functions for CRC computation */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Computes the CRC-16, as stated in JPWL specs
|
Computes the CRC-16, as stated in JPWL specs
|
||||||
@param CRC two bytes containing the CRC value (must be initialized with 0x0000)
|
@param CRC two bytes containing the CRC value (must be initialized with 0x0000)
|
||||||
@param DATA byte for which the CRC is computed; call this on every byte of the sequence
|
@param DATA byte for which the CRC is computed; call this on every byte of the sequence
|
||||||
and get the CRC at the end
|
and get the CRC at the end
|
||||||
*/
|
*/
|
||||||
#define jpwl_updateCRC16(CRC, DATA) updateCRC16(CRC, DATA)
|
#define jpwl_updateCRC16(CRC, DATA) updateCRC16(CRC, DATA)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Computes the CRC-32, as stated in JPWL specs
|
Computes the CRC-32, as stated in JPWL specs
|
||||||
@param CRC four bytes containing the CRC value (must be initialized with 0x00000000)
|
@param CRC four bytes containing the CRC value (must be initialized with 0x00000000)
|
||||||
@param DATA byte for which the CRC is computed; call this on every byte of the sequence
|
@param DATA byte for which the CRC is computed; call this on every byte of the sequence
|
||||||
and get the CRC at the end
|
and get the CRC at the end
|
||||||
*/
|
*/
|
||||||
#define jpwl_updateCRC32(CRC, DATA) updateCRC32(CRC, DATA)
|
#define jpwl_updateCRC32(CRC, DATA) updateCRC32(CRC, DATA)
|
||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
#endif /* USE_JPWL */
|
#endif /* USE_JPWL */
|
||||||
|
|
||||||
#endif /* __JPWL_H */
|
#endif /* __JPWL_H */
|
||||||
|
|
Loading…
Reference in New Issue