]> granicus.if.org Git - openjpeg/commitdiff
* Better fix of the TPH EPBs bug in JPWL module
authorGiuseppe Baruffa <gbaruffa@users.noreply.github.com>
Tue, 5 Dec 2006 18:20:04 +0000 (18:20 +0000)
committerGiuseppe Baruffa <gbaruffa@users.noreply.github.com>
Tue, 5 Dec 2006 18:20:04 +0000 (18:20 +0000)
* Fixed the UEP bug in JPWL module
+ Added some lines in the help of JPWL_image_to_j2k

ChangeLog
codec/image_to_j2k.c
jpwl/JPWL_j2k_to_image.dsp
jpwl/jpwl.c
jpwl/jpwl_lib.c

index ecfc7b3dd1bd77e4df182b5e72cda08ef25b1cad..20f816a832c65e686c7cd60a6d3dd7ac03178b3d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,11 @@ What's New for OpenJPEG
 ! : changed
 + : added
 
+December 05, 2006
+* [Giuseppe Baruffa] Better fix of the TPH EPBs bug in JPWL module
+* [GB] Fixed the UEP bug in JPWL module; now, during a UEP specification, RS protection or CRC check can be switched off for selected range of packets, and consequently reswitched on without confusing the decoder
++ [GB] Added some lines in the help of JPWL_image_to_j2k, specifying that when using error protection on data packets, this must be paired with header protection, i.e. there cannot be packet protection without header protection
+
 December 04, 2006
 
 + [Francois-Olivier Devaux] New tag: version1.0 (includes codec and libopenjpeg directories)
index 5a663a630e5281488ba9edc8f9894cc3b8cb2835..1709c3790a4489257e71667f24ed76c8cdfa83e8 100644 (file)
@@ -201,10 +201,10 @@ void encode_help_display() {
        fprintf(stdout,"                   1/2 bytes, for the transformed pseudo-floating point value\n");
        fprintf(stdout,"\n");
        fprintf(stdout,"                 ex.:\n");
-       fprintf(stdout," h,h0=64,h3=16,h5=0,p0=78,p0:24=56,p1,p3:0=0,p3:20=32,s=0,s0=6,s3=-1,a=0,g=1,z=1\n");
+       fprintf(stdout," h,h0=64,h3=16,h5=32,p0=78,p0:24=56,p1,p3:0=0,p3:20=32,s=0,s0=6,s3=-1,a=0,g=1,z=1\n");
        fprintf(stdout,"                 means\n");
        fprintf(stdout,"                   predefined EPB in MH, rs(64,32) from TPH 0 to TPH 2,\n");
-       fprintf(stdout,"                   CRC-16 in TPH 3 and TPH 4, no EPBs in remaining TPHs,\n");
+       fprintf(stdout,"                   CRC-16 in TPH 3 and TPH 4, CRC-32 in remaining TPHs,\n");
        fprintf(stdout,"                   UEP rs(78,32) for packets 0 to 23 of tile 0,\n");
        fprintf(stdout,"                   UEP rs(56,32) for packets 24 to the last of tile 0,\n");
        fprintf(stdout,"                   UEP rs default for packets of tile 1,\n");
@@ -219,6 +219,11 @@ void encode_help_display() {
        fprintf(stdout,"                 means\n");
        fprintf(stdout,"                   default protection to headers (MH and TPHs) as well as\n");
        fprintf(stdout,"                   data packets, one ESD in MH\n");
+       fprintf(stdout,"\n");
+       fprintf(stdout,"                 N.B.: use the following recommendations when specifying\n");
+       fprintf(stdout,"                       the JPWL parameters list\n");
+       fprintf(stdout,"                   - when you use UEP, always pair the 'p' option with 'h'\n");
+       fprintf(stdout,"                 \n");
 #endif /* USE_JPWL */
 /* <<UniPG */
        fprintf(stdout,"IMPORTANT:\n");
index 961afc2f609b3d27de18eba98689a9e7f81fd15d..87c5a9e3ca0c06cc6f2e460beac554d9cb2f5120 100644 (file)
@@ -61,8 +61,8 @@ LINK32=link.exe
 # PROP BASE Target_Dir ""\r
 # PROP Use_MFC 0\r
 # PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "JPWL_j2k_to_image___Win32_Debug"\r
-# PROP Intermediate_Dir "JPWL_j2k_to_image___Win32_Debug"\r
+# PROP Output_Dir "Debug"\r
+# PROP Intermediate_Dir "Debug"\r
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
index 72c5644d0924ebbd6aa3ef1ff22a4b98a7e8f6ec..0246100c802ed21abd02b0071cfd821b4abd9596 100644 (file)
@@ -377,7 +377,7 @@ void jpwl_prepare_marks(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image) {
                unsigned long sot_pos, post_sod_pos;\r
                unsigned long int left_THmarks_len, epbs_len = 0;\r
                int startpack = 0, stoppack = j2k->image_info->num;\r
-               jpwl_epb_ms_t *tph_epb;\r
+               jpwl_epb_ms_t *tph_epb = NULL;\r
 \r
                sot_pos = j2k->image_info->tile[tileno].start_pos;\r
                cio_seek(cio, sot_pos + 2); \r
@@ -555,10 +555,10 @@ void jpwl_prepare_marks(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image) {
                }\r
 \r
                /* we can now check if the TPH EPB was really the last one */\r
-               if (epb_index == 1) {\r
+               if (tph_epb && (epb_index == 1)) {\r
                        /* set the TPH EPB to be the last one in current header */\r
                        tph_epb->Depb |= (unsigned char) ((true & 0x0001) << 6);\r
-\r
+                       tph_epb = NULL;\r
                }\r
 \r
                /* write back Psot */\r
index 45bafcc0ed944c21e636cb56a4455b3b0c553de6..656ca7e5799e7f4a0ed4d61e982d63a80d3c5f6c 100644 (file)
@@ -1018,6 +1018,14 @@ bool jpwl_epb_correct(opj_j2k_t *j2k, unsigned char *buffer, int type, int pre_l
                        }
                }
 
+       } else if (Pepb == 0xFFFFFFFF) {
+               /* no method */
+
+               /* advance without doing anything */
+               remaining = L4;
+               while (remaining--)
+                       L4_buf++;
+
        } else if ((((Pepb & 0xF0000000) >> 28) == 2) || (((Pepb & 0xF0000000) >> 28) == 0)) {
                /* RS coding here */
 
@@ -1719,4 +1727,4 @@ bool jpwl_update_info(opj_j2k_t *j2k, jpwl_marker_t *jwmarker, int jwmarker_num)
        return true;
 }
 
-#endif /* USE_JPWL */
\ No newline at end of file
+#endif /* USE_JPWL */