Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 110627 Details for
Bug 127026
Requesting a Second Life client ebuild (secondlife)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
openjpeg/files/OPJ_limit_tags_for_decode.patch
OPJ_limit_tags_for_decode.patch (text/plain), 6.82 KB, created by
MATSUU Takuto (RETIRED)
on 2007-02-19 14:03:29 UTC
(
hide
)
Description:
openjpeg/files/OPJ_limit_tags_for_decode.patch
Filename:
MIME Type:
Creator:
MATSUU Takuto (RETIRED)
Created:
2007-02-19 14:03:29 UTC
Size:
6.82 KB
patch
obsolete
>Index: libopenjpeg/openjpeg.h >=================================================================== >--- libopenjpeg/openjpeg.h (revision 338) >+++ libopenjpeg/openjpeg.h (working copy) >@@ -311,6 +311,41 @@ > > } opj_cparameters_t; > >+/** Stop after tags. */ >+typedef enum LIMIT_TAGS { >+ OPJ_TAG_SOC = 0x000001, /**< start of codestream */ >+ OPJ_TAG_SOT = 0x000002, /**< start of tile-part*/ >+ OPJ_TAG_SOD = 0x000004, /**< start of data */ >+ OPJ_TAG_EOC = 0x000008, /**< end of codestream */ >+ OPJ_TAG_SIZ = 0x000010, /**< image and tile size */ >+ OPJ_TAG_COD = 0x000020, /**< coding style default */ >+ OPJ_TAG_COC = 0x000040, /**< coding style component */ >+ OPJ_TAG_RGN = 0x000080, /**< region-of-interest */ >+ OPJ_TAG_QCD = 0x000100, /**< quantization default */ >+ OPJ_TAG_QCC = 0x000200, /**< quantization component */ >+ OPJ_TAG_POC = 0x000400, /**< progression order change */ >+ OPJ_TAG_TLM = 0x000800, /**< tile-part lengths */ >+ OPJ_TAG_PLM = 0x001000, /**< packet length, main header */ >+ OPJ_TAG_PLT = 0x002000, /**< packet length, tile-part header */ >+ OPJ_TAG_PPM = 0x004000, /**< packet packet headers, main header */ >+ OPJ_TAG_PPT = 0x008000, /**< packet packet headers, tile-part header */ >+ OPJ_TAG_SOP = 0x010000, /**< SOP marker value */ >+ OPJ_TAG_EPH = 0x020000, /**< EPH marker value */ >+ OPJ_TAG_CRG = 0x040000, /**< component registration */ >+ OPJ_TAG_COM = 0x080000, /**< comment */ >+#ifdef USE_JPWL >+/* UniPG>> */ >+ OPJ_TAG_EPC = 0x100000, /**< EPC marker value (Part11) */ >+ OPJ_TAG_EPB = 0x200000, /**< EPB marker value (Part11) */ >+ OPJ_TAG_ESD = 0x400000, /**< ESD marker value (Part11) */ >+ OPJ_TAG_RED = 0x800000, /**< RED marker value (Part11) */ >+#endif /* USE_JPWL */ >+/* <<UniPG */ >+} OPJ_LIMIT_TAGS; >+ >+/** The needed tags to decode just the size of the image. */ >+#define OPJ_LIMIT_FOR_SIZE (OPJ_LIMIT_TAGS)(OPJ_TAG_SOC | OPJ_TAG_SIZ ) >+ > /** > Decompression parameters > */ >@@ -330,6 +365,15 @@ > if == 0 or not used, all the quality layers are decoded > */ > int cp_layer; >+ /** >+ Limits the tags that are decoded. >+ This is a bitwise OR of the tags to be decoded. If a tag is >+ encountered that isn't in the list decoding ceases and the function >+ returns. >+ if != 0 only the given tags are decoded. >+ if == 0 all tags are decoded. >+ */ >+ OPJ_LIMIT_TAGS cp_limit_tags; > > /**@name command line encoder parameters (not used inside the library) */ > /*@{*/ >Index: libopenjpeg/j2k.c >=================================================================== >--- libopenjpeg/j2k.c (revision 338) >+++ libopenjpeg/j2k.c (working copy) >@@ -1342,37 +1342,39 @@ > int states; > /** action linked to the marker */ > void (*handler) (opj_j2k_t *j2k); >+ /** The enum value used to limit decode to specific tags. */ >+ OPJ_LIMIT_TAGS limit_tag; > } opj_dec_mstabent_t; > > opj_dec_mstabent_t j2k_dec_mstab[] = { >- {J2K_MS_SOC, J2K_STATE_MHSOC, j2k_read_soc}, >- {J2K_MS_SOT, J2K_STATE_MH | J2K_STATE_TPHSOT, j2k_read_sot}, >- {J2K_MS_SOD, J2K_STATE_TPH, j2k_read_sod}, >- {J2K_MS_EOC, J2K_STATE_TPHSOT, j2k_read_eoc}, >- {J2K_MS_SIZ, J2K_STATE_MHSIZ, j2k_read_siz}, >- {J2K_MS_COD, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_cod}, >- {J2K_MS_COC, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_coc}, >- {J2K_MS_RGN, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_rgn}, >- {J2K_MS_QCD, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_qcd}, >- {J2K_MS_QCC, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_qcc}, >- {J2K_MS_POC, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_poc}, >- {J2K_MS_TLM, J2K_STATE_MH, j2k_read_tlm}, >- {J2K_MS_PLM, J2K_STATE_MH, j2k_read_plm}, >- {J2K_MS_PLT, J2K_STATE_TPH, j2k_read_plt}, >- {J2K_MS_PPM, J2K_STATE_MH, j2k_read_ppm}, >- {J2K_MS_PPT, J2K_STATE_TPH, j2k_read_ppt}, >- {J2K_MS_SOP, 0, 0}, >- {J2K_MS_CRG, J2K_STATE_MH, j2k_read_crg}, >- {J2K_MS_COM, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_com}, >+ {J2K_MS_SOC, J2K_STATE_MHSOC, j2k_read_soc, OPJ_TAG_SOC}, >+ {J2K_MS_SOT, J2K_STATE_MH | J2K_STATE_TPHSOT, j2k_read_sot, OPJ_TAG_SOT}, >+ {J2K_MS_SOD, J2K_STATE_TPH, j2k_read_sod, OPJ_TAG_SOD}, >+ {J2K_MS_EOC, J2K_STATE_TPHSOT, j2k_read_eoc, OPJ_TAG_EOC}, >+ {J2K_MS_SIZ, J2K_STATE_MHSIZ, j2k_read_siz, OPJ_TAG_SIZ}, >+ {J2K_MS_COD, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_cod, OPJ_TAG_COD}, >+ {J2K_MS_COC, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_coc, OPJ_TAG_COC}, >+ {J2K_MS_RGN, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_rgn, OPJ_TAG_RGN}, >+ {J2K_MS_QCD, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_qcd, OPJ_TAG_QCD}, >+ {J2K_MS_QCC, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_qcc, OPJ_TAG_QCC}, >+ {J2K_MS_POC, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_poc, OPJ_TAG_POC}, >+ {J2K_MS_TLM, J2K_STATE_MH, j2k_read_tlm, OPJ_TAG_TLM}, >+ {J2K_MS_PLM, J2K_STATE_MH, j2k_read_plm, OPJ_TAG_PLM}, >+ {J2K_MS_PLT, J2K_STATE_TPH, j2k_read_plt, OPJ_TAG_PLT}, >+ {J2K_MS_PPM, J2K_STATE_MH, j2k_read_ppm, OPJ_TAG_PPM}, >+ {J2K_MS_PPT, J2K_STATE_TPH, j2k_read_ppt, OPJ_TAG_PPT}, >+ {J2K_MS_SOP, 0, 0, OPJ_TAG_SOP}, >+ {J2K_MS_CRG, J2K_STATE_MH, j2k_read_crg, OPJ_TAG_CRG}, >+ {J2K_MS_COM, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_com, OPJ_TAG_COM}, > /* UniPG>> */ > #ifdef USE_JPWL >- {J2K_MS_EPC, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_epc}, >- {J2K_MS_EPB, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_epb}, >- {J2K_MS_ESD, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_esd}, >- {J2K_MS_RED, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_red}, >+ {J2K_MS_EPC, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_epc, OPJ_TAG_EPC}, >+ {J2K_MS_EPB, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_epb, OPJ_TAG_EPB}, >+ {J2K_MS_ESD, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_esd, OPJ_TAG_ESD}, >+ {J2K_MS_RED, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_red, OPJ_TAG_RED}, > #endif /* USE_JPWL */ > /* <<UniPG */ >- {0, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_unk} >+ {0, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_unk, -1} > }; > > static void j2k_read_unk(opj_j2k_t *j2k) { >@@ -1522,6 +1524,7 @@ > opj_cp_t *cp = (opj_cp_t*)opj_malloc(sizeof(opj_cp_t)); > cp->reduce = parameters->cp_reduce; > cp->layer = parameters->cp_layer; >+ cp->limit_tags = parameters->cp_limit_tags; > /* UniPG>> */ > #ifdef USE_JPWL > cp->correct = parameters->jpwl_correct; >@@ -1599,6 +1602,12 @@ > opj_event_msg(cinfo, EVT_ERROR, "%.8x: unexpected marker %x\n", cio_tell(cio) - 2, id); > return 0; > } >+ /* If a partial decode is requested, stop if the current tag >+ * isn't in the list. >+ */ >+ if (j2k->cp->limit_tags && !(j2k->cp->limit_tags & e->limit_tag)) { >+ return image; >+ } > if (e->handler) { > (*e->handler)(j2k); > } >Index: libopenjpeg/j2k.h >=================================================================== >--- libopenjpeg/j2k.h (revision 338) >+++ libopenjpeg/j2k.h (working copy) >@@ -197,6 +197,8 @@ > int reduce; > /** if != 0, then only the first "layer" layers are decoded; if == 0 or not used, all the quality layers are decoded */ > int layer; >+ /** if != 0, then only decode specific tags, abort on any other; if == 0 decode all tags */ >+ OPJ_LIMIT_TAGS limit_tags; > /** 0 = no index || 1 = index */ > int index_on; > /** XTOsiz */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 127026
:
87669
|
90814
|
90819
|
92739
|
101806
|
106217
|
106219
|
106221
|
106223
|
106225
|
106253
|
106259
|
106263
|
106265
|
106350
|
106352
|
106354
|
106554
|
106556
|
106558
|
106833
|
106834
|
106839
|
106898
|
106900
|
107290
|
107515
|
107540
|
107542
|
107550
|
107566
|
107598
|
107599
|
107600
|
107601
|
107603
|
108183
|
108224
|
110626
| 110627 |
110629
|
110630
|
110634
|
110636
|
110647
|
110648
|
110649
|
110651
|
110652
|
110654
|
110655
|
110656
|
110696
|
110698
|
111517
|
111519
|
111521
|
113643
|
113644
|
113664
|
113666
|
113668
|
113670
|
135152
|
142612
|
151751
|
151753
|
151755
|
152403
|
152405
|
152481
|
152485
|
152487
|
152745
|
152747
|
152749
|
156521