[trunk] WIP: update jp2 dump functions with the new V2 framework
This commit is contained in:
parent
cc0ff6b0bf
commit
efd780f82a
1
CHANGES
1
CHANGES
|
@ -6,6 +6,7 @@ What's New for OpenJPEG
|
||||||
+ : added
|
+ : added
|
||||||
|
|
||||||
October 07, 2011
|
October 07, 2011
|
||||||
|
+ [mickael] WIP: update jp2 dump functions with the new V2 framework
|
||||||
+ [mickael] WIP: update output filename of conformance dump test to be compatible with new baseline
|
+ [mickael] WIP: update output filename of conformance dump test to be compatible with new baseline
|
||||||
* [mickael] WIP: correct wrong input in dump_codec function and add missing return value
|
* [mickael] WIP: correct wrong input in dump_codec function and add missing return value
|
||||||
* [mickael] WIP: correct mistake inside set_decoded_area function (credit to Francois De Vieilleville)
|
* [mickael] WIP: correct mistake inside set_decoded_area function (credit to Francois De Vieilleville)
|
||||||
|
|
|
@ -2441,7 +2441,7 @@ opj_bool jp2_read_header( struct opj_stream_private *p_stream,
|
||||||
struct opj_event_mgr * p_manager
|
struct opj_event_mgr * p_manager
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// preconditions
|
/* preconditions */
|
||||||
assert(jp2 != 00);
|
assert(jp2 != 00);
|
||||||
assert(p_stream != 00);
|
assert(p_stream != 00);
|
||||||
assert(p_manager != 00);
|
assert(p_manager != 00);
|
||||||
|
@ -2648,3 +2648,24 @@ opj_jp2_v2_t* jp2_create(opj_bool p_is_decoder)
|
||||||
|
|
||||||
return jp2;
|
return jp2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void jp2_dump(opj_jp2_v2_t* p_jp2, OPJ_INT32 flag, FILE* out_stream)
|
||||||
|
{
|
||||||
|
/* preconditions */
|
||||||
|
assert(p_jp2 != 00);
|
||||||
|
|
||||||
|
j2k_dump(p_jp2->j2k,
|
||||||
|
flag,
|
||||||
|
out_stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
opj_codestream_index_t* jp2_get_cstr_index(opj_jp2_v2_t* p_jp2)
|
||||||
|
{
|
||||||
|
return j2k_get_cstr_index(p_jp2->j2k);
|
||||||
|
}
|
||||||
|
|
||||||
|
opj_codestream_info_v2_t* jp2_get_cstr_info(opj_jp2_v2_t* p_jp2)
|
||||||
|
{
|
||||||
|
return j2k_get_cstr_info(p_jp2->j2k);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -421,6 +421,35 @@ opj_bool jp2_set_decode_area(
|
||||||
struct opj_event_mgr * p_manager
|
struct opj_event_mgr * p_manager
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dump some elements from the JP2 decompression structure .
|
||||||
|
*
|
||||||
|
*@param p_jp2 the jp2 codec.
|
||||||
|
*@param flag flag to describe what elments are dump.
|
||||||
|
*@param out_stream output stream where dump the elements.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void jp2_dump (opj_jp2_v2_t* p_jp2, OPJ_INT32 flag, FILE* out_stream);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the codestream info from a JPEG2000 codec.
|
||||||
|
*
|
||||||
|
*@param p_jp2 jp2 codec.
|
||||||
|
*
|
||||||
|
*@return the codestream information extract from the jpg2000 codec
|
||||||
|
*/
|
||||||
|
opj_codestream_info_v2_t* jp2_get_cstr_info(opj_jp2_v2_t* p_jp2);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the codestream index from a JPEG2000 codec.
|
||||||
|
*
|
||||||
|
*@param p_jp2 jp2 codec.
|
||||||
|
*
|
||||||
|
*@return the codestream index extract from the jpg2000 codec
|
||||||
|
*/
|
||||||
|
opj_codestream_index_t* jp2_get_cstr_index(opj_jp2_v2_t* p_jp2);
|
||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
|
@ -109,7 +109,7 @@ typedef struct opj_codec_private
|
||||||
opj_event_mgr_t* m_event_mgr;
|
opj_event_mgr_t* m_event_mgr;
|
||||||
/** Flag to indicate if the codec is used to decode or encode*/
|
/** Flag to indicate if the codec is used to decode or encode*/
|
||||||
opj_bool is_decompressor;
|
opj_bool is_decompressor;
|
||||||
opj_bool (*opj_dump_codec) (void * p_codec, OPJ_INT32 info_flag, FILE* output_stream);
|
void (*opj_dump_codec) (void * p_codec, OPJ_INT32 info_flag, FILE* output_stream);
|
||||||
opj_codestream_info_v2_t* (*opj_get_codec_info)(void* p_codec);
|
opj_codestream_info_v2_t* (*opj_get_codec_info)(void* p_codec);
|
||||||
opj_codestream_index_t* (*opj_get_codec_index)(void* p_codec);
|
opj_codestream_index_t* (*opj_get_codec_index)(void* p_codec);
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,7 @@ opj_codec_t* OPJ_CALLCONV opj_create_decompress_v2(OPJ_CODEC_FORMAT p_format)
|
||||||
|
|
||||||
switch (p_format) {
|
switch (p_format) {
|
||||||
case CODEC_J2K:
|
case CODEC_J2K:
|
||||||
l_info->opj_dump_codec = (opj_bool (*) (void*, OPJ_INT32, FILE*)) j2k_dump;
|
l_info->opj_dump_codec = (void (*) (void*, OPJ_INT32, FILE*)) j2k_dump;
|
||||||
|
|
||||||
l_info->opj_get_codec_info = (opj_codestream_info_v2_t* (*) (void*) ) j2k_get_cstr_info;
|
l_info->opj_get_codec_info = (opj_codestream_info_v2_t* (*) (void*) ) j2k_get_cstr_info;
|
||||||
|
|
||||||
|
@ -285,6 +285,12 @@ opj_codec_t* OPJ_CALLCONV opj_create_decompress_v2(OPJ_CODEC_FORMAT p_format)
|
||||||
|
|
||||||
case CODEC_JP2:
|
case CODEC_JP2:
|
||||||
/* get a JP2 decoder handle */
|
/* get a JP2 decoder handle */
|
||||||
|
l_info->opj_dump_codec = (void (*) (void*, OPJ_INT32, FILE*)) jp2_dump;
|
||||||
|
|
||||||
|
l_info->opj_get_codec_info = (opj_codestream_info_v2_t* (*) (void*) ) jp2_get_cstr_info;
|
||||||
|
|
||||||
|
l_info->opj_get_codec_index = (opj_codestream_index_t* (*) (void*) ) jp2_get_cstr_index;
|
||||||
|
|
||||||
l_info->m_codec_data.m_decompression.opj_decode =
|
l_info->m_codec_data.m_decompression.opj_decode =
|
||||||
(opj_bool (*) ( void *,
|
(opj_bool (*) ( void *,
|
||||||
struct opj_stream_private *,
|
struct opj_stream_private *,
|
||||||
|
|
|
@ -281,7 +281,7 @@ FOREACH(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
|
||||||
# Compare the dump output with the baseline
|
# Compare the dump output with the baseline
|
||||||
ADD_TEST(NR-DEC-${INPUT_FILENAME_NAME}-${IT_TEST_DEC}-compare_dump2base
|
ADD_TEST(NR-DEC-${INPUT_FILENAME_NAME}-${IT_TEST_DEC}-compare_dump2base
|
||||||
${EXECUTABLE_OUTPUT_PATH}/compare_dump_files
|
${EXECUTABLE_OUTPUT_PATH}/compare_dump_files
|
||||||
-b ${BASELINE_NR}/opj_${INPUT_FILENAME_NAME_WE}.txt
|
-b ${BASELINE_NR}/opj_v2_${INPUT_FILENAME_NAME_WE}.txt
|
||||||
-t ${TEMP}/${INPUT_FILENAME_NAME}.txt
|
-t ${TEMP}/${INPUT_FILENAME_NAME}.txt
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue