mirror of https://github.com/opencv/opencv.git
Merge pull request #23682 from asmorkalov:as/openjpeg_2.5.0
3rdparty: OpenJPEG update 2.4.0 => 2.5.0pull/23595/head
commit
6ad77b2319
36 changed files with 6714 additions and 180 deletions
@ -0,0 +1,353 @@ |
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses |
||||
* BSD License, included below. This software may be subject to other third |
||||
* party and contributor rights, including patent rights, and no such rights |
||||
* are granted under this license. |
||||
* |
||||
* Copyright (c) 2017, IntoPix SA <contact@intopix.com> |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions |
||||
* are met: |
||||
* 1. Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* 2. Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' |
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
* 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 |
||||
* POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
#include "opj_includes.h" |
||||
|
||||
#ifdef _WIN32 |
||||
#include <windows.h> |
||||
#else |
||||
#include <sys/time.h> |
||||
#include <sys/resource.h> |
||||
#include <sys/times.h> |
||||
#endif /* _WIN32 */ |
||||
|
||||
OPJ_INT32 getValue(OPJ_UINT32 i) |
||||
{ |
||||
return ((OPJ_INT32)i % 511) - 256; |
||||
} |
||||
|
||||
void init_tilec(opj_tcd_tilecomp_t * l_tilec, |
||||
OPJ_INT32 x0, |
||||
OPJ_INT32 y0, |
||||
OPJ_INT32 x1, |
||||
OPJ_INT32 y1, |
||||
OPJ_UINT32 numresolutions, |
||||
OPJ_BOOL irreversible) |
||||
{ |
||||
opj_tcd_resolution_t* l_res; |
||||
OPJ_UINT32 resno, l_level_no; |
||||
size_t i, nValues; |
||||
|
||||
memset(l_tilec, 0, sizeof(*l_tilec)); |
||||
l_tilec->x0 = x0; |
||||
l_tilec->y0 = y0; |
||||
l_tilec->x1 = x1; |
||||
l_tilec->y1 = y1; |
||||
nValues = (size_t)(l_tilec->x1 - l_tilec->x0) * |
||||
(size_t)(l_tilec->y1 - l_tilec->y0); |
||||
l_tilec->data = (OPJ_INT32*) opj_malloc(sizeof(OPJ_INT32) * nValues); |
||||
for (i = 0; i < nValues; i++) { |
||||
OPJ_INT32 val = getValue((OPJ_UINT32)i); |
||||
if (irreversible) { |
||||
OPJ_FLOAT32 fVal = (OPJ_FLOAT32)val; |
||||
memcpy(&l_tilec->data[i], &fVal, sizeof(OPJ_FLOAT32)); |
||||
} else { |
||||
l_tilec->data[i] = val; |
||||
} |
||||
} |
||||
l_tilec->numresolutions = numresolutions; |
||||
l_tilec->minimum_num_resolutions = numresolutions; |
||||
l_tilec->resolutions = (opj_tcd_resolution_t*) opj_calloc( |
||||
l_tilec->numresolutions, |
||||
sizeof(opj_tcd_resolution_t)); |
||||
|
||||
l_level_no = l_tilec->numresolutions; |
||||
l_res = l_tilec->resolutions; |
||||
|
||||
/* Adapted from opj_tcd_init_tile() */ |
||||
for (resno = 0; resno < l_tilec->numresolutions; ++resno) { |
||||
|
||||
--l_level_no; |
||||
|
||||
/* border for each resolution level (global) */ |
||||
l_res->x0 = opj_int_ceildivpow2(l_tilec->x0, (OPJ_INT32)l_level_no); |
||||
l_res->y0 = opj_int_ceildivpow2(l_tilec->y0, (OPJ_INT32)l_level_no); |
||||
l_res->x1 = opj_int_ceildivpow2(l_tilec->x1, (OPJ_INT32)l_level_no); |
||||
l_res->y1 = opj_int_ceildivpow2(l_tilec->y1, (OPJ_INT32)l_level_no); |
||||
|
||||
++l_res; |
||||
} |
||||
} |
||||
|
||||
void free_tilec(opj_tcd_tilecomp_t * l_tilec) |
||||
{ |
||||
opj_free(l_tilec->data); |
||||
opj_free(l_tilec->resolutions); |
||||
} |
||||
|
||||
void usage(void) |
||||
{ |
||||
printf( |
||||
"bench_dwt [-decode|encode] [-I] [-size value] [-check] [-display]\n"); |
||||
printf( |
||||
" [-num_resolutions val] [-offset x y] [-num_threads val]\n"); |
||||
exit(1); |
||||
} |
||||
|
||||
|
||||
OPJ_FLOAT64 opj_clock(void) |
||||
{ |
||||
#ifdef _WIN32 |
||||
/* _WIN32: use QueryPerformance (very accurate) */ |
||||
LARGE_INTEGER freq, t ; |
||||
/* freq is the clock speed of the CPU */ |
||||
QueryPerformanceFrequency(&freq) ; |
||||
/* cout << "freq = " << ((double) freq.QuadPart) << endl; */ |
||||
/* t is the high resolution performance counter (see MSDN) */ |
||||
QueryPerformanceCounter(& t) ; |
||||
return freq.QuadPart ? (t.QuadPart / (OPJ_FLOAT64) freq.QuadPart) : 0 ; |
||||
#else |
||||
/* Unix or Linux: use resource usage */ |
||||
struct rusage t; |
||||
OPJ_FLOAT64 procTime; |
||||
/* (1) Get the rusage data structure at this moment (man getrusage) */ |
||||
getrusage(0, &t); |
||||
/* (2) What is the elapsed time ? - CPU time = User time + System time */ |
||||
/* (2a) Get the seconds */ |
||||
procTime = (OPJ_FLOAT64)(t.ru_utime.tv_sec + t.ru_stime.tv_sec); |
||||
/* (2b) More precisely! Get the microseconds part ! */ |
||||
return (procTime + (OPJ_FLOAT64)(t.ru_utime.tv_usec + t.ru_stime.tv_usec) * |
||||
1e-6) ; |
||||
#endif |
||||
} |
||||
|
||||
static OPJ_FLOAT64 opj_wallclock(void) |
||||
{ |
||||
#ifdef _WIN32 |
||||
return opj_clock(); |
||||
#else |
||||
struct timeval tv; |
||||
gettimeofday(&tv, NULL); |
||||
return (OPJ_FLOAT64)tv.tv_sec + 1e-6 * (OPJ_FLOAT64)tv.tv_usec; |
||||
#endif |
||||
} |
||||
|
||||
int main(int argc, char** argv) |
||||
{ |
||||
int num_threads = 0; |
||||
opj_tcd_t tcd; |
||||
opj_tcd_image_t tcd_image; |
||||
opj_tcd_tile_t tcd_tile; |
||||
opj_tcd_tilecomp_t tilec; |
||||
opj_image_t image; |
||||
opj_image_comp_t image_comp; |
||||
opj_thread_pool_t* tp; |
||||
OPJ_INT32 i, j, k; |
||||
OPJ_BOOL display = OPJ_FALSE; |
||||
OPJ_BOOL check = OPJ_FALSE; |
||||
OPJ_INT32 size = 16384 - 1; |
||||
OPJ_FLOAT64 start, stop; |
||||
OPJ_FLOAT64 start_wc, stop_wc; |
||||
OPJ_UINT32 offset_x = ((OPJ_UINT32)size + 1) / 2 - 1; |
||||
OPJ_UINT32 offset_y = ((OPJ_UINT32)size + 1) / 2 - 1; |
||||
OPJ_UINT32 num_resolutions = 6; |
||||
OPJ_BOOL bench_decode = OPJ_TRUE; |
||||
OPJ_BOOL irreversible = OPJ_FALSE; |
||||
|
||||
for (i = 1; i < argc; i++) { |
||||
if (strcmp(argv[i], "-encode") == 0) { |
||||
bench_decode = OPJ_FALSE; |
||||
} else if (strcmp(argv[i], "-decode") == 0) { |
||||
bench_decode = OPJ_TRUE; |
||||
} else if (strcmp(argv[i], "-display") == 0) { |
||||
display = OPJ_TRUE; |
||||
} else if (strcmp(argv[i], "-check") == 0) { |
||||
check = OPJ_TRUE; |
||||
} else if (strcmp(argv[i], "-I") == 0) { |
||||
irreversible = OPJ_TRUE; |
||||
} else if (strcmp(argv[i], "-size") == 0 && i + 1 < argc) { |
||||
size = atoi(argv[i + 1]); |
||||
i ++; |
||||
} else if (strcmp(argv[i], "-num_threads") == 0 && i + 1 < argc) { |
||||
num_threads = atoi(argv[i + 1]); |
||||
i ++; |
||||
} else if (strcmp(argv[i], "-num_resolutions") == 0 && i + 1 < argc) { |
||||
num_resolutions = (OPJ_UINT32)atoi(argv[i + 1]); |
||||
if (num_resolutions == 0 || num_resolutions > 32) { |
||||
fprintf(stderr, |
||||
"Invalid value for num_resolutions. Should be >= 1 and <= 32\n"); |
||||
exit(1); |
||||
} |
||||
i ++; |
||||
} else if (strcmp(argv[i], "-offset") == 0 && i + 2 < argc) { |
||||
offset_x = (OPJ_UINT32)atoi(argv[i + 1]); |
||||
offset_y = (OPJ_UINT32)atoi(argv[i + 2]); |
||||
i += 2; |
||||
} else { |
||||
usage(); |
||||
} |
||||
} |
||||
|
||||
if (irreversible && check) { |
||||
/* Due to irreversible inverse DWT not being symmetric of forward */ |
||||
/* See BUG_WEIRD_TWO_INVK in dwt.c */ |
||||
printf("-I and -check aren't compatible\n"); |
||||
exit(1); |
||||
} |
||||
|
||||
tp = opj_thread_pool_create(num_threads); |
||||
|
||||
init_tilec(&tilec, (OPJ_INT32)offset_x, (OPJ_INT32)offset_y, |
||||
(OPJ_INT32)offset_x + size, (OPJ_INT32)offset_y + size, |
||||
num_resolutions, irreversible); |
||||
|
||||
if (display) { |
||||
printf("Before\n"); |
||||
k = 0; |
||||
for (j = 0; j < tilec.y1 - tilec.y0; j++) { |
||||
for (i = 0; i < tilec.x1 - tilec.x0; i++) { |
||||
if (irreversible) { |
||||
printf("%f ", ((OPJ_FLOAT32*)tilec.data)[k]); |
||||
} else { |
||||
printf("%d ", tilec.data[k]); |
||||
} |
||||
k ++; |
||||
} |
||||
printf("\n"); |
||||
} |
||||
} |
||||
|
||||
memset(&tcd, 0, sizeof(tcd)); |
||||
tcd.thread_pool = tp; |
||||
tcd.whole_tile_decoding = OPJ_TRUE; |
||||
tcd.win_x0 = (OPJ_UINT32)tilec.x0; |
||||
tcd.win_y0 = (OPJ_UINT32)tilec.y0; |
||||
tcd.win_x1 = (OPJ_UINT32)tilec.x1; |
||||
tcd.win_y1 = (OPJ_UINT32)tilec.y1; |
||||
tcd.tcd_image = &tcd_image; |
||||
memset(&tcd_image, 0, sizeof(tcd_image)); |
||||
tcd_image.tiles = &tcd_tile; |
||||
memset(&tcd_tile, 0, sizeof(tcd_tile)); |
||||
tcd_tile.x0 = tilec.x0; |
||||
tcd_tile.y0 = tilec.y0; |
||||
tcd_tile.x1 = tilec.x1; |
||||
tcd_tile.y1 = tilec.y1; |
||||
tcd_tile.numcomps = 1; |
||||
tcd_tile.comps = &tilec; |
||||
tcd.image = ℑ |
||||
memset(&image, 0, sizeof(image)); |
||||
image.numcomps = 1; |
||||
image.comps = &image_comp; |
||||
memset(&image_comp, 0, sizeof(image_comp)); |
||||
image_comp.dx = 1; |
||||
image_comp.dy = 1; |
||||
|
||||
start = opj_clock(); |
||||
start_wc = opj_wallclock(); |
||||
if (bench_decode) { |
||||
if (irreversible) { |
||||
opj_dwt_decode_real(&tcd, &tilec, tilec.numresolutions); |
||||
} else { |
||||
opj_dwt_decode(&tcd, &tilec, tilec.numresolutions); |
||||
} |
||||
} else { |
||||
if (irreversible) { |
||||
opj_dwt_encode_real(&tcd, &tilec); |
||||
} else { |
||||
opj_dwt_encode(&tcd, &tilec); |
||||
} |
||||
} |
||||
stop = opj_clock(); |
||||
stop_wc = opj_wallclock(); |
||||
printf("time for %s: total = %.03f s, wallclock = %.03f s\n", |
||||
bench_decode ? "dwt_decode" : "dwt_encode", |
||||
stop - start, |
||||
stop_wc - start_wc); |
||||
|
||||
if (display) { |
||||
if (bench_decode) { |
||||
printf("After IDWT\n"); |
||||
} else { |
||||
printf("After FDWT\n"); |
||||
} |
||||
k = 0; |
||||
for (j = 0; j < tilec.y1 - tilec.y0; j++) { |
||||
for (i = 0; i < tilec.x1 - tilec.x0; i++) { |
||||
if (irreversible) { |
||||
printf("%f ", ((OPJ_FLOAT32*)tilec.data)[k]); |
||||
} else { |
||||
printf("%d ", tilec.data[k]); |
||||
} |
||||
k ++; |
||||
} |
||||
printf("\n"); |
||||
} |
||||
} |
||||
|
||||
if ((display || check) && !irreversible) { |
||||
|
||||
if (bench_decode) { |
||||
opj_dwt_encode(&tcd, &tilec); |
||||
} else { |
||||
opj_dwt_decode(&tcd, &tilec, tilec.numresolutions); |
||||
} |
||||
|
||||
|
||||
if (display && !irreversible) { |
||||
if (bench_decode) { |
||||
printf("After FDWT\n"); |
||||
} else { |
||||
printf("After IDWT\n"); |
||||
} |
||||
k = 0; |
||||
for (j = 0; j < tilec.y1 - tilec.y0; j++) { |
||||
for (i = 0; i < tilec.x1 - tilec.x0; i++) { |
||||
if (irreversible) { |
||||
printf("%f ", ((OPJ_FLOAT32*)tilec.data)[k]); |
||||
} else { |
||||
printf("%d ", tilec.data[k]); |
||||
} |
||||
k ++; |
||||
} |
||||
printf("\n"); |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
if (check) { |
||||
|
||||
size_t idx; |
||||
size_t nValues = (size_t)(tilec.x1 - tilec.x0) * |
||||
(size_t)(tilec.y1 - tilec.y0); |
||||
for (idx = 0; idx < nValues; idx++) { |
||||
if (tilec.data[idx] != getValue((OPJ_UINT32)idx)) { |
||||
printf("Difference found at idx = %u\n", (OPJ_UINT32)idx); |
||||
exit(1); |
||||
} |
||||
} |
||||
} |
||||
|
||||
free_tilec(&tilec); |
||||
|
||||
opj_thread_pool_destroy(tp); |
||||
return 0; |
||||
} |
@ -0,0 +1,259 @@ |
||||
/*
|
||||
* $Id: cidx_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $ |
||||
* |
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium |
||||
* Copyright (c) 2002-2014, Professor Benoit Macq |
||||
* Copyright (c) 2003-2004, Yannick Verschueren |
||||
* Copyright (c) 2010-2011, Kaori Hagihara |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions |
||||
* are met: |
||||
* 1. Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* 2. Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' |
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
* 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 |
||||
* POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
#include "opj_includes.h" |
||||
|
||||
|
||||
/*
|
||||
* Write CPTR Codestream finder box |
||||
* |
||||
* @param[in] coff offset of j2k codestream |
||||
* @param[in] clen length of j2k codestream |
||||
* @param[in] cio file output handle |
||||
*/ |
||||
|
||||
void opj_write_cptr(int coff, int clen, opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager); |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int opj_write_cidx(int offset, opj_stream_private_t *cio, |
||||
opj_codestream_info_t cstr_info, int j2klen, |
||||
opj_event_mgr_t * p_manager) |
||||
{ |
||||
int i; |
||||
OPJ_OFF_T lenp; |
||||
OPJ_UINT32 len; |
||||
opj_jp2_box_t *box; |
||||
int num_box = 0; |
||||
OPJ_BOOL EPHused; |
||||
OPJ_BYTE l_data_header [4]; |
||||
|
||||
lenp = -1; |
||||
box = (opj_jp2_box_t *)opj_calloc(32, sizeof(opj_jp2_box_t)); |
||||
if (box == NULL) { |
||||
return 0; |
||||
} |
||||
for (i = 0; i < 2; i++) { |
||||
|
||||
if (i) { |
||||
opj_stream_seek(cio, lenp, p_manager); |
||||
} |
||||
|
||||
|
||||
lenp = opj_stream_tell(cio); |
||||
|
||||
opj_stream_skip(cio, 4, p_manager); /* L [at the end] */ |
||||
|
||||
opj_write_bytes(l_data_header, JPIP_CIDX, 4); /* CIDX */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
|
||||
opj_write_cptr(offset, cstr_info.codestream_size, cio, p_manager); |
||||
|
||||
opj_write_manf(i, num_box, box, cio, p_manager); |
||||
|
||||
num_box = 0; |
||||
box[num_box].length = (OPJ_UINT32)opj_write_mainmhix(offset, cstr_info, cio, |
||||
p_manager); |
||||
box[num_box].type = JPIP_MHIX; |
||||
num_box++; |
||||
|
||||
box[num_box].length = (OPJ_UINT32)opj_write_tpix(offset, cstr_info, j2klen, cio, |
||||
p_manager); |
||||
box[num_box].type = JPIP_TPIX; |
||||
num_box++; |
||||
|
||||
box[num_box].length = (OPJ_UINT32)opj_write_thix(offset, cstr_info, cio, |
||||
p_manager); |
||||
box[num_box].type = JPIP_THIX; |
||||
num_box++; |
||||
|
||||
EPHused = opj_check_EPHuse(offset, cstr_info.marker, cstr_info.marknum, cio, |
||||
p_manager); |
||||
|
||||
box[num_box].length = (OPJ_UINT32)opj_write_ppix(offset, cstr_info, EPHused, |
||||
j2klen, cio, p_manager); |
||||
box[num_box].type = JPIP_PPIX; |
||||
num_box++; |
||||
|
||||
box[num_box].length = (OPJ_UINT32)opj_write_phix(offset, cstr_info, EPHused, |
||||
j2klen, cio, p_manager); |
||||
box[num_box].type = JPIP_PHIX; |
||||
num_box++; |
||||
|
||||
len = (OPJ_UINT32)(opj_stream_tell(cio) - lenp); |
||||
opj_stream_seek(cio, lenp, p_manager); |
||||
opj_write_bytes(l_data_header, len, 4); /* L */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_stream_seek(cio, lenp + len, p_manager); |
||||
} |
||||
|
||||
opj_free(box); |
||||
|
||||
return (int)len; |
||||
} |
||||
|
||||
|
||||
|
||||
void opj_write_cptr(int coff, int clen, opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager) |
||||
{ |
||||
OPJ_BYTE l_data_header [3 * 8]; |
||||
OPJ_UINT32 len; |
||||
OPJ_OFF_T lenp; |
||||
|
||||
|
||||
lenp = opj_stream_tell(cio); |
||||
opj_stream_skip(cio, 4, p_manager); /* L [at the end] */ |
||||
opj_write_bytes(l_data_header, JPIP_CPTR, 4); /* T */ |
||||
opj_write_bytes(l_data_header + 4, 0, 2); /* DR A PRECISER !! */ |
||||
opj_write_bytes(l_data_header + 6, 0, 2); /* CONT */ |
||||
opj_write_bytes(l_data_header + 8, (OPJ_UINT32)coff, |
||||
8); /* COFF A PRECISER !! */ |
||||
opj_write_bytes(l_data_header + 16, (OPJ_UINT32)clen, |
||||
8); /* CLEN */ |
||||
opj_stream_write_data(cio, l_data_header, 3 * 8, p_manager); |
||||
|
||||
len = (OPJ_UINT32)(opj_stream_tell(cio) - lenp); |
||||
opj_stream_seek(cio, lenp, p_manager); |
||||
opj_write_bytes(l_data_header, len, 4); /* L */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_stream_seek(cio, lenp + len, p_manager); |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
void opj_write_manf(int second, |
||||
int v, |
||||
opj_jp2_box_t *box, |
||||
opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager) |
||||
{ |
||||
OPJ_BYTE l_data_header [4]; |
||||
int i; |
||||
OPJ_UINT32 len; |
||||
OPJ_OFF_T lenp; |
||||
|
||||
lenp = opj_stream_tell(cio); |
||||
opj_stream_skip(cio, 4, p_manager); /* L [at the end] */ |
||||
opj_write_bytes(l_data_header, JPIP_MANF, 4); /* T */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
|
||||
if (second) { /* Write only during the second pass */ |
||||
for (i = 0; i < v; i++) { |
||||
opj_write_bytes(l_data_header, box[i].length, |
||||
4); /* Box length */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_write_bytes(l_data_header, box[i].type, |
||||
4); /* Box type */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
} |
||||
} |
||||
|
||||
len = (OPJ_UINT32)(opj_stream_tell(cio) - lenp); |
||||
opj_stream_seek(cio, lenp, p_manager); |
||||
opj_write_bytes(l_data_header, len, 4);/* L */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_stream_seek(cio, lenp + len, p_manager); |
||||
} |
||||
|
||||
|
||||
int opj_write_mainmhix(int coff, opj_codestream_info_t cstr_info, |
||||
opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager) |
||||
{ |
||||
OPJ_BYTE l_data_header [8]; |
||||
OPJ_UINT32 i; |
||||
OPJ_UINT32 len; |
||||
OPJ_OFF_T lenp; |
||||
|
||||
lenp = opj_stream_tell(cio); |
||||
opj_stream_skip(cio, 4, |
||||
p_manager); /* L [at the end] */ |
||||
opj_write_bytes(l_data_header, JPIP_MHIX, |
||||
4); /* MHIX */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
|
||||
opj_write_bytes(l_data_header, |
||||
(OPJ_UINT32)(cstr_info.main_head_end - cstr_info.main_head_start + 1), |
||||
8); /* TLEN */ |
||||
opj_stream_write_data(cio, l_data_header, 8, p_manager); |
||||
|
||||
for (i = 1; i < (OPJ_UINT32)cstr_info.marknum; |
||||
i++) { /* Marker restricted to 1 apparition, skip SOC marker */ |
||||
opj_write_bytes(l_data_header, cstr_info.marker[i].type, 2); |
||||
opj_write_bytes(l_data_header + 2, 0, 2); |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_write_bytes(l_data_header, (OPJ_UINT32)(cstr_info.marker[i].pos - coff), 8); |
||||
opj_stream_write_data(cio, l_data_header, 8, p_manager); |
||||
opj_write_bytes(l_data_header, (OPJ_UINT32)cstr_info.marker[i].len, 2); |
||||
opj_stream_write_data(cio, l_data_header, 2, p_manager); |
||||
} |
||||
|
||||
len = (OPJ_UINT32)(opj_stream_tell(cio) - lenp); |
||||
opj_stream_seek(cio, lenp, p_manager); |
||||
opj_write_bytes(l_data_header, len, 4); /* L */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_stream_seek(cio, lenp + len, p_manager); |
||||
|
||||
return (int)len; |
||||
} |
||||
|
||||
OPJ_BOOL opj_check_EPHuse(int coff, opj_marker_info_t *markers, int marknum, |
||||
opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager) |
||||
{ |
||||
OPJ_BYTE l_data_header [4]; |
||||
OPJ_BOOL EPHused = OPJ_FALSE; |
||||
int i = 0; |
||||
OPJ_OFF_T org_pos; |
||||
unsigned int Scod; |
||||
|
||||
for (i = 0; i < marknum; i++) { |
||||
if (markers[i].type == J2K_MS_COD) { |
||||
org_pos = opj_stream_tell(cio); |
||||
opj_stream_seek(cio, coff + markers[i].pos + 2, p_manager); |
||||
|
||||
opj_stream_read_data(cio, l_data_header, 1, p_manager); |
||||
opj_read_bytes(l_data_header, &Scod, 1); |
||||
if (((Scod >> 2) & 1)) { |
||||
EPHused = OPJ_TRUE; |
||||
} |
||||
opj_stream_seek(cio, org_pos, p_manager); |
||||
|
||||
break; |
||||
} |
||||
} |
||||
return EPHused; |
||||
} |
@ -0,0 +1,70 @@ |
||||
/*
|
||||
* $Id: cidx_manager.h 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $ |
||||
* |
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium |
||||
* Copyright (c) 2002-2014, Professor Benoit Macq |
||||
* Copyright (c) 2003-2004, Yannick Verschueren |
||||
* Copyright (c) 2010-2011, Kaori Hagihara |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions |
||||
* are met: |
||||
* 1. Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* 2. Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' |
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
* 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 |
||||
* POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
/*! \file
|
||||
* \brief Modification of jpip.h from 2KAN indexer |
||||
*/ |
||||
|
||||
|
||||
#ifndef CIDX_MANAGER_H_ |
||||
# define CIDX_MANAGER_H_ |
||||
|
||||
#include "openjpeg.h" |
||||
|
||||
|
||||
/*
|
||||
* Write Codestream index box (superbox) |
||||
* |
||||
* @param[in] offset offset of j2k codestream |
||||
* @param[in] cio file output handle |
||||
* @param[in] image image data |
||||
* @param[in] cstr_info codestream information |
||||
* @param[in] j2klen length of j2k codestream |
||||
* @return length of cidx box |
||||
*/ |
||||
int opj_write_cidx(int offset, opj_stream_private_t *cio, |
||||
opj_codestream_info_t cstr_info, int j2klen, |
||||
opj_event_mgr_t * p_manager); |
||||
|
||||
/*
|
||||
* Check if EPH option is used |
||||
* |
||||
* @param[in] coff offset of j2k codestream |
||||
* @param[in] markers marker information |
||||
* @param[in] marknum number of markers |
||||
* @param[in] cio file output handle |
||||
* @return true if EPH is used |
||||
*/ |
||||
OPJ_BOOL opj_check_EPHuse(int coff, opj_marker_info_t *markers, int marknum, |
||||
opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager); |
||||
|
||||
#endif /* !CIDX_MANAGER_H_ */ |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,157 @@ |
||||
/*
|
||||
* $Id: indexbox_manager.h 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $ |
||||
* |
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium |
||||
* Copyright (c) 2002-2014, Professor Benoit Macq |
||||
* Copyright (c) 2003-2004, Yannick Verschueren |
||||
* Copyright (c) 2010-2011, Kaori Hagihara |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions |
||||
* are met: |
||||
* 1. Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* 2. Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' |
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
* 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 |
||||
* POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
/*! \file
|
||||
* \brief Modification of jpip.c from 2KAN indexer |
||||
*/ |
||||
|
||||
#ifndef INDEXBOX_MANAGER_H_ |
||||
# define INDEXBOX_MANAGER_H_ |
||||
|
||||
#include "openjpeg.h" |
||||
#include "j2k.h" /* needed to use jp2.h */ |
||||
#include "jp2.h" |
||||
|
||||
#define JPIP_CIDX 0x63696478 /* Codestream index */ |
||||
#define JPIP_CPTR 0x63707472 /* Codestream Finder Box */ |
||||
#define JPIP_MANF 0x6d616e66 /* Manifest Box */ |
||||
#define JPIP_FAIX 0x66616978 /* Fragment array Index box */ |
||||
#define JPIP_MHIX 0x6d686978 /* Main Header Index Table */ |
||||
#define JPIP_TPIX 0x74706978 /* Tile-part Index Table box */ |
||||
#define JPIP_THIX 0x74686978 /* Tile header Index Table box */ |
||||
#define JPIP_PPIX 0x70706978 /* Precinct Packet Index Table box */ |
||||
#define JPIP_PHIX 0x70686978 /* Packet Header index Table */ |
||||
#define JPIP_FIDX 0x66696478 /* File Index */ |
||||
#define JPIP_FPTR 0x66707472 /* File Finder */ |
||||
#define JPIP_PRXY 0x70727879 /* Proxy boxes */ |
||||
#define JPIP_IPTR 0x69707472 /* Index finder box */ |
||||
#define JPIP_PHLD 0x70686c64 /* Place holder */ |
||||
|
||||
|
||||
/*
|
||||
* Write tile-part Index table box (superbox) |
||||
* |
||||
* @param[in] coff offset of j2k codestream |
||||
* @param[in] cstr_info codestream information |
||||
* @param[in] j2klen length of j2k codestream |
||||
* @param[in] cio file output handle |
||||
* @return length of tpix box |
||||
*/ |
||||
int opj_write_tpix(int coff, opj_codestream_info_t cstr_info, int j2klen, |
||||
opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager); |
||||
|
||||
|
||||
/*
|
||||
* Write tile header index table box (superbox) |
||||
* |
||||
* @param[in] coff offset of j2k codestream |
||||
* @param[in] cstr_info codestream information pointer |
||||
* @param[in] cio file output handle |
||||
* @return length of thix box |
||||
*/ |
||||
int opj_write_thix(int coff, opj_codestream_info_t cstr_info, |
||||
opj_stream_private_t *cio, opj_event_mgr_t * p_manager); |
||||
|
||||
|
||||
/*
|
||||
* Write precinct packet index table box (superbox) |
||||
* |
||||
* @param[in] coff offset of j2k codestream |
||||
* @param[in] cstr_info codestream information |
||||
* @param[in] EPHused true if EPH option used |
||||
* @param[in] j2klen length of j2k codestream |
||||
* @param[in] cio file output handle |
||||
* @return length of ppix box |
||||
*/ |
||||
int opj_write_ppix(int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, |
||||
int j2klen, opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager); |
||||
|
||||
|
||||
/*
|
||||
* Write packet header index table box (superbox) |
||||
* |
||||
* @param[in] coff offset of j2k codestream |
||||
* @param[in] cstr_info codestream information |
||||
* @param[in] EPHused true if EPH option used |
||||
* @param[in] j2klen length of j2k codestream |
||||
* @param[in] cio file output handle |
||||
* @return length of ppix box |
||||
*/ |
||||
int opj_write_phix(int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, |
||||
int j2klen, opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager); |
||||
|
||||
/*
|
||||
* Write manifest box (box) |
||||
* |
||||
* @param[in] second number to be visited |
||||
* @param[in] v number of boxes |
||||
* @param[in] box box to be manifested |
||||
* @param[in] cio file output handle |
||||
*/ |
||||
|
||||
void opj_write_manf(int second, |
||||
int v, |
||||
opj_jp2_box_t *box, |
||||
opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager); |
||||
|
||||
/*
|
||||
* Write main header index table (box) |
||||
* |
||||
* @param[in] coff offset of j2k codestream |
||||
* @param[in] cstr_info codestream information |
||||
* @param[in] cio file output handle |
||||
* @return length of mainmhix box |
||||
*/ |
||||
int opj_write_mainmhix(int coff, opj_codestream_info_t cstr_info, |
||||
opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager); |
||||
|
||||
int opj_write_phixfaix(int coff, int compno, opj_codestream_info_t cstr_info, |
||||
OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager); |
||||
|
||||
int opj_write_ppixfaix(int coff, int compno, opj_codestream_info_t cstr_info, |
||||
OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager); |
||||
|
||||
int opj_write_tilemhix(int coff, opj_codestream_info_t cstr_info, int tileno, |
||||
opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager); |
||||
|
||||
int opj_write_tpixfaix(int coff, int compno, opj_codestream_info_t cstr_info, |
||||
int j2klen, opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager); |
||||
|
||||
#endif /* !INDEXBOX_MANAGER_H_ */ |
@ -0,0 +1,14 @@ |
||||
prefix=@CMAKE_INSTALL_PREFIX@ |
||||
bindir=${prefix}/@OPENJPEG_INSTALL_BIN_DIR@ |
||||
mandir=${prefix}/@OPENJPEG_INSTALL_MAN_DIR@ |
||||
docdir=${prefix}/@OPENJPEG_INSTALL_DOC_DIR@ |
||||
libdir=${prefix}/@OPENJPEG_INSTALL_LIB_DIR@ |
||||
includedir=${prefix}/@OPENJPEG_INSTALL_INCLUDE_DIR@ |
||||
|
||||
Name: openjp2 |
||||
Description: JPEG2000 library (Part 1 and 2) |
||||
URL: http://www.openjpeg.org/ |
||||
Version: @OPENJPEG_VERSION@ |
||||
Libs: -L${libdir} -lopenjp2 |
||||
Libs.private: -lm |
||||
Cflags: -I${includedir} |
@ -0,0 +1,210 @@ |
||||
/*
|
||||
* $Id: phix_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $ |
||||
* |
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium |
||||
* Copyright (c) 2002-2014, Professor Benoit Macq |
||||
* Copyright (c) 2003-2004, Yannick Verschueren |
||||
* Copyright (c) 2010-2011, Kaori Hagihara |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions |
||||
* are met: |
||||
* 1. Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* 2. Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' |
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
* 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 |
||||
* POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
/*! \file
|
||||
* \brief Modification of jpip.c from 2KAN indexer |
||||
*/ |
||||
|
||||
#include "opj_includes.h" |
||||
|
||||
|
||||
/*
|
||||
* Write faix box of phix |
||||
* |
||||
* @param[in] coff offset of j2k codestream |
||||
* @param[in] compno component number |
||||
* @param[in] cstr_info codestream information |
||||
* @param[in] EPHused true if if EPH option used |
||||
* @param[in] j2klen length of j2k codestream |
||||
* @param[in] cio file output handle |
||||
* @return length of faix box |
||||
*/ |
||||
|
||||
int opj_write_phix(int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, |
||||
int j2klen, opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager) |
||||
{ |
||||
OPJ_BYTE l_data_header [8]; |
||||
OPJ_UINT32 len, compno, i; |
||||
opj_jp2_box_t *box; |
||||
OPJ_OFF_T lenp = 0; |
||||
|
||||
box = (opj_jp2_box_t *)opj_calloc((size_t)cstr_info.numcomps, |
||||
sizeof(opj_jp2_box_t)); |
||||
if (box == NULL) { |
||||
return 0; |
||||
} |
||||
for (i = 0; i < 2; i++) { |
||||
if (i) { |
||||
opj_stream_seek(cio, lenp, p_manager); |
||||
} |
||||
|
||||
lenp = opj_stream_tell(cio); |
||||
opj_stream_skip(cio, 4, p_manager); /* L [at the end] */ |
||||
opj_write_bytes(l_data_header, JPIP_PHIX, 4); /* PHIX */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
|
||||
opj_write_manf((int)i, cstr_info.numcomps, box, cio, p_manager); |
||||
|
||||
for (compno = 0; compno < (OPJ_UINT32)cstr_info.numcomps; compno++) { |
||||
box[compno].length = (OPJ_UINT32)opj_write_phixfaix(coff, (int)compno, |
||||
cstr_info, EPHused, j2klen, cio, p_manager); |
||||
box[compno].type = JPIP_FAIX; |
||||
} |
||||
|
||||
len = (OPJ_UINT32)(opj_stream_tell(cio) - lenp); |
||||
opj_stream_seek(cio, 4, p_manager); |
||||
opj_write_bytes(l_data_header, len, 4); /* L */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_stream_seek(cio, lenp + len, p_manager); |
||||
} |
||||
|
||||
opj_free(box); |
||||
|
||||
return (int)len; |
||||
} |
||||
|
||||
|
||||
int opj_write_phixfaix(int coff, int compno, opj_codestream_info_t cstr_info, |
||||
OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager) |
||||
{ |
||||
OPJ_UINT32 tileno, version, i, nmax, size_of_coding; /* 4 or 8 */ |
||||
opj_tile_info_t *tile_Idx; |
||||
opj_packet_info_t packet; |
||||
int resno, precno, layno; |
||||
OPJ_UINT32 num_packet; |
||||
int numOfres, numOfprec, numOflayers; |
||||
OPJ_BYTE l_data_header [8]; |
||||
OPJ_OFF_T lenp; |
||||
OPJ_UINT32 len; |
||||
|
||||
packet.end_ph_pos = packet.start_pos = -1; |
||||
(void)EPHused; /* unused ? */ |
||||
|
||||
|
||||
if (j2klen > pow(2, 32)) { |
||||
size_of_coding = 8; |
||||
version = 1; |
||||
} else { |
||||
size_of_coding = 4; |
||||
version = 0; |
||||
} |
||||
|
||||
lenp = opj_stream_tell(cio); |
||||
opj_stream_skip(cio, 4, p_manager); /* L [at the end] */ |
||||
opj_write_bytes(l_data_header, JPIP_FAIX, 4); /* FAIX */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_write_bytes(l_data_header, version, 1); /* Version 0 = 4 bytes */ |
||||
opj_stream_write_data(cio, l_data_header, 1, p_manager); |
||||
|
||||
nmax = 0; |
||||
for (i = 0; i <= (OPJ_UINT32)cstr_info.numdecompos[compno]; i++) { |
||||
nmax += (OPJ_UINT32)(cstr_info.tile[0].ph[i] * cstr_info.tile[0].pw[i] * |
||||
cstr_info.numlayers); |
||||
} |
||||
|
||||
opj_write_bytes(l_data_header, nmax, size_of_coding); /* NMAX */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
opj_write_bytes(l_data_header, (OPJ_UINT32)(cstr_info.tw * cstr_info.th), |
||||
size_of_coding); /* M */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
|
||||
for (tileno = 0; tileno < (OPJ_UINT32)(cstr_info.tw * cstr_info.th); tileno++) { |
||||
tile_Idx = &cstr_info.tile[ tileno]; |
||||
|
||||
num_packet = 0; |
||||
numOfres = cstr_info.numdecompos[compno] + 1; |
||||
|
||||
for (resno = 0; resno < numOfres ; resno++) { |
||||
numOfprec = tile_Idx->pw[resno] * tile_Idx->ph[resno]; |
||||
for (precno = 0; precno < numOfprec; precno++) { |
||||
numOflayers = cstr_info.numlayers; |
||||
for (layno = 0; layno < numOflayers; layno++) { |
||||
|
||||
switch (cstr_info.prog) { |
||||
case OPJ_LRCP: |
||||
packet = tile_Idx->packet[((layno * numOfres + resno) * cstr_info.numcomps + |
||||
compno) * numOfprec + precno]; |
||||
break; |
||||
case OPJ_RLCP: |
||||
packet = tile_Idx->packet[((resno * numOflayers + layno) * cstr_info.numcomps + |
||||
compno) * numOfprec + precno]; |
||||
break; |
||||
case OPJ_RPCL: |
||||
packet = tile_Idx->packet[((resno * numOfprec + precno) * cstr_info.numcomps + |
||||
compno) * numOflayers + layno]; |
||||
break; |
||||
case OPJ_PCRL: |
||||
packet = tile_Idx->packet[((precno * cstr_info.numcomps + compno) * numOfres + |
||||
resno) * numOflayers + layno]; |
||||
break; |
||||
case OPJ_CPRL: |
||||
packet = tile_Idx->packet[((compno * numOfprec + precno) * numOfres + resno) * |
||||
numOflayers + layno]; |
||||
break; |
||||
default: |
||||
fprintf(stderr, "failed to ppix indexing\n"); |
||||
} |
||||
|
||||
opj_write_bytes(l_data_header, (OPJ_UINT32)(packet.start_pos - coff), |
||||
size_of_coding); /* start position */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
opj_write_bytes(l_data_header, |
||||
(OPJ_UINT32)(packet.end_ph_pos - packet.start_pos + 1), |
||||
size_of_coding); /* length */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
|
||||
num_packet++; |
||||
} |
||||
} |
||||
} |
||||
|
||||
/* PADDING */ |
||||
while (num_packet < nmax) { |
||||
opj_write_bytes(l_data_header, 0, |
||||
size_of_coding); /* start position */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
opj_write_bytes(l_data_header, 0, |
||||
size_of_coding); /* length */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
num_packet++; |
||||
} |
||||
} |
||||
|
||||
len = (OPJ_UINT32)(opj_stream_tell(cio) - lenp); |
||||
opj_stream_seek(cio, lenp, p_manager); |
||||
opj_write_bytes(l_data_header, len, 4); /* L */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_stream_seek(cio, lenp + len, p_manager); |
||||
|
||||
return (int)len; |
||||
} |
@ -0,0 +1,215 @@ |
||||
/*
|
||||
* $Id: ppix_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $ |
||||
* |
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium |
||||
* Copyright (c) 2002-2014, Professor Benoit Macq |
||||
* Copyright (c) 2003-2004, Yannick Verschueren |
||||
* Copyright (c) 2010-2011, Kaori Hagihara |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions |
||||
* are met: |
||||
* 1. Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* 2. Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' |
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
* 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 |
||||
* POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
/*! \file
|
||||
* \brief Modification of jpip.c from 2KAN indexer |
||||
*/ |
||||
|
||||
#include "opj_includes.h" |
||||
|
||||
/*
|
||||
* Write faix box of ppix |
||||
* |
||||
* @param[in] coff offset of j2k codestream |
||||
* @param[in] compno component number |
||||
* @param[in] cstr_info codestream information |
||||
* @param[in] EPHused true if if EPH option used |
||||
* @param[in] j2klen length of j2k codestream |
||||
* @param[in] cio file output handle |
||||
* @return length of faix box |
||||
*/ |
||||
|
||||
|
||||
int opj_write_ppix(int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, |
||||
int j2klen, opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager) |
||||
{ |
||||
OPJ_BYTE l_data_header [4]; |
||||
int compno, i; |
||||
opj_jp2_box_t *box; |
||||
OPJ_OFF_T lenp; |
||||
OPJ_UINT32 len; |
||||
|
||||
/* printf("cstr_info.packno %d\n", cstr_info.packno); //NMAX? */ |
||||
|
||||
lenp = -1; |
||||
box = (opj_jp2_box_t *)opj_calloc((size_t)cstr_info.numcomps, |
||||
sizeof(opj_jp2_box_t)); |
||||
if (box == NULL) { |
||||
return 0; |
||||
} |
||||
for (i = 0; i < 2; i++) { |
||||
if (i) |
||||
|
||||
{ |
||||
opj_stream_seek(cio, lenp, p_manager); |
||||
} |
||||
|
||||
lenp = (OPJ_UINT32)(opj_stream_tell(cio)); |
||||
opj_stream_skip(cio, 4, p_manager); /* L [at the end] */ |
||||
opj_write_bytes(l_data_header, JPIP_PPIX, 4); /* PPIX */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
|
||||
opj_write_manf(i, cstr_info.numcomps, box, cio, p_manager); |
||||
|
||||
for (compno = 0; compno < cstr_info.numcomps; compno++) { |
||||
box[compno].length = (OPJ_UINT32)opj_write_ppixfaix(coff, compno, cstr_info, |
||||
EPHused, j2klen, cio, p_manager); |
||||
box[compno].type = JPIP_FAIX; |
||||
} |
||||
|
||||
|
||||
len = (OPJ_UINT32)(opj_stream_tell(cio) - lenp); |
||||
opj_stream_seek(cio, lenp, p_manager); |
||||
opj_write_bytes(l_data_header, len, 4); /* L */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_stream_seek(cio, lenp + len, p_manager); |
||||
} |
||||
|
||||
opj_free(box); |
||||
|
||||
return (int)len; |
||||
} |
||||
|
||||
|
||||
|
||||
int opj_write_ppixfaix(int coff, int compno, opj_codestream_info_t cstr_info, |
||||
OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager) |
||||
{ |
||||
OPJ_BYTE l_data_header [8]; |
||||
OPJ_UINT32 tileno, version, i, nmax, size_of_coding; /* 4 or 8*/ |
||||
OPJ_UINT32 len; |
||||
OPJ_OFF_T lenp; |
||||
opj_tile_info_t *tile_Idx; |
||||
opj_packet_info_t packet; |
||||
int resno, precno, layno; |
||||
OPJ_UINT32 num_packet; |
||||
int numOfres, numOfprec, numOflayers; |
||||
packet.end_pos = packet.end_ph_pos = packet.start_pos = -1; |
||||
(void)EPHused; /* unused ? */ |
||||
|
||||
if (j2klen > pow(2, 32)) { |
||||
size_of_coding = 8; |
||||
version = 1; |
||||
} else { |
||||
size_of_coding = 4; |
||||
version = 0; |
||||
} |
||||
|
||||
lenp = opj_stream_tell(cio); |
||||
opj_stream_skip(cio, 4, p_manager); /* L [at the end] */ |
||||
opj_write_bytes(l_data_header, JPIP_FAIX, 4); /* FAIX */ |
||||
opj_write_bytes(l_data_header, version, 1); |
||||
opj_stream_write_data(cio, l_data_header, 1, |
||||
p_manager); /* Version 0 = 4 bytes */ |
||||
|
||||
nmax = 0; |
||||
for (i = 0; i <= (OPJ_UINT32)cstr_info.numdecompos[compno]; i++) { |
||||
nmax += (OPJ_UINT32)(cstr_info.tile[0].ph[i] * cstr_info.tile[0].pw[i] * |
||||
cstr_info.numlayers); |
||||
} |
||||
|
||||
opj_write_bytes(l_data_header, nmax, size_of_coding); /* NMAX */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
opj_write_bytes(l_data_header, (OPJ_UINT32)(cstr_info.tw * cstr_info.th), |
||||
size_of_coding); /* M */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
|
||||
for (tileno = 0; tileno < (OPJ_UINT32)(cstr_info.tw * cstr_info.th); tileno++) { |
||||
tile_Idx = &cstr_info.tile[ tileno]; |
||||
|
||||
num_packet = 0; |
||||
numOfres = cstr_info.numdecompos[compno] + 1; |
||||
|
||||
for (resno = 0; resno < numOfres ; resno++) { |
||||
numOfprec = tile_Idx->pw[resno] * tile_Idx->ph[resno]; |
||||
for (precno = 0; precno < numOfprec; precno++) { |
||||
numOflayers = cstr_info.numlayers; |
||||
for (layno = 0; layno < numOflayers; layno++) { |
||||
|
||||
switch (cstr_info.prog) { |
||||
case OPJ_LRCP: |
||||
packet = tile_Idx->packet[((layno * numOfres + resno) * cstr_info.numcomps + |
||||
compno) * numOfprec + precno]; |
||||
break; |
||||
case OPJ_RLCP: |
||||
packet = tile_Idx->packet[((resno * numOflayers + layno) * cstr_info.numcomps + |
||||
compno) * numOfprec + precno]; |
||||
break; |
||||
case OPJ_RPCL: |
||||
packet = tile_Idx->packet[((resno * numOfprec + precno) * cstr_info.numcomps + |
||||
compno) * numOflayers + layno]; |
||||
break; |
||||
case OPJ_PCRL: |
||||
packet = tile_Idx->packet[((precno * cstr_info.numcomps + compno) * numOfres + |
||||
resno) * numOflayers + layno]; |
||||
break; |
||||
case OPJ_CPRL: |
||||
packet = tile_Idx->packet[((compno * numOfprec + precno) * numOfres + resno) * |
||||
numOflayers + layno]; |
||||
break; |
||||
default: |
||||
fprintf(stderr, "failed to ppix indexing\n"); |
||||
} |
||||
|
||||
opj_write_bytes(l_data_header, (OPJ_UINT32)(packet.start_pos - coff), |
||||
size_of_coding); /* start position */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
opj_write_bytes(l_data_header, |
||||
(OPJ_UINT32)(packet.end_pos - packet.start_pos + 1), |
||||
size_of_coding); /* length */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
|
||||
num_packet++; |
||||
} |
||||
} |
||||
} |
||||
|
||||
while (num_packet < nmax) { /* PADDING */ |
||||
opj_write_bytes(l_data_header, 0, |
||||
size_of_coding); /* start position */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
opj_write_bytes(l_data_header, 0, |
||||
size_of_coding); /* length */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
num_packet++; |
||||
} |
||||
} |
||||
|
||||
len = (OPJ_UINT32)(opj_stream_tell(cio) - lenp); |
||||
opj_stream_seek(cio, lenp, p_manager); |
||||
opj_write_bytes(l_data_header, len, 4); /* L */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_stream_seek(cio, lenp + len, p_manager); |
||||
|
||||
return (int)len; |
||||
} |
@ -0,0 +1,323 @@ |
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses |
||||
* BSD License, included below. This software may be subject to other third |
||||
* party and contributor rights, including patent rights, and no such rights |
||||
* are granted under this license. |
||||
* |
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium |
||||
* Copyright (c) 2002-2014, Professor Benoit Macq |
||||
* Copyright (c) 2001-2003, David Janssens |
||||
* Copyright (c) 2002-2003, Yannick Verschueren |
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux |
||||
* Copyright (c) 2003-2014, Antonin Descampe |
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team |
||||
* Copyright (c) 2007, Callum Lerwick <seg@haxxed.com> |
||||
* Copyright (c) 2012, Carl Hetherington |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions |
||||
* are met: |
||||
* 1. Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* 2. Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' |
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
* 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 |
||||
* POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
#include "opj_includes.h" |
||||
|
||||
// defined elsewhere
|
||||
extern OPJ_BOOL vlc_init_tables(); |
||||
extern OPJ_BOOL vlc_tables_initialized; |
||||
extern int vlc_tbl0[1024]; |
||||
extern int vlc_tbl1[1024]; |
||||
|
||||
static int t1_init_ctxno_zc(OPJ_UINT32 f, OPJ_UINT32 orient) |
||||
{ |
||||
int h, v, d, n, t, hv; |
||||
n = 0; |
||||
h = ((f & T1_SIGMA_3) != 0) + ((f & T1_SIGMA_5) != 0); |
||||
v = ((f & T1_SIGMA_1) != 0) + ((f & T1_SIGMA_7) != 0); |
||||
d = ((f & T1_SIGMA_0) != 0) + ((f & T1_SIGMA_2) != 0) + (( |
||||
f & T1_SIGMA_8) != 0) + ((f & T1_SIGMA_6) != 0); |
||||
|
||||
switch (orient) { |
||||
case 2: |
||||
t = h; |
||||
h = v; |
||||
v = t; |
||||
case 0: |
||||
case 1: |
||||
if (!h) { |
||||
if (!v) { |
||||
if (!d) { |
||||
n = 0; |
||||
} else if (d == 1) { |
||||
n = 1; |
||||
} else { |
||||
n = 2; |
||||
} |
||||
} else if (v == 1) { |
||||
n = 3; |
||||
} else { |
||||
n = 4; |
||||
} |
||||
} else if (h == 1) { |
||||
if (!v) { |
||||
if (!d) { |
||||
n = 5; |
||||
} else { |
||||
n = 6; |
||||
} |
||||
} else { |
||||
n = 7; |
||||
} |
||||
} else { |
||||
n = 8; |
||||
} |
||||
break; |
||||
case 3: |
||||
hv = h + v; |
||||
if (!d) { |
||||
if (!hv) { |
||||
n = 0; |
||||
} else if (hv == 1) { |
||||
n = 1; |
||||
} else { |
||||
n = 2; |
||||
} |
||||
} else if (d == 1) { |
||||
if (!hv) { |
||||
n = 3; |
||||
} else if (hv == 1) { |
||||
n = 4; |
||||
} else { |
||||
n = 5; |
||||
} |
||||
} else if (d == 2) { |
||||
if (!hv) { |
||||
n = 6; |
||||
} else { |
||||
n = 7; |
||||
} |
||||
} else { |
||||
n = 8; |
||||
} |
||||
break; |
||||
} |
||||
|
||||
return (T1_CTXNO_ZC + n); |
||||
} |
||||
|
||||
static int t1_init_ctxno_sc(OPJ_UINT32 f) |
||||
{ |
||||
int hc, vc, n; |
||||
n = 0; |
||||
|
||||
hc = opj_int_min(((f & (T1_LUT_SIG_E | T1_LUT_SGN_E)) == |
||||
T1_LUT_SIG_E) + ((f & (T1_LUT_SIG_W | T1_LUT_SGN_W)) == T1_LUT_SIG_W), |
||||
1) - opj_int_min(((f & (T1_LUT_SIG_E | T1_LUT_SGN_E)) == |
||||
(T1_LUT_SIG_E | T1_LUT_SGN_E)) + |
||||
((f & (T1_LUT_SIG_W | T1_LUT_SGN_W)) == |
||||
(T1_LUT_SIG_W | T1_LUT_SGN_W)), 1); |
||||
|
||||
vc = opj_int_min(((f & (T1_LUT_SIG_N | T1_LUT_SGN_N)) == |
||||
T1_LUT_SIG_N) + ((f & (T1_LUT_SIG_S | T1_LUT_SGN_S)) == T1_LUT_SIG_S), |
||||
1) - opj_int_min(((f & (T1_LUT_SIG_N | T1_LUT_SGN_N)) == |
||||
(T1_LUT_SIG_N | T1_LUT_SGN_N)) + |
||||
((f & (T1_LUT_SIG_S | T1_LUT_SGN_S)) == |
||||
(T1_LUT_SIG_S | T1_LUT_SGN_S)), 1); |
||||
|
||||
if (hc < 0) { |
||||
hc = -hc; |
||||
vc = -vc; |
||||
} |
||||
if (!hc) { |
||||
if (vc == -1) { |
||||
n = 1; |
||||
} else if (!vc) { |
||||
n = 0; |
||||
} else { |
||||
n = 1; |
||||
} |
||||
} else if (hc == 1) { |
||||
if (vc == -1) { |
||||
n = 2; |
||||
} else if (!vc) { |
||||
n = 3; |
||||
} else { |
||||
n = 4; |
||||
} |
||||
} |
||||
|
||||
return (T1_CTXNO_SC + n); |
||||
} |
||||
|
||||
static int t1_init_spb(OPJ_UINT32 f) |
||||
{ |
||||
int hc, vc, n; |
||||
|
||||
hc = opj_int_min(((f & (T1_LUT_SIG_E | T1_LUT_SGN_E)) == |
||||
T1_LUT_SIG_E) + ((f & (T1_LUT_SIG_W | T1_LUT_SGN_W)) == T1_LUT_SIG_W), |
||||
1) - opj_int_min(((f & (T1_LUT_SIG_E | T1_LUT_SGN_E)) == |
||||
(T1_LUT_SIG_E | T1_LUT_SGN_E)) + |
||||
((f & (T1_LUT_SIG_W | T1_LUT_SGN_W)) == |
||||
(T1_LUT_SIG_W | T1_LUT_SGN_W)), 1); |
||||
|
||||
vc = opj_int_min(((f & (T1_LUT_SIG_N | T1_LUT_SGN_N)) == |
||||
T1_LUT_SIG_N) + ((f & (T1_LUT_SIG_S | T1_LUT_SGN_S)) == T1_LUT_SIG_S), |
||||
1) - opj_int_min(((f & (T1_LUT_SIG_N | T1_LUT_SGN_N)) == |
||||
(T1_LUT_SIG_N | T1_LUT_SGN_N)) + |
||||
((f & (T1_LUT_SIG_S | T1_LUT_SGN_S)) == |
||||
(T1_LUT_SIG_S | T1_LUT_SGN_S)), 1); |
||||
|
||||
if (!hc && !vc) { |
||||
n = 0; |
||||
} else { |
||||
n = (!(hc > 0 || (!hc && vc > 0))); |
||||
} |
||||
|
||||
return n; |
||||
} |
||||
|
||||
static void dump_array16(int array[], int size) |
||||
{ |
||||
int i; |
||||
--size; |
||||
for (i = 0; i < size; ++i) { |
||||
printf("0x%04x,", array[i]); |
||||
if (!((i + 1) & 0x7)) { |
||||
printf("\n "); |
||||
} else { |
||||
printf(" "); |
||||
} |
||||
} |
||||
printf("0x%04x\n};\n\n", array[size]); |
||||
} |
||||
|
||||
int main(int argc, char **argv) |
||||
{ |
||||
unsigned int i, j; |
||||
double u, v, t; |
||||
|
||||
int lut_ctxno_zc[2048]; |
||||
int lut_nmsedec_sig[1 << T1_NMSEDEC_BITS]; |
||||
int lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS]; |
||||
int lut_nmsedec_ref[1 << T1_NMSEDEC_BITS]; |
||||
int lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS]; |
||||
(void)argc; |
||||
(void)argv; |
||||
|
||||
printf("/* This file was automatically generated by t1_generate_luts.c */\n\n"); |
||||
|
||||
/* lut_ctxno_zc */ |
||||
for (j = 0; j < 4; ++j) { |
||||
for (i = 0; i < 512; ++i) { |
||||
OPJ_UINT32 orient = j; |
||||
if (orient == 2) { |
||||
orient = 1; |
||||
} else if (orient == 1) { |
||||
orient = 2; |
||||
} |
||||
lut_ctxno_zc[(orient << 9) | i] = t1_init_ctxno_zc(i, j); |
||||
} |
||||
} |
||||
|
||||
printf("static const OPJ_BYTE lut_ctxno_zc[2048] = {\n "); |
||||
for (i = 0; i < 2047; ++i) { |
||||
printf("%i,", lut_ctxno_zc[i]); |
||||
if (!((i + 1) & 0x1f)) { |
||||
printf("\n "); |
||||
} else { |
||||
printf(" "); |
||||
} |
||||
} |
||||
printf("%i\n};\n\n", lut_ctxno_zc[2047]); |
||||
|
||||
/* lut_ctxno_sc */ |
||||
printf("static const OPJ_BYTE lut_ctxno_sc[256] = {\n "); |
||||
for (i = 0; i < 255; ++i) { |
||||
printf("0x%x,", t1_init_ctxno_sc(i)); |
||||
if (!((i + 1) & 0xf)) { |
||||
printf("\n "); |
||||
} else { |
||||
printf(" "); |
||||
} |
||||
} |
||||
printf("0x%x\n};\n\n", t1_init_ctxno_sc(255)); |
||||
|
||||
/* lut_spb */ |
||||
printf("static const OPJ_BYTE lut_spb[256] = {\n "); |
||||
for (i = 0; i < 255; ++i) { |
||||
printf("%i,", t1_init_spb(i)); |
||||
if (!((i + 1) & 0x1f)) { |
||||
printf("\n "); |
||||
} else { |
||||
printf(" "); |
||||
} |
||||
} |
||||
printf("%i\n};\n\n", t1_init_spb(255)); |
||||
|
||||
/* FIXME FIXME FIXME */ |
||||
/* fprintf(stdout,"nmsedec luts:\n"); */ |
||||
for (i = 0U; i < (1U << T1_NMSEDEC_BITS); ++i) { |
||||
t = i / pow(2, T1_NMSEDEC_FRACBITS); |
||||
u = t; |
||||
v = t - 1.5; |
||||
lut_nmsedec_sig[i] = |
||||
opj_int_max(0, |
||||
(int)(floor((u * u - v * v) * pow(2, T1_NMSEDEC_FRACBITS) + 0.5) / pow(2, |
||||
T1_NMSEDEC_FRACBITS) * 8192.0)); |
||||
lut_nmsedec_sig0[i] = |
||||
opj_int_max(0, |
||||
(int)(floor((u * u) * pow(2, T1_NMSEDEC_FRACBITS) + 0.5) / pow(2, |
||||
T1_NMSEDEC_FRACBITS) * 8192.0)); |
||||
u = t - 1.0; |
||||
if (i & (1 << (T1_NMSEDEC_BITS - 1))) { |
||||
v = t - 1.5; |
||||
} else { |
||||
v = t - 0.5; |
||||
} |
||||
lut_nmsedec_ref[i] = |
||||
opj_int_max(0, |
||||
(int)(floor((u * u - v * v) * pow(2, T1_NMSEDEC_FRACBITS) + 0.5) / pow(2, |
||||
T1_NMSEDEC_FRACBITS) * 8192.0)); |
||||
lut_nmsedec_ref0[i] = |
||||
opj_int_max(0, |
||||
(int)(floor((u * u) * pow(2, T1_NMSEDEC_FRACBITS) + 0.5) / pow(2, |
||||
T1_NMSEDEC_FRACBITS) * 8192.0)); |
||||
} |
||||
|
||||
printf("static const OPJ_INT16 lut_nmsedec_sig[1U << T1_NMSEDEC_BITS] = {\n "); |
||||
dump_array16(lut_nmsedec_sig, 1U << T1_NMSEDEC_BITS); |
||||
|
||||
printf("static const OPJ_INT16 lut_nmsedec_sig0[1U << T1_NMSEDEC_BITS] = {\n "); |
||||
dump_array16(lut_nmsedec_sig0, 1U << T1_NMSEDEC_BITS); |
||||
|
||||
printf("static const OPJ_INT16 lut_nmsedec_ref[1U << T1_NMSEDEC_BITS] = {\n "); |
||||
dump_array16(lut_nmsedec_ref, 1U << T1_NMSEDEC_BITS); |
||||
|
||||
printf("static const OPJ_INT16 lut_nmsedec_ref0[1U << T1_NMSEDEC_BITS] = {\n "); |
||||
dump_array16(lut_nmsedec_ref0, 1U << T1_NMSEDEC_BITS); |
||||
|
||||
vlc_tables_initialized = vlc_init_tables(); |
||||
printf("static const OPJ_UINT16 vlc_tbl0[1024] = {\n "); |
||||
dump_array16(vlc_tbl0, 1024); |
||||
printf("static const OPJ_UINT16 vlc_tbl1[1024] = {\n "); |
||||
dump_array16(vlc_tbl1, 1024); |
||||
|
||||
return 0; |
||||
} |
@ -0,0 +1,973 @@ |
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2021, Aous Naman
|
||||
// Copyright (c) 2021, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2021, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN 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 POSSIBILITY OF SUCH DAMAGE.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJpeg software implementation.
|
||||
// File: t1_ht_generate_luts.c
|
||||
// Author: Aous Naman
|
||||
// Date: 01 September 2021
|
||||
//***************************************************************************/
|
||||
|
||||
#include <string.h> |
||||
#include <stdio.h> |
||||
#include <assert.h> |
||||
|
||||
typedef int OPJ_BOOL; |
||||
#define OPJ_TRUE 1 |
||||
#define OPJ_FALSE 0 |
||||
|
||||
#include "opj_stdint.h" |
||||
|
||||
typedef int8_t OPJ_INT8; |
||||
typedef uint8_t OPJ_UINT8; |
||||
typedef int16_t OPJ_INT16; |
||||
typedef uint16_t OPJ_UINT16; |
||||
typedef int32_t OPJ_INT32; |
||||
typedef uint32_t OPJ_UINT32; |
||||
typedef int64_t OPJ_INT64; |
||||
typedef uint64_t OPJ_UINT64; |
||||
|
||||
//************************************************************************/
|
||||
/** @brief HT decoding tables, as given in the standard
|
||||
* |
||||
* Data in the table is arranged in this format: |
||||
* c_q is the context for a quad |
||||
* rho is the signficance pattern for a quad |
||||
* u_off indicate if u value is 0 (u_off is 0), or communicated |
||||
* e_k, e_1 EMB patterns |
||||
* cwd VLC codeword |
||||
* cwd VLC codeword length |
||||
*/ |
||||
typedef struct vlc_src_table { |
||||
int c_q, rho, u_off, e_k, e_1, cwd, cwd_len; |
||||
} |
||||
vlc_src_table_t; |
||||
|
||||
// initial quad rows
|
||||
static vlc_src_table_t tbl0[] = { |
||||
{0, 0x1, 0x0, 0x0, 0x0, 0x06, 4}, |
||||
{0, 0x1, 0x1, 0x1, 0x1, 0x3F, 7}, |
||||
{0, 0x2, 0x0, 0x0, 0x0, 0x00, 3}, |
||||
{0, 0x2, 0x1, 0x2, 0x2, 0x7F, 7}, |
||||
{0, 0x3, 0x0, 0x0, 0x0, 0x11, 5}, |
||||
{0, 0x3, 0x1, 0x2, 0x2, 0x5F, 7}, |
||||
{0, 0x3, 0x1, 0x3, 0x1, 0x1F, 7}, |
||||
{0, 0x4, 0x0, 0x0, 0x0, 0x02, 3}, |
||||
{0, 0x4, 0x1, 0x4, 0x4, 0x13, 6}, |
||||
{0, 0x5, 0x0, 0x0, 0x0, 0x0E, 5}, |
||||
{0, 0x5, 0x1, 0x4, 0x4, 0x23, 6}, |
||||
{0, 0x5, 0x1, 0x5, 0x1, 0x0F, 7}, |
||||
{0, 0x6, 0x0, 0x0, 0x0, 0x03, 6}, |
||||
{0, 0x6, 0x1, 0x0, 0x0, 0x6F, 7}, |
||||
{0, 0x7, 0x0, 0x0, 0x0, 0x2F, 7}, |
||||
{0, 0x7, 0x1, 0x2, 0x2, 0x4F, 7}, |
||||
{0, 0x7, 0x1, 0x2, 0x0, 0x0D, 6}, |
||||
{0, 0x8, 0x0, 0x0, 0x0, 0x04, 3}, |
||||
{0, 0x8, 0x1, 0x8, 0x8, 0x3D, 6}, |
||||
{0, 0x9, 0x0, 0x0, 0x0, 0x1D, 6}, |
||||
{0, 0x9, 0x1, 0x0, 0x0, 0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, 0x3F, 7}, |
||||
{6, 0x5, 0x0, 0x0, 0x0, 0x35, 6}, |
||||
{6, 0x5, 0x1, 0x1, 0x1, 0x15, 6}, |
||||
{6, 0x5, 0x1, 0x5, 0x4, 0x7F, 7}, |
||||
{6, 0x6, 0x0, 0x0, 0x0, 0x25, 6}, |
||||
{6, 0x6, 0x1, 0x2, 0x2, 0x5F, 7}, |
||||
{6, 0x6, 0x1, 0x6, 0x4, 0x1F, 7}, |
||||
{6, 0x7, 0x0, 0x0, 0x0, 0x6F, 7}, |
||||
{6, 0x7, 0x1, 0x6, 0x6, 0x4F, 7}, |
||||
{6, 0x7, 0x1, 0x6, 0x4, 0x05, 6}, |
||||
{6, 0x7, 0x1, 0x7, 0x3, 0x2F, 7}, |
||||
{6, 0x7, 0x1, 0x7, 0x1, 0x36, 6}, |
||||
{6, 0x7, 0x1, 0x7, 0x2, 0x77, 7}, |
||||
{6, 0x8, 0x0, 0x0, 0x0, 0x12, 5}, |
||||
{6, 0x8, 0x1, 0x8, 0x8, 0x0F, 7}, |
||||
{6, 0x9, 0x0, 0x0, 0x0, 0x39, 6}, |
||||
{6, 0x9, 0x1, 0x1, 0x1, 0x37, 7}, |
||||
{6, 0x9, 0x1, 0x9, 0x8, 0x57, 7}, |
||||
{6, 0xA, 0x0, 0x0, 0x0, 0x19, 6}, |
||||
{6, 0xA, 0x1, 0x2, 0x2, 0x29, 6}, |
||||
{6, 0xA, 0x1, 0xA, 0x8, 0x17, 7}, |
||||
{6, 0xB, 0x0, 0x0, 0x0, 0x67, 7}, |
||||
{6, 0xB, 0x1, 0x9, 0x9, 0x47, 7}, |
||||
{6, 0xB, 0x1, 0x9, 0x1, 0x09, 6}, |
||||
{6, 0xB, 0x1, 0xB, 0xA, 0x27, 7}, |
||||
{6, 0xB, 0x1, 0xB, 0x2, 0x31, 6}, |
||||
{6, 0xB, 0x1, 0xB, 0x8, 0x7B, 7}, |
||||
{6, 0xC, 0x0, 0x0, 0x0, 0x11, 6}, |
||||
{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{7, 0xF, 0x1, 0xF, 0x7, 0x55, 7}, |
||||
{7, 0xF, 0x1, 0xF, 0x5, 0x1A, 5}, |
||||
{7, 0xF, 0x1, 0xF, 0xB, 0x25, 7}, |
||||
{7, 0xF, 0x1, 0xF, 0x3, 0x0A, 5}, |
||||
{7, 0xF, 0x1, 0xF, 0x9, 0x2E, 6}, |
||||
{7, 0xF, 0x1, 0xF, 0x1, 0x00, 4}, |
||||
{7, 0xF, 0x1, 0xF, 0xE, 0x65, 7}, |
||||
{7, 0xF, 0x1, 0xF, 0x6, 0x36, 6}, |
||||
{7, 0xF, 0x1, 0xF, 0xA, 0x02, 5}, |
||||
{7, 0xF, 0x1, 0xF, 0x2, 0x0C, 4}, |
||||
{7, 0xF, 0x1, 0xF, 0xC, 0x16, 6}, |
||||
{7, 0xF, 0x1, 0xF, 0x8, 0x04, 4}, |
||||
{7, 0xF, 0x1, 0xF, 0x4, 0x08, 4} |
||||
}; |
||||
|
||||
// nono-initial quad rows
|
||||
static vlc_src_table_t tbl1[] = { |
||||
{0, 0x1, 0x0, 0x0, 0x0, 0x00, 3}, |
||||
{0, 0x1, 0x1, 0x1, 0x1, 0x27, 6}, |
||||
{0, 0x2, 0x0, 0x0, 0x0, 0x06, 3}, |
||||
{0, 0x2, 0x1, 0x2, 0x2, 0x17, 6}, |
||||
{0, 0x3, 0x0, 0x0, 0x0, 0x0D, 5}, |
||||
{0, 0x3, 0x1, 0x0, 0x0, 0x3B, 6}, |
||||
{0, 0x4, 0x0, 0x0, 0x0, 0x02, 3}, |
||||
{0, 0x4, 0x1, 0x4, 0x4, 0x07, 6}, |
||||
{0, 0x5, 0x0, 0x0, 0x0, 0x15, 5}, |
||||
{0, 0x5, 0x1, 0x0, 0x0, 0x2B, 6}, |
||||
{0, 0x6, 0x0, 0x0, 0x0, 0x01, 5}, |
||||
{0, 0x6, 0x1, 0x0, 0x0, 0x7F, 7}, |
||||
{0, 0x7, 0x0, 0x0, 0x0, 0x1F, 7}, |
||||
{0,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, 0xE, 0x1, 0x2, 0x2, 0x5B, 7}, |
||||
{7, 0xE, 0x1, 0xA, 0x8, 0x3E, 6}, |
||||
{7, 0xE, 0x1, 0xE, 0x4, 0x0B, 7}, |
||||
{7, 0xF, 0x0, 0x0, 0x0, 0x00, 3}, |
||||
{7, 0xF, 0x1, 0xF, 0xF, 0x6B, 7}, |
||||
{7, 0xF, 0x1, 0xF, 0x7, 0x2B, 7}, |
||||
{7, 0xF, 0x1, 0xF, 0xB, 0x4B, 7}, |
||||
{7, 0xF, 0x1, 0xF, 0x3, 0x11, 6}, |
||||
{7, 0xF, 0x1, 0x7, 0x6, 0x21, 6}, |
||||
{7, 0xF, 0x1, 0xF, 0xA, 0x01, 6}, |
||||
{7, 0xF, 0x1, 0xF, 0x2, 0x0A, 5}, |
||||
{7, 0xF, 0x1, 0xB, 0x9, 0x1E, 6}, |
||||
{7, 0xF, 0x1, 0xF, 0xC, 0x0E, 6}, |
||||
{7, 0xF, 0x1, 0xF, 0x8, 0x12, 5}, |
||||
{7, 0xF, 0x1, 0xF, 0x5, 0x2E, 6}, |
||||
{7, 0xF, 0x1, 0xF, 0x1, 0x02, 5}, |
||||
{7, 0xF, 0x1, 0xF, 0x4, 0x1C, 5} |
||||
}; |
||||
|
||||
//************************************************************************/
|
||||
/** @defgroup vlc_decoding_tables_grp VLC decoding tables
|
||||
* @{ |
||||
* VLC tables to decode VLC codewords to these fields: (in order) \n |
||||
* \li \c cwd_len : 3bits -> the codeword length of the VLC codeword; |
||||
* the VLC cwd is in the LSB of bitstream \n |
||||
* \li \c u_off : 1bit -> u_offset, which is 1 if u value is not 0 \n |
||||
* \li \c rho : 4bits -> significant samples within a quad \n |
||||
* \li \c e_1 : 4bits -> EMB e_1 \n |
||||
* \li \c e_k : 4bits -> EMB e_k \n |
||||
* \n |
||||
* The table index is 10 bits and composed of two parts: \n |
||||
* The 7 LSBs contain a codeword which might be shorter than 7 bits; |
||||
* this word is the next decoable bits in the bitstream. \n |
||||
* The 3 MSB is the context of for the codeword. \n |
||||
*/ |
||||
|
||||
/// @brief vlc_tbl0 contains decoding information for initial row of quads
|
||||
int vlc_tbl0[1024] = { 0 }; |
||||
/// @brief vlc_tbl1 contains decoding information for non-initial row of
|
||||
/// quads
|
||||
int vlc_tbl1[1024] = { 0 }; |
||||
/// @}
|
||||
|
||||
//************************************************************************/
|
||||
/** @ingroup vlc_decoding_tables_grp
|
||||
* @brief Initializes vlc_tbl0 and vlc_tbl1 tables, from table0.h and |
||||
* table1.h |
||||
*/ |
||||
OPJ_BOOL vlc_init_tables() |
||||
{ |
||||
const OPJ_BOOL debug = OPJ_FALSE; //useful for checking
|
||||
|
||||
// number of entries in the table
|
||||
size_t tbl0_size = sizeof(tbl0) / sizeof(vlc_src_table_t); |
||||
|
||||
// number of entries in the table
|
||||
size_t tbl1_size = sizeof(tbl1) / sizeof(vlc_src_table_t); |
||||
|
||||
if (debug) { |
||||
memset(vlc_tbl0, 0, sizeof(vlc_tbl0)); //unnecessary
|
||||
} |
||||
|
||||
// this is to convert table entries into values for decoder look up
|
||||
// There can be at most 1024 possibilities, not all of them are valid.
|
||||
//
|
||||
for (int i = 0; i < 1024; ++i) { |
||||
int cwd = i & 0x7F; // from i extract codeword
|
||||
int c_q = i >> 7; // from i extract context
|
||||
// See if this case exist in the table, if so then set the entry in
|
||||
// vlc_tbl0
|
||||
for (size_t j = 0; j < tbl0_size; ++j) |
||||
if (tbl0[j].c_q == c_q) // this is an and operation
|
||||
if (tbl0[j].cwd == (cwd & ((1 << tbl0[j].cwd_len) - 1))) { |
||||
if (debug) { |
||||
assert(vlc_tbl0[i] == 0); |
||||
} |
||||
// Put this entry into the table
|
||||
vlc_tbl0[i] = (tbl0[j].rho << 4) | (tbl0[j].u_off << 3) |
||||
| (tbl0[j].e_k << 12) | (tbl0[j].e_1 << 8) | tbl0[j].cwd_len; |
||||
} |
||||
} |
||||
|
||||
if (debug) { |
||||
memset(vlc_tbl1, 0, sizeof(vlc_tbl1)); //unnecessary
|
||||
} |
||||
|
||||
// this the same as above but for non-initial rows
|
||||
for (int i = 0; i < 1024; ++i) { |
||||
int cwd = i & 0x7F; //7 bits
|
||||
int c_q = i >> 7; |
||||
for (size_t j = 0; j < tbl1_size; ++j) |
||||
if (tbl1[j].c_q == c_q) // this is an and operation
|
||||
if (tbl1[j].cwd == (cwd & ((1 << tbl1[j].cwd_len) - 1))) { |
||||
if (debug) { |
||||
assert(vlc_tbl1[i] == 0); |
||||
} |
||||
vlc_tbl1[i] = (tbl1[j].rho << 4) | (tbl1[j].u_off << 3) |
||||
| (tbl1[j].e_k << 12) | (tbl1[j].e_1 << 8) | tbl1[j].cwd_len; |
||||
} |
||||
} |
||||
|
||||
return OPJ_TRUE; |
||||
} |
||||
|
||||
//************************************************************************/
|
||||
/** @ingroup vlc_decoding_tables_grp
|
||||
* @brief Initializes VLC tables vlc_tbl0 and vlc_tbl1 |
||||
*/ |
||||
OPJ_BOOL vlc_tables_initialized = OPJ_FALSE; |
||||
|
@ -0,0 +1,261 @@ |
||||
static const OPJ_UINT16 vlc_tbl0[1024] = { |
||||
0x0023, 0x00a5, 0x0043, 0x0066, 0x0083, 0xa8ee, 0x0014, 0xd8df, |
||||
0x0023, 0x10be, 0x0043, 0xf5ff, 0x0083, 0x207e, 0x0055, 0x515f, |
||||
0x0023, 0x0035, 0x0043, 0x444e, 0x0083, 0xc4ce, 0x0014, 0xcccf, |
||||
0x0023, 0xe2fe, 0x0043, 0x99ff, 0x0083, 0x0096, 0x00c5, 0x313f, |
||||
0x0023, 0x00a5, 0x0043, 0x445e, 0x0083, 0xc8ce, 0x0014, 0x11df, |
||||
0x0023, 0xf4fe, 0x0043, 0xfcff, 0x0083, 0x009e, 0x0055, 0x0077, |
||||
0x0023, 0x0035, 0x0043, 0xf1ff, 0x0083, 0x88ae, 0x0014, 0x00b7, |
||||
0x0023, 0xf8fe, 0x0043, 0xe4ef, 0x0083, 0x888e, 0x00c5, 0x111f, |
||||
0x0023, 0x00a5, 0x0043, 0x0066, 0x0083, 0xa8ee, 0x0014, 0x54df, |
||||
0x0023, 0x10be, 0x0043, 0x22ef, 0x0083, 0x207e, 0x0055, 0x227f, |
||||
0x0023, 0x0035, 0x0043, 0x444e, 0x0083, 0xc4ce, 0x0014, 0x11bf, |
||||
0x0023, 0xe2fe, 0x0043, 0x00f7, 0x0083, 0x0096, 0x00c5, 0x223f, |
||||
0x0023, 0x00a5, 0x0043, 0x445e, 0x0083, 0xc8ce, 0x0014, 0x00d7, |
||||
0x0023, 0xf4fe, 0x0043, 0xbaff, 0x0083, 0x009e, 0x0055, 0x006f, |
||||
0x0023, 0x0035, 0x0043, 0xe6ff, 0x0083, 0x88ae, 0x0014, 0xa2af, |
||||
0x0023, 0xf8fe, 0x0043, 0x00e7, 0x0083, 0x888e, 0x00c5, 0x222f, |
||||
0x0002, 0x00c5, 0x0084, 0x207e, 0x0002, 0xc4ce, 0x0024, 0x00f7, |
||||
0x0002, 0xa2fe, 0x0044, 0x0056, 0x0002, 0x009e, 0x0014, 0x00d7, |
||||
0x0002, 0x10be, 0x0084, 0x0066, 0x0002, 0x88ae, 0x0024, 0x11df, |
||||
0x0002, 0xa8ee, 0x0044, 0x0036, 0x0002, 0x888e, 0x0014, 0x111f, |
||||
0x0002, 0x00c5, 0x0084, 0x006e, 0x0002, 0x88ce, 0x0024, 0x88ff, |
||||
0x0002, 0xb8fe, 0x0044, 0x444e, 0x0002, 0x0096, 0x0014, 0x00b7, |
||||
0x0002, 0xe4fe, 0x0084, 0x445e, 0x0002, 0x00a6, 0x0024, 0x00e7, |
||||
0x0002, 0x54de, 0x0044, 0x222e, 0x0002, 0x003e, 0x0014, 0x0077, |
||||
0x0002, 0x00c5, 0x0084, 0x207e, 0x0002, 0xc4ce, 0x0024, 0xf1ff, |
||||
0x0002, 0xa2fe, 0x0044, 0x0056, 0x0002, 0x009e, 0x0014, 0x11bf, |
||||
0x0002, 0x10be, 0x0084, 0x0066, 0x0002, 0x88ae, 0x0024, 0x22ef, |
||||
0x0002, 0xa8ee, 0x0044, 0x0036, 0x0002, 0x888e, 0x0014, 0x227f, |
||||
0x0002, 0x00c5, 0x0084, 0x006e, 0x0002, 0x88ce, 0x0024, 0xe4ef, |
||||
0x0002, 0xb8fe, 0x0044, 0x444e, 0x0002, 0x0096, 0x0014, 0xa2af, |
||||
0x0002, 0xe4fe, 0x0084, 0x445e, 0x0002, 0x00a6, 0x0024, 0xd8df, |
||||
0x0002, 0x54de, 0x0044, 0x222e, 0x0002, 0x003e, 0x0014, 0x515f, |
||||
0x0002, 0x0055, 0x0084, 0x0066, 0x0002, 0x88de, 0x0024, 0x32ff, |
||||
0x0002, 0x11fe, 0x0044, 0x444e, 0x0002, 0x00ae, 0x0014, 0x00b7, |
||||
0x0002, 0x317e, 0x0084, 0x515e, 0x0002, 0x00c6, 0x0024, 0x00d7, |
||||
0x0002, 0x20ee, 0x0044, 0x111e, 0x0002, 0x009e, 0x0014, 0x0077, |
||||
0x0002, 0x0055, 0x0084, 0x545e, 0x0002, 0x44ce, 0x0024, 0x00e7, |
||||
0x0002, 0xf1fe, 0x0044, 0x0036, 0x0002, 0x00a6, 0x0014, 0x555f, |
||||
0x0002, 0x74fe, 0x0084, 0x113e, 0x0002, 0x20be, 0x0024, 0x747f, |
||||
0x0002, 0xc4de, 0x0044, 0xf8ff, 0x0002, 0x0096, 0x0014, 0x222f, |
||||
0x0002, 0x0055, 0x0084, 0x0066, 0x0002, 0x88de, 0x0024, 0x00f7, |
||||
0x0002, 0x11fe, 0x0044, 0x444e, 0x0002, 0x00ae, 0x0014, 0x888f, |
||||
0x0002, 0x317e, 0x0084, 0x515e, 0x0002, 0x00c6, 0x0024, 0xc8cf, |
||||
0x0002, 0x20ee, 0x0044, 0x111e, 0x0002, 0x009e, 0x0014, 0x006f, |
||||
0x0002, 0x0055, 0x0084, 0x545e, 0x0002, 0x44ce, 0x0024, 0xd1df, |
||||
0x0002, 0xf1fe, 0x0044, 0x0036, 0x0002, 0x00a6, 0x0014, 0x227f, |
||||
0x0002, 0x74fe, 0x0084, 0x113e, 0x0002, 0x20be, 0x0024, 0x22bf, |
||||
0x0002, 0xc4de, 0x0044, 0x22ef, 0x0002, 0x0096, 0x0014, 0x323f, |
||||
0x0003, 0xd4de, 0xf4fd, 0xfcff, 0x0014, 0x113e, 0x0055, 0x888f, |
||||
0x0003, 0x32be, 0x0085, 0x00e7, 0x0025, 0x515e, 0xaafe, 0x727f, |
||||
0x0003, 0x44ce, 0xf8fd, 0x44ef, 0x0014, 0x647e, 0x0045, 0xa2af, |
||||
0x0003, 0x00a6, 0x555d, 0x99df, 0xf1fd, 0x0036, 0xf5fe, 0x626f, |
||||
0x0003, 0xd1de, 0xf4fd, 0xe6ff, 0x0014, 0x717e, 0x0055, 0xb1bf, |
||||
0x0003, 0x88ae, 0x0085, 0xd5df, 0x0025, 0x444e, 0xf2fe, 0x667f, |
||||
0x0003, 0x00c6, 0xf8fd, 0xe2ef, 0x0014, 0x545e, 0x0045, 0x119f, |
||||
0x0003, 0x0096, 0x555d, 0xc8cf, 0xf1fd, 0x111e, 0xc8ee, 0x0067, |
||||
0x0003, 0xd4de, 0xf4fd, 0xf3ff, 0x0014, 0x113e, 0x0055, 0x11bf, |
||||
0x0003, 0x32be, 0x0085, 0xd8df, 0x0025, 0x515e, 0xaafe, 0x222f, |
||||
0x0003, 0x44ce, 0xf8fd, 0x00f7, 0x0014, 0x647e, 0x0045, 0x989f, |
||||
0x0003, 0x00a6, 0x555d, 0x00d7, 0xf1fd, 0x0036, 0xf5fe, 0x446f, |
||||
0x0003, 0xd1de, 0xf4fd, 0xb9ff, 0x0014, 0x717e, 0x0055, 0x00b7, |
||||
0x0003, 0x88ae, 0x0085, 0xdcdf, 0x0025, 0x444e, 0xf2fe, 0x0077, |
||||
0x0003, 0x00c6, 0xf8fd, 0xe4ef, 0x0014, 0x545e, 0x0045, 0x737f, |
||||
0x0003, 0x0096, 0x555d, 0xb8bf, 0xf1fd, 0x111e, 0xc8ee, 0x323f, |
||||
0x0002, 0x00a5, 0x0084, 0x407e, 0x0002, 0x10de, 0x0024, 0x11df, |
||||
0x0002, 0x72fe, 0x0044, 0x0056, 0x0002, 0xa8ae, 0x0014, 0xb2bf, |
||||
0x0002, 0x0096, 0x0084, 0x0066, 0x0002, 0x00c6, 0x0024, 0x00e7, |
||||
0x0002, 0xc8ee, 0x0044, 0x222e, 0x0002, 0x888e, 0x0014, 0x0077, |
||||
0x0002, 0x00a5, 0x0084, 0x006e, 0x0002, 0x88ce, 0x0024, 0x00f7, |
||||
0x0002, 0x91fe, 0x0044, 0x0036, 0x0002, 0xa2ae, 0x0014, 0xaaaf, |
||||
0x0002, 0xb8fe, 0x0084, 0x005e, 0x0002, 0x00be, 0x0024, 0xc4cf, |
||||
0x0002, 0x44ee, 0x0044, 0xf4ff, 0x0002, 0x223e, 0x0014, 0x111f, |
||||
0x0002, 0x00a5, 0x0084, 0x407e, 0x0002, 0x10de, 0x0024, 0x99ff, |
||||
0x0002, 0x72fe, 0x0044, 0x0056, 0x0002, 0xa8ae, 0x0014, 0x00b7, |
||||
0x0002, 0x0096, 0x0084, 0x0066, 0x0002, 0x00c6, 0x0024, 0x00d7, |
||||
0x0002, 0xc8ee, 0x0044, 0x222e, 0x0002, 0x888e, 0x0014, 0x444f, |
||||
0x0002, 0x00a5, 0x0084, 0x006e, 0x0002, 0x88ce, 0x0024, 0xe2ef, |
||||
0x0002, 0x91fe, 0x0044, 0x0036, 0x0002, 0xa2ae, 0x0014, 0x447f, |
||||
0x0002, 0xb8fe, 0x0084, 0x005e, 0x0002, 0x00be, 0x0024, 0x009f, |
||||
0x0002, 0x44ee, 0x0044, 0x76ff, 0x0002, 0x223e, 0x0014, 0x313f, |
||||
0x0003, 0x00c6, 0x0085, 0xd9ff, 0xf2fd, 0x647e, 0xf1fe, 0x99bf, |
||||
0x0003, 0xa2ae, 0x0025, 0x66ef, 0xf4fd, 0x0056, 0xe2ee, 0x737f, |
||||
0x0003, 0x98be, 0x0045, 0x00f7, 0xf8fd, 0x0066, 0x76fe, 0x889f, |
||||
0x0003, 0x888e, 0x0015, 0xd5df, 0x00a5, 0x222e, 0x98de, 0x444f, |
||||
0x0003, 0xb2be, 0x0085, 0xfcff, 0xf2fd, 0x226e, 0x0096, 0x00b7, |
||||
0x0003, 0xaaae, 0x0025, 0xd1df, 0xf4fd, 0x0036, 0xd4de, 0x646f, |
||||
0x0003, 0xa8ae, 0x0045, 0xeaef, 0xf8fd, 0x445e, 0xe8ee, 0x717f, |
||||
0x0003, 0x323e, 0x0015, 0xc4cf, 0x00a5, 0xfaff, 0x88ce, 0x313f, |
||||
0x0003, 0x00c6, 0x0085, 0x77ff, 0xf2fd, 0x647e, 0xf1fe, 0xb3bf, |
||||
0x0003, 0xa2ae, 0x0025, 0x00e7, 0xf4fd, 0x0056, 0xe2ee, 0x0077, |
||||
0x0003, 0x98be, 0x0045, 0xe4ef, 0xf8fd, 0x0066, 0x76fe, 0x667f, |
||||
0x0003, 0x888e, 0x0015, 0x00d7, 0x00a5, 0x222e, 0x98de, 0x333f, |
||||
0x0003, 0xb2be, 0x0085, 0x75ff, 0xf2fd, 0x226e, 0x0096, 0x919f, |
||||
0x0003, 0xaaae, 0x0025, 0x99df, 0xf4fd, 0x0036, 0xd4de, 0x515f, |
||||
0x0003, 0xa8ae, 0x0045, 0xecef, 0xf8fd, 0x445e, 0xe8ee, 0x727f, |
||||
0x0003, 0x323e, 0x0015, 0xb1bf, 0x00a5, 0xf3ff, 0x88ce, 0x111f, |
||||
0x0003, 0x54de, 0xf2fd, 0x111e, 0x0014, 0x647e, 0xf8fe, 0xcccf, |
||||
0x0003, 0x91be, 0x0045, 0x22ef, 0x0025, 0x222e, 0xf3fe, 0x888f, |
||||
0x0003, 0x00c6, 0x0085, 0x00f7, 0x0014, 0x115e, 0xfcfe, 0xa8af, |
||||
0x0003, 0x00a6, 0x0035, 0xc8df, 0xf1fd, 0x313e, 0x66fe, 0x646f, |
||||
0x0003, 0xc8ce, 0xf2fd, 0xf5ff, 0x0014, 0x0066, 0xf4fe, 0xbabf, |
||||
0x0003, 0x22ae, 0x0045, 0x00e7, 0x0025, 0x323e, 0xeafe, 0x737f, |
||||
0x0003, 0xb2be, 0x0085, 0x55df, 0x0014, 0x0056, 0x717e, 0x119f, |
||||
0x0003, 0x0096, 0x0035, 0xc4cf, 0xf1fd, 0x333e, 0xe8ee, 0x444f, |
||||
0x0003, 0x54de, 0xf2fd, 0x111e, 0x0014, 0x647e, 0xf8fe, 0x99bf, |
||||
0x0003, 0x91be, 0x0045, 0xe2ef, 0x0025, 0x222e, 0xf3fe, 0x667f, |
||||
0x0003, 0x00c6, 0x0085, 0xe4ef, 0x0014, 0x115e, 0xfcfe, 0x989f, |
||||
0x0003, 0x00a6, 0x0035, 0x00d7, 0xf1fd, 0x313e, 0x66fe, 0x226f, |
||||
0x0003, 0xc8ce, 0xf2fd, 0xb9ff, 0x0014, 0x0066, 0xf4fe, 0x00b7, |
||||
0x0003, 0x22ae, 0x0045, 0xd1df, 0x0025, 0x323e, 0xeafe, 0x0077, |
||||
0x0003, 0xb2be, 0x0085, 0xecef, 0x0014, 0x0056, 0x717e, 0x727f, |
||||
0x0003, 0x0096, 0x0035, 0xb8bf, 0xf1fd, 0x333e, 0xe8ee, 0x545f, |
||||
0xf1fc, 0xd1de, 0xfafd, 0x00d7, 0xf8fc, 0x0016, 0xfffd, 0x747f, |
||||
0xf4fc, 0x717e, 0xf3fd, 0xb3bf, 0xf2fc, 0xeaef, 0xe8ee, 0x444f, |
||||
0xf1fc, 0x22ae, 0x0005, 0xb8bf, 0xf8fc, 0x00f7, 0xfcfe, 0x0077, |
||||
0xf4fc, 0x115e, 0xf5fd, 0x757f, 0xf2fc, 0xd8df, 0xe2ee, 0x333f, |
||||
0xf1fc, 0xb2be, 0xfafd, 0x88cf, 0xf8fc, 0xfbff, 0xfffd, 0x737f, |
||||
0xf4fc, 0x006e, 0xf3fd, 0x00b7, 0xf2fc, 0x66ef, 0xf9fe, 0x313f, |
||||
0xf1fc, 0x009e, 0x0005, 0xbabf, 0xf8fc, 0xfdff, 0xf6fe, 0x0067, |
||||
0xf4fc, 0x0026, 0xf5fd, 0x888f, 0xf2fc, 0xdcdf, 0xd4de, 0x222f, |
||||
0xf1fc, 0xd1de, 0xfafd, 0xc4cf, 0xf8fc, 0x0016, 0xfffd, 0x727f, |
||||
0xf4fc, 0x717e, 0xf3fd, 0x99bf, 0xf2fc, 0xecef, 0xe8ee, 0x0047, |
||||
0xf1fc, 0x22ae, 0x0005, 0x00a7, 0xf8fc, 0xf7ff, 0xfcfe, 0x0057, |
||||
0xf4fc, 0x115e, 0xf5fd, 0x0097, 0xf2fc, 0xd5df, 0xe2ee, 0x0037, |
||||
0xf1fc, 0xb2be, 0xfafd, 0x00c7, 0xf8fc, 0xfeff, 0xfffd, 0x667f, |
||||
0xf4fc, 0x006e, 0xf3fd, 0xa8af, 0xf2fc, 0x00e7, 0xf9fe, 0x323f, |
||||
0xf1fc, 0x009e, 0x0005, 0xb1bf, 0xf8fc, 0xe4ef, 0xf6fe, 0x545f, |
||||
0xf4fc, 0x0026, 0xf5fd, 0x0087, 0xf2fc, 0x99df, 0xd4de, 0x111f |
||||
}; |
||||
|
||||
static const OPJ_UINT16 vlc_tbl1[1024] = { |
||||
0x0013, 0x0065, 0x0043, 0x00de, 0x0083, 0x888d, 0x0023, 0x444e, |
||||
0x0013, 0x00a5, 0x0043, 0x88ae, 0x0083, 0x0035, 0x0023, 0x00d7, |
||||
0x0013, 0x00c5, 0x0043, 0x009e, 0x0083, 0x0055, 0x0023, 0x222e, |
||||
0x0013, 0x0095, 0x0043, 0x007e, 0x0083, 0x10fe, 0x0023, 0x0077, |
||||
0x0013, 0x0065, 0x0043, 0x88ce, 0x0083, 0x888d, 0x0023, 0x111e, |
||||
0x0013, 0x00a5, 0x0043, 0x005e, 0x0083, 0x0035, 0x0023, 0x00e7, |
||||
0x0013, 0x00c5, 0x0043, 0x00be, 0x0083, 0x0055, 0x0023, 0x11ff, |
||||
0x0013, 0x0095, 0x0043, 0x003e, 0x0083, 0x40ee, 0x0023, 0xa2af, |
||||
0x0013, 0x0065, 0x0043, 0x00de, 0x0083, 0x888d, 0x0023, 0x444e, |
||||
0x0013, 0x00a5, 0x0043, 0x88ae, 0x0083, 0x0035, 0x0023, 0x44ef, |
||||
0x0013, 0x00c5, 0x0043, 0x009e, 0x0083, 0x0055, 0x0023, 0x222e, |
||||
0x0013, 0x0095, 0x0043, 0x007e, 0x0083, 0x10fe, 0x0023, 0x00b7, |
||||
0x0013, 0x0065, 0x0043, 0x88ce, 0x0083, 0x888d, 0x0023, 0x111e, |
||||
0x0013, 0x00a5, 0x0043, 0x005e, 0x0083, 0x0035, 0x0023, 0xc4cf, |
||||
0x0013, 0x00c5, 0x0043, 0x00be, 0x0083, 0x0055, 0x0023, 0x00f7, |
||||
0x0013, 0x0095, 0x0043, 0x003e, 0x0083, 0x40ee, 0x0023, 0x006f, |
||||
0x0001, 0x0084, 0x0001, 0x0056, 0x0001, 0x0014, 0x0001, 0x00d7, |
||||
0x0001, 0x0024, 0x0001, 0x0096, 0x0001, 0x0045, 0x0001, 0x0077, |
||||
0x0001, 0x0084, 0x0001, 0x00c6, 0x0001, 0x0014, 0x0001, 0x888f, |
||||
0x0001, 0x0024, 0x0001, 0x00f7, 0x0001, 0x0035, 0x0001, 0x222f, |
||||
0x0001, 0x0084, 0x0001, 0x40fe, 0x0001, 0x0014, 0x0001, 0x00b7, |
||||
0x0001, 0x0024, 0x0001, 0x00bf, 0x0001, 0x0045, 0x0001, 0x0067, |
||||
0x0001, 0x0084, 0x0001, 0x00a6, 0x0001, 0x0014, 0x0001, 0x444f, |
||||
0x0001, 0x0024, 0x0001, 0x00e7, 0x0001, 0x0035, 0x0001, 0x113f, |
||||
0x0001, 0x0084, 0x0001, 0x0056, 0x0001, 0x0014, 0x0001, 0x00cf, |
||||
0x0001, 0x0024, 0x0001, 0x0096, 0x0001, 0x0045, 0x0001, 0x006f, |
||||
0x0001, 0x0084, 0x0001, 0x00c6, 0x0001, 0x0014, 0x0001, 0x009f, |
||||
0x0001, 0x0024, 0x0001, 0x00ef, 0x0001, 0x0035, 0x0001, 0x323f, |
||||
0x0001, 0x0084, 0x0001, 0x40fe, 0x0001, 0x0014, 0x0001, 0x00af, |
||||
0x0001, 0x0024, 0x0001, 0x44ff, 0x0001, 0x0045, 0x0001, 0x005f, |
||||
0x0001, 0x0084, 0x0001, 0x00a6, 0x0001, 0x0014, 0x0001, 0x007f, |
||||
0x0001, 0x0024, 0x0001, 0x00df, 0x0001, 0x0035, 0x0001, 0x111f, |
||||
0x0001, 0x0024, 0x0001, 0x0056, 0x0001, 0x0085, 0x0001, 0x00bf, |
||||
0x0001, 0x0014, 0x0001, 0x00f7, 0x0001, 0x00c6, 0x0001, 0x0077, |
||||
0x0001, 0x0024, 0x0001, 0xf8ff, 0x0001, 0x0045, 0x0001, 0x007f, |
||||
0x0001, 0x0014, 0x0001, 0x00df, 0x0001, 0x00a6, 0x0001, 0x313f, |
||||
0x0001, 0x0024, 0x0001, 0x222e, 0x0001, 0x0085, 0x0001, 0x00b7, |
||||
0x0001, 0x0014, 0x0001, 0x44ef, 0x0001, 0xa2ae, 0x0001, 0x0067, |
||||
0x0001, 0x0024, 0x0001, 0x51ff, 0x0001, 0x0045, 0x0001, 0x0097, |
||||
0x0001, 0x0014, 0x0001, 0x00cf, 0x0001, 0x0036, 0x0001, 0x223f, |
||||
0x0001, 0x0024, 0x0001, 0x0056, 0x0001, 0x0085, 0x0001, 0xb2bf, |
||||
0x0001, 0x0014, 0x0001, 0x40ef, 0x0001, 0x00c6, 0x0001, 0x006f, |
||||
0x0001, 0x0024, 0x0001, 0x72ff, 0x0001, 0x0045, 0x0001, 0x009f, |
||||
0x0001, 0x0014, 0x0001, 0x00d7, 0x0001, 0x00a6, 0x0001, 0x444f, |
||||
0x0001, 0x0024, 0x0001, 0x222e, 0x0001, 0x0085, 0x0001, 0xa8af, |
||||
0x0001, 0x0014, 0x0001, 0x00e7, 0x0001, 0xa2ae, 0x0001, 0x005f, |
||||
0x0001, 0x0024, 0x0001, 0x44ff, 0x0001, 0x0045, 0x0001, 0x888f, |
||||
0x0001, 0x0014, 0x0001, 0xaaaf, 0x0001, 0x0036, 0x0001, 0x111f, |
||||
0x0002, 0xf8fe, 0x0024, 0x0056, 0x0002, 0x00b6, 0x0085, 0x66ff, |
||||
0x0002, 0x00ce, 0x0014, 0x111e, 0x0002, 0x0096, 0x0035, 0xa8af, |
||||
0x0002, 0x00f6, 0x0024, 0x313e, 0x0002, 0x00a6, 0x0045, 0xb3bf, |
||||
0x0002, 0xb2be, 0x0014, 0xf5ff, 0x0002, 0x0066, 0x517e, 0x545f, |
||||
0x0002, 0xf2fe, 0x0024, 0x222e, 0x0002, 0x22ae, 0x0085, 0x44ef, |
||||
0x0002, 0x00c6, 0x0014, 0xf4ff, 0x0002, 0x0076, 0x0035, 0x447f, |
||||
0x0002, 0x40de, 0x0024, 0x323e, 0x0002, 0x009e, 0x0045, 0x00d7, |
||||
0x0002, 0x88be, 0x0014, 0xfaff, 0x0002, 0x115e, 0xf1fe, 0x444f, |
||||
0x0002, 0xf8fe, 0x0024, 0x0056, 0x0002, 0x00b6, 0x0085, 0xc8ef, |
||||
0x0002, 0x00ce, 0x0014, 0x111e, 0x0002, 0x0096, 0x0035, 0x888f, |
||||
0x0002, 0x00f6, 0x0024, 0x313e, 0x0002, 0x00a6, 0x0045, 0x44df, |
||||
0x0002, 0xb2be, 0x0014, 0xa8ff, 0x0002, 0x0066, 0x517e, 0x006f, |
||||
0x0002, 0xf2fe, 0x0024, 0x222e, 0x0002, 0x22ae, 0x0085, 0x00e7, |
||||
0x0002, 0x00c6, 0x0014, 0xe2ef, 0x0002, 0x0076, 0x0035, 0x727f, |
||||
0x0002, 0x40de, 0x0024, 0x323e, 0x0002, 0x009e, 0x0045, 0xb1bf, |
||||
0x0002, 0x88be, 0x0014, 0x73ff, 0x0002, 0x115e, 0xf1fe, 0x333f, |
||||
0x0001, 0x0084, 0x0001, 0x20ee, 0x0001, 0x00c5, 0x0001, 0xc4cf, |
||||
0x0001, 0x0044, 0x0001, 0x32ff, 0x0001, 0x0015, 0x0001, 0x888f, |
||||
0x0001, 0x0084, 0x0001, 0x0066, 0x0001, 0x0025, 0x0001, 0x00af, |
||||
0x0001, 0x0044, 0x0001, 0x22ef, 0x0001, 0x00a6, 0x0001, 0x005f, |
||||
0x0001, 0x0084, 0x0001, 0x444e, 0x0001, 0x00c5, 0x0001, 0xcccf, |
||||
0x0001, 0x0044, 0x0001, 0x00f7, 0x0001, 0x0015, 0x0001, 0x006f, |
||||
0x0001, 0x0084, 0x0001, 0x0056, 0x0001, 0x0025, 0x0001, 0x009f, |
||||
0x0001, 0x0044, 0x0001, 0x00df, 0x0001, 0x30fe, 0x0001, 0x222f, |
||||
0x0001, 0x0084, 0x0001, 0x20ee, 0x0001, 0x00c5, 0x0001, 0xc8cf, |
||||
0x0001, 0x0044, 0x0001, 0x11ff, 0x0001, 0x0015, 0x0001, 0x0077, |
||||
0x0001, 0x0084, 0x0001, 0x0066, 0x0001, 0x0025, 0x0001, 0x007f, |
||||
0x0001, 0x0044, 0x0001, 0x00e7, 0x0001, 0x00a6, 0x0001, 0x0037, |
||||
0x0001, 0x0084, 0x0001, 0x444e, 0x0001, 0x00c5, 0x0001, 0x00b7, |
||||
0x0001, 0x0044, 0x0001, 0x00bf, 0x0001, 0x0015, 0x0001, 0x003f, |
||||
0x0001, 0x0084, 0x0001, 0x0056, 0x0001, 0x0025, 0x0001, 0x0097, |
||||
0x0001, 0x0044, 0x0001, 0x00d7, 0x0001, 0x30fe, 0x0001, 0x111f, |
||||
0x0002, 0xa8ee, 0x0044, 0x888e, 0x0002, 0x00d6, 0x00c5, 0xf3ff, |
||||
0x0002, 0xfcfe, 0x0025, 0x003e, 0x0002, 0x00b6, 0x0055, 0xd8df, |
||||
0x0002, 0xf8fe, 0x0044, 0x0066, 0x0002, 0x207e, 0x0085, 0x99ff, |
||||
0x0002, 0x00e6, 0x00f5, 0x0036, 0x0002, 0x00a6, 0x0015, 0x009f, |
||||
0x0002, 0xf2fe, 0x0044, 0x0076, 0x0002, 0x44ce, 0x00c5, 0x76ff, |
||||
0x0002, 0xf1fe, 0x0025, 0x444e, 0x0002, 0x00ae, 0x0055, 0xc8cf, |
||||
0x0002, 0xf4fe, 0x0044, 0x445e, 0x0002, 0x10be, 0x0085, 0xe4ef, |
||||
0x0002, 0x54de, 0x00f5, 0x111e, 0x0002, 0x0096, 0x0015, 0x222f, |
||||
0x0002, 0xa8ee, 0x0044, 0x888e, 0x0002, 0x00d6, 0x00c5, 0xfaff, |
||||
0x0002, 0xfcfe, 0x0025, 0x003e, 0x0002, 0x00b6, 0x0055, 0x11bf, |
||||
0x0002, 0xf8fe, 0x0044, 0x0066, 0x0002, 0x207e, 0x0085, 0x22ef, |
||||
0x0002, 0x00e6, 0x00f5, 0x0036, 0x0002, 0x00a6, 0x0015, 0x227f, |
||||
0x0002, 0xf2fe, 0x0044, 0x0076, 0x0002, 0x44ce, 0x00c5, 0xd5ff, |
||||
0x0002, 0xf1fe, 0x0025, 0x444e, 0x0002, 0x00ae, 0x0055, 0x006f, |
||||
0x0002, 0xf4fe, 0x0044, 0x445e, 0x0002, 0x10be, 0x0085, 0x11df, |
||||
0x0002, 0x54de, 0x00f5, 0x111e, 0x0002, 0x0096, 0x0015, 0x515f, |
||||
0x0003, 0x00f6, 0x0014, 0x111e, 0x0044, 0x888e, 0x00a5, 0xd4df, |
||||
0x0003, 0xa2ae, 0x0055, 0x76ff, 0x0024, 0x223e, 0x00b6, 0xaaaf, |
||||
0x0003, 0x00e6, 0x0014, 0xf5ff, 0x0044, 0x0066, 0x0085, 0xcccf, |
||||
0x0003, 0x009e, 0x00c5, 0x44ef, 0x0024, 0x0036, 0xf8fe, 0x317f, |
||||
0x0003, 0xe8ee, 0x0014, 0xf1ff, 0x0044, 0x0076, 0x00a5, 0xc4cf, |
||||
0x0003, 0x227e, 0x0055, 0xd1df, 0x0024, 0x444e, 0xf4fe, 0x515f, |
||||
0x0003, 0x00d6, 0x0014, 0xe2ef, 0x0044, 0x445e, 0x0085, 0x22bf, |
||||
0x0003, 0x0096, 0x00c5, 0xc8df, 0x0024, 0x222e, 0xf2fe, 0x226f, |
||||
0x0003, 0x00f6, 0x0014, 0x111e, 0x0044, 0x888e, 0x00a5, 0xb1bf, |
||||
0x0003, 0xa2ae, 0x0055, 0x33ff, 0x0024, 0x223e, 0x00b6, 0xa8af, |
||||
0x0003, 0x00e6, 0x0014, 0xb9ff, 0x0044, 0x0066, 0x0085, 0xa8bf, |
||||
0x0003, 0x009e, 0x00c5, 0xe4ef, 0x0024, 0x0036, 0xf8fe, 0x646f, |
||||
0x0003, 0xe8ee, 0x0014, 0xfcff, 0x0044, 0x0076, 0x00a5, 0xc8cf, |
||||
0x0003, 0x227e, 0x0055, 0xeaef, 0x0024, 0x444e, 0xf4fe, 0x747f, |
||||
0x0003, 0x00d6, 0x0014, 0xfaff, 0x0044, 0x445e, 0x0085, 0xb2bf, |
||||
0x0003, 0x0096, 0x00c5, 0x44df, 0x0024, 0x222e, 0xf2fe, 0x313f, |
||||
0x00f3, 0xfafe, 0xf1fd, 0x0036, 0x0004, 0x32be, 0x0075, 0x11df, |
||||
0x00f3, 0x54de, 0xf2fd, 0xe4ef, 0x00d5, 0x717e, 0xfcfe, 0x737f, |
||||
0x00f3, 0xf3fe, 0xf8fd, 0x111e, 0x0004, 0x0096, 0x0055, 0xb1bf, |
||||
0x00f3, 0x00ce, 0x00b5, 0xd8df, 0xf4fd, 0x0066, 0xb9fe, 0x545f, |
||||
0x00f3, 0x76fe, 0xf1fd, 0x0026, 0x0004, 0x00a6, 0x0075, 0x009f, |
||||
0x00f3, 0x00ae, 0xf2fd, 0xf7ff, 0x00d5, 0x0046, 0xf5fe, 0x747f, |
||||
0x00f3, 0x00e6, 0xf8fd, 0x0016, 0x0004, 0x0086, 0x0055, 0x888f, |
||||
0x00f3, 0x00c6, 0x00b5, 0xe2ef, 0xf4fd, 0x115e, 0xa8ee, 0x113f, |
||||
0x00f3, 0xfafe, 0xf1fd, 0x0036, 0x0004, 0x32be, 0x0075, 0xd1df, |
||||
0x00f3, 0x54de, 0xf2fd, 0xfbff, 0x00d5, 0x717e, 0xfcfe, 0x447f, |
||||
0x00f3, 0xf3fe, 0xf8fd, 0x111e, 0x0004, 0x0096, 0x0055, 0x727f, |
||||
0x00f3, 0x00ce, 0x00b5, 0x22ef, 0xf4fd, 0x0066, 0xb9fe, 0x444f, |
||||
0x00f3, 0x76fe, 0xf1fd, 0x0026, 0x0004, 0x00a6, 0x0075, 0x11bf, |
||||
0x00f3, 0x00ae, 0xf2fd, 0xffff, 0x00d5, 0x0046, 0xf5fe, 0x323f, |
||||
0x00f3, 0x00e6, 0xf8fd, 0x0016, 0x0004, 0x0086, 0x0055, 0x006f, |
||||
0x00f3, 0x00c6, 0x00b5, 0xb8bf, 0xf4fd, 0x115e, 0xa8ee, 0x222f |
||||
}; |
@ -0,0 +1,174 @@ |
||||
/*
|
||||
* The copyright in this software is being made available under the 2-clauses |
||||
* BSD License, included below. This software may be subject to other third |
||||
* party and contributor rights, including patent rights, and no such rights |
||||
* are granted under this license. |
||||
* |
||||
* Copyright (c) 2017, IntoPix SA <contact@intopix.com> |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions |
||||
* are met: |
||||
* 1. Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* 2. Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' |
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
* 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 |
||||
* POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
#undef NDEBUG |
||||
|
||||
#include "opj_includes.h" |
||||
|
||||
int main() |
||||
{ |
||||
OPJ_UINT32 i, j, w, h; |
||||
OPJ_INT32 buffer[ 99 * 101 ]; |
||||
OPJ_BOOL ret; |
||||
opj_sparse_array_int32_t* sa; |
||||
|
||||
sa = opj_sparse_array_int32_create(0, 1, 1, 1); |
||||
assert(sa == NULL); |
||||
opj_sparse_array_int32_free(sa); |
||||
|
||||
sa = opj_sparse_array_int32_create(1, 0, 1, 1); |
||||
assert(sa == NULL); |
||||
|
||||
sa = opj_sparse_array_int32_create(1, 1, 0, 1); |
||||
assert(sa == NULL); |
||||
|
||||
sa = opj_sparse_array_int32_create(1, 1, 1, 0); |
||||
assert(sa == NULL); |
||||
|
||||
sa = opj_sparse_array_int32_create(99, 101, ~0U, ~0U); |
||||
assert(sa == NULL); |
||||
|
||||
sa = opj_sparse_array_int32_create(99, 101, 15, 17); |
||||
opj_sparse_array_int32_free(sa); |
||||
|
||||
sa = opj_sparse_array_int32_create(99, 101, 15, 17); |
||||
ret = opj_sparse_array_int32_read(sa, 0, 0, 0, 1, buffer, 1, 1, OPJ_FALSE); |
||||
assert(!ret); |
||||
ret = opj_sparse_array_int32_read(sa, 0, 0, 1, 0, buffer, 1, 1, OPJ_FALSE); |
||||
assert(!ret); |
||||
ret = opj_sparse_array_int32_read(sa, 0, 0, 100, 1, buffer, 1, 1, OPJ_FALSE); |
||||
assert(!ret); |
||||
ret = opj_sparse_array_int32_read(sa, 0, 0, 1, 102, buffer, 1, 1, OPJ_FALSE); |
||||
assert(!ret); |
||||
ret = opj_sparse_array_int32_read(sa, 1, 0, 0, 1, buffer, 1, 1, OPJ_FALSE); |
||||
assert(!ret); |
||||
ret = opj_sparse_array_int32_read(sa, 0, 1, 1, 0, buffer, 1, 1, OPJ_FALSE); |
||||
assert(!ret); |
||||
ret = opj_sparse_array_int32_read(sa, 99, 101, 99, 101, buffer, 1, 1, |
||||
OPJ_FALSE); |
||||
assert(!ret); |
||||
|
||||
buffer[0] = 1; |
||||
ret = opj_sparse_array_int32_read(sa, 0, 0, 1, 1, buffer, 1, 1, OPJ_FALSE); |
||||
assert(ret); |
||||
assert(buffer[0] == 0); |
||||
|
||||
memset(buffer, 0xFF, sizeof(buffer)); |
||||
ret = opj_sparse_array_int32_read(sa, 0, 0, 99, 101, buffer, 1, 99, OPJ_FALSE); |
||||
assert(ret); |
||||
for (i = 0; i < 99 * 101; i++) { |
||||
assert(buffer[i] == 0); |
||||
} |
||||
|
||||
buffer[0] = 1; |
||||
ret = opj_sparse_array_int32_write(sa, 4, 5, 4 + 1, 5 + 1, buffer, 1, 1, |
||||
OPJ_FALSE); |
||||
assert(ret); |
||||
|
||||
buffer[0] = 2; |
||||
ret = opj_sparse_array_int32_write(sa, 4, 5, 4 + 1, 5 + 1, buffer, 1, 1, |
||||
OPJ_FALSE); |
||||
assert(ret); |
||||
|
||||
buffer[0] = 0; |
||||
buffer[1] = 0xFF; |
||||
ret = opj_sparse_array_int32_read(sa, 4, 5, 4 + 1, 5 + 1, buffer, 1, 1, |
||||
OPJ_FALSE); |
||||
assert(ret); |
||||
assert(buffer[0] == 2); |
||||
assert(buffer[1] == 0xFF); |
||||
|
||||
buffer[0] = 0xFF; |
||||
buffer[1] = 0xFF; |
||||
buffer[2] = 0xFF; |
||||
ret = opj_sparse_array_int32_read(sa, 4, 5, 4 + 1, 5 + 2, buffer, 0, 1, |
||||
OPJ_FALSE); |
||||
assert(ret); |
||||
assert(buffer[0] == 2); |
||||
assert(buffer[1] == 0); |
||||
assert(buffer[2] == 0xFF); |
||||
|
||||
buffer[0] = 3; |
||||
ret = opj_sparse_array_int32_write(sa, 4, 5, 4 + 1, 5 + 1, buffer, 0, 1, |
||||
OPJ_FALSE); |
||||
assert(ret); |
||||
|
||||
buffer[0] = 0; |
||||
buffer[1] = 0xFF; |
||||
ret = opj_sparse_array_int32_read(sa, 4, 5, 4 + 1, 5 + 1, buffer, 1, 1, |
||||
OPJ_FALSE); |
||||
assert(ret); |
||||
assert(buffer[0] == 3); |
||||
assert(buffer[1] == 0xFF); |
||||
|
||||
w = 15 + 1; |
||||
h = 17 + 1; |
||||
memset(buffer, 0xFF, sizeof(buffer)); |
||||
ret = opj_sparse_array_int32_read(sa, 2, 1, 2 + w, 1 + h, buffer, 1, w, |
||||
OPJ_FALSE); |
||||
assert(ret); |
||||
for (j = 0; j < h; j++) { |
||||
for (i = 0; i < w; i++) { |
||||
if (i == 4 - 2 && j == 5 - 1) { |
||||
assert(buffer[ j * w + i ] == 3); |
||||
} else { |
||||
assert(buffer[ j * w + i ] == 0); |
||||
} |
||||
} |
||||
} |
||||
|
||||
opj_sparse_array_int32_free(sa); |
||||
|
||||
|
||||
sa = opj_sparse_array_int32_create(99, 101, 15, 17); |
||||
memset(buffer, 0xFF, sizeof(buffer)); |
||||
ret = opj_sparse_array_int32_read(sa, 0, 0, 2, 1, buffer, 2, 4, OPJ_FALSE); |
||||
assert(ret); |
||||
assert(buffer[0] == 0); |
||||
assert(buffer[1] == -1); |
||||
assert(buffer[2] == 0); |
||||
|
||||
buffer[0] = 1; |
||||
buffer[2] = 3; |
||||
ret = opj_sparse_array_int32_write(sa, 0, 0, 2, 1, buffer, 2, 4, OPJ_FALSE); |
||||
assert(ret); |
||||
|
||||
memset(buffer, 0xFF, sizeof(buffer)); |
||||
ret = opj_sparse_array_int32_read(sa, 0, 0, 2, 1, buffer, 2, 4, OPJ_FALSE); |
||||
assert(ret); |
||||
assert(buffer[0] == 1); |
||||
assert(buffer[1] == -1); |
||||
assert(buffer[2] == 3); |
||||
|
||||
opj_sparse_array_int32_free(sa); |
||||
|
||||
return 0; |
||||
} |
@ -0,0 +1,146 @@ |
||||
/*
|
||||
* $Id: thix_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $ |
||||
* |
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium |
||||
* Copyright (c) 2002-2014, Professor Benoit Macq |
||||
* Copyright (c) 2003-2004, Yannick Verschueren |
||||
* Copyright (c) 2010-2011, Kaori Hagihara |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions |
||||
* are met: |
||||
* 1. Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* 2. Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' |
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
* 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 |
||||
* POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
/*! \file
|
||||
* \brief Modification of jpip.c from 2KAN indexer |
||||
*/ |
||||
|
||||
#include "opj_includes.h" |
||||
|
||||
|
||||
|
||||
int opj_write_thix(int coff, opj_codestream_info_t cstr_info, |
||||
opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager) |
||||
{ |
||||
OPJ_BYTE l_data_header [4]; |
||||
int i; |
||||
int tileno; |
||||
opj_jp2_box_t *box; |
||||
OPJ_UINT32 len; |
||||
OPJ_OFF_T lenp; |
||||
|
||||
lenp = 0; |
||||
box = (opj_jp2_box_t *)opj_calloc((size_t)(cstr_info.tw * cstr_info.th), |
||||
sizeof(opj_jp2_box_t)); |
||||
if (box == NULL) { |
||||
return 0; |
||||
} |
||||
for (i = 0; i < 2 ; i++) { |
||||
if (i) { |
||||
opj_stream_seek(cio, lenp, p_manager); |
||||
} |
||||
|
||||
lenp = opj_stream_tell(cio); |
||||
opj_stream_skip(cio, 4, p_manager); /* L [at the end] */ |
||||
opj_write_bytes(l_data_header, JPIP_THIX, 4); /* THIX */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
|
||||
opj_write_manf(i, cstr_info.tw * cstr_info.th, box, cio, p_manager); |
||||
|
||||
for (tileno = 0; tileno < cstr_info.tw * cstr_info.th; tileno++) { |
||||
box[tileno].length = (OPJ_UINT32)opj_write_tilemhix(coff, cstr_info, tileno, |
||||
cio, p_manager); |
||||
box[tileno].type = JPIP_MHIX; |
||||
} |
||||
|
||||
len = (OPJ_UINT32)(opj_stream_tell(cio) - lenp); |
||||
opj_stream_seek(cio, lenp, p_manager); |
||||
opj_write_bytes(l_data_header, len, 4); /* L */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_stream_seek(cio, lenp + len, p_manager); |
||||
|
||||
} |
||||
|
||||
opj_free(box); |
||||
|
||||
return (int)len; |
||||
} |
||||
|
||||
/*
|
||||
* Write tile-part headers mhix box |
||||
* |
||||
* @param[in] coff offset of j2k codestream |
||||
* @param[in] cstr_info codestream information |
||||
* @param[in] tileno tile number |
||||
* @param[in] cio file output handle |
||||
* @return length of mhix box |
||||
*/ |
||||
int opj_write_tilemhix(int coff, opj_codestream_info_t cstr_info, int tileno, |
||||
opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager) |
||||
{ |
||||
OPJ_BYTE l_data_header [8]; |
||||
int i; |
||||
opj_tile_info_t tile; |
||||
opj_tp_info_t tp; |
||||
opj_marker_info_t *marker; |
||||
OPJ_UINT32 len; |
||||
OPJ_OFF_T lenp; |
||||
|
||||
lenp = opj_stream_tell(cio); |
||||
opj_stream_skip(cio, 4, |
||||
p_manager); /* L [at the end] */ |
||||
opj_write_bytes(l_data_header, JPIP_MHIX, |
||||
4); /* MHIX */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
|
||||
tile = cstr_info.tile[tileno]; |
||||
tp = tile.tp[0]; |
||||
|
||||
opj_write_bytes(l_data_header, |
||||
(OPJ_UINT32)(tp.tp_end_header - tp.tp_start_pos + 1), |
||||
8); /* TLEN */ |
||||
opj_stream_write_data(cio, l_data_header, 8, p_manager); |
||||
|
||||
marker = cstr_info.tile[tileno].marker; |
||||
|
||||
for (i = 0; i < cstr_info.tile[tileno].marknum; |
||||
i++) { /* Marker restricted to 1 apparition */ |
||||
opj_write_bytes(l_data_header, marker[i].type, 2); |
||||
opj_write_bytes(l_data_header + 2, 0, 2); |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_write_bytes(l_data_header, (OPJ_UINT32)(marker[i].pos - coff), 8); |
||||
opj_stream_write_data(cio, l_data_header, 8, p_manager); |
||||
opj_write_bytes(l_data_header, (OPJ_UINT32)marker[i].len, 2); |
||||
opj_stream_write_data(cio, l_data_header, 2, p_manager); |
||||
} |
||||
|
||||
/* free( marker);*/ |
||||
|
||||
len = (OPJ_UINT32)(opj_stream_tell(cio) - lenp); |
||||
opj_stream_seek(cio, lenp, p_manager); |
||||
opj_write_bytes(l_data_header, len, 4); /* L */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_stream_seek(cio, lenp + len, p_manager); |
||||
|
||||
return (int)len; |
||||
} |
@ -0,0 +1,190 @@ |
||||
/*
|
||||
* $Id: tpix_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $ |
||||
* |
||||
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium |
||||
* Copyright (c) 2002-2014, Professor Benoit Macq |
||||
* Copyright (c) 2003-2004, Yannick Verschueren |
||||
* Copyright (c) 2010-2011, Kaori Hagihara |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions |
||||
* are met: |
||||
* 1. Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* 2. Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' |
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
* 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 |
||||
* POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
/*! \file
|
||||
* \brief Modification of jpip.c from 2KAN indexer |
||||
*/ |
||||
|
||||
#include "opj_includes.h" |
||||
|
||||
#define MAX(a,b) ((a)>(b)?(a):(b)) |
||||
|
||||
/*
|
||||
* Get number of maximum tile parts per tile |
||||
* |
||||
* @param[in] cstr_info codestream information |
||||
* @return number of maximum tile parts per tile |
||||
*/ |
||||
int get_num_max_tile_parts(opj_codestream_info_t cstr_info); |
||||
|
||||
|
||||
/*
|
||||
* Write faix box of tpix |
||||
* |
||||
* @param[in] coff offset of j2k codestream |
||||
* @param[in] compno component number |
||||
* @param[in] cstr_info codestream information |
||||
* @param[in] j2klen length of j2k codestream |
||||
* @param[in] cio file output handle |
||||
* @return length of faix box |
||||
*/ |
||||
|
||||
int opj_write_tpix(int coff, |
||||
opj_codestream_info_t cstr_info, |
||||
int j2klen, opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager) |
||||
{ |
||||
OPJ_BYTE l_data_header [4]; |
||||
OPJ_UINT32 len; |
||||
OPJ_OFF_T lenp; |
||||
|
||||
lenp = opj_stream_tell(cio); |
||||
opj_stream_skip(cio, 4, p_manager); |
||||
opj_write_bytes(l_data_header, JPIP_TPIX, 4); /* TPIX */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
|
||||
opj_write_tpixfaix(coff, 0, cstr_info, j2klen, cio, p_manager); |
||||
|
||||
len = (OPJ_UINT32)(opj_stream_tell(cio) - lenp); |
||||
|
||||
opj_stream_skip(cio, lenp, p_manager); |
||||
opj_write_bytes(l_data_header, len, 4); /* L */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_stream_seek(cio, lenp + len, p_manager); |
||||
|
||||
return (int)len; |
||||
} |
||||
|
||||
int opj_write_tpixfaix(int coff, |
||||
int compno, |
||||
opj_codestream_info_t cstr_info, |
||||
int j2klen, |
||||
opj_stream_private_t *cio, |
||||
opj_event_mgr_t * p_manager) |
||||
{ |
||||
OPJ_UINT32 len; |
||||
OPJ_OFF_T lenp; |
||||
OPJ_UINT32 i, j; |
||||
OPJ_UINT32 Aux; |
||||
OPJ_UINT32 num_max_tile_parts; |
||||
OPJ_UINT32 size_of_coding; /* 4 or 8 */ |
||||
opj_tp_info_t tp; |
||||
OPJ_BYTE l_data_header [8]; |
||||
OPJ_UINT32 version; |
||||
|
||||
num_max_tile_parts = (OPJ_UINT32)get_num_max_tile_parts(cstr_info); |
||||
|
||||
if (j2klen > pow(2, 32)) { |
||||
size_of_coding = 8; |
||||
version = num_max_tile_parts == 1 ? 1 : 3; |
||||
} else { |
||||
size_of_coding = 4; |
||||
version = num_max_tile_parts == 1 ? 0 : 2; |
||||
} |
||||
|
||||
lenp = opj_stream_tell(cio); |
||||
opj_stream_skip(cio, 4, p_manager); /* L [at the end] */ |
||||
opj_write_bytes(l_data_header, JPIP_FAIX, 4); /* FAIX */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_write_bytes(l_data_header, version, 1); /* Version 0 = 4 bytes */ |
||||
opj_stream_write_data(cio, l_data_header, 1, p_manager); |
||||
|
||||
opj_write_bytes(l_data_header, num_max_tile_parts, |
||||
size_of_coding); /* NMAX */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
opj_write_bytes(l_data_header, (OPJ_UINT32)(cstr_info.tw * cstr_info.th), |
||||
size_of_coding); /* M */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
|
||||
for (i = 0; i < (OPJ_UINT32)(cstr_info.tw * cstr_info.th); i++) { |
||||
for (j = 0; j < (OPJ_UINT32)cstr_info.tile[i].num_tps; j++) { |
||||
tp = cstr_info.tile[i].tp[j]; |
||||
|
||||
opj_write_bytes(l_data_header, (OPJ_UINT32)(tp.tp_start_pos - coff), |
||||
size_of_coding); /* start position */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
opj_write_bytes(l_data_header, |
||||
(OPJ_UINT32)(tp.tp_end_pos - tp.tp_start_pos + 1), |
||||
size_of_coding); /* length */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
|
||||
if (version & 0x02) { |
||||
if (cstr_info.tile[i].num_tps == 1 && cstr_info.numdecompos[compno] > 1) { |
||||
Aux = (OPJ_UINT32)(cstr_info.numdecompos[compno] + 1); |
||||
} else { |
||||
Aux = j + 1; |
||||
} |
||||
|
||||
opj_write_bytes(l_data_header, Aux, 4); |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
|
||||
/*cio_write(img.tile[i].tile_parts[j].num_reso_AUX,4);*/ /* Aux_i,j : Auxiliary value */ |
||||
/* fprintf(stderr,"AUX value %d\n",Aux);*/ |
||||
} |
||||
/*cio_write(0,4);*/ |
||||
} |
||||
/* PADDING */ |
||||
while (j < num_max_tile_parts) { |
||||
|
||||
opj_write_bytes(l_data_header, 0, |
||||
size_of_coding); /* start position */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
opj_write_bytes(l_data_header, 0, |
||||
size_of_coding); /* length */ |
||||
opj_stream_write_data(cio, l_data_header, size_of_coding, p_manager); |
||||
|
||||
if (version & 0x02) { |
||||
opj_write_bytes(l_data_header, 0, 4); /* Aux_i,j : Auxiliary value */ |
||||
} |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
j++; |
||||
} |
||||
} |
||||
|
||||
len = (OPJ_UINT32)(opj_stream_tell(cio) - lenp); |
||||
opj_stream_seek(cio, lenp, p_manager); |
||||
opj_write_bytes(l_data_header, len, 4); /* L */ |
||||
opj_stream_write_data(cio, l_data_header, 4, p_manager); |
||||
opj_stream_seek(cio, lenp + len, p_manager); |
||||
|
||||
return (int)len; |
||||
} |
||||
|
||||
int get_num_max_tile_parts(opj_codestream_info_t cstr_info) |
||||
{ |
||||
int num_max_tp = 0, i; |
||||
|
||||
for (i = 0; i < cstr_info.tw * cstr_info.th; i++) { |
||||
num_max_tp = MAX(cstr_info.tile[i].num_tps, num_max_tp); |
||||
} |
||||
|
||||
return num_max_tp; |
||||
} |
Loading…
Reference in new issue