亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? headerencoder.java

?? jpeg2000算法實現
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/* * CVS identifier: * * $Id: HeaderEncoder.java,v 1.35 2001/03/02 10:10:30 grosbois Exp $ * * Class:                   HeaderEncoder * * Description:             Write codestream headers. * * * * COPYRIGHT: *  * This software module was originally developed by Rapha雔 Grosbois and * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel * Askel鰂 (Ericsson Radio Systems AB); and Bertrand Berthelot, David * Bouchard, F閘ix Henry, Gerard Mozelle and Patrice Onno (Canon Research * Centre France S.A) in the course of development of the JPEG2000 * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This * software module is an implementation of a part of the JPEG 2000 * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio * Systems AB and Canon Research Centre France S.A (collectively JJ2000 * Partners) agree not to assert against ISO/IEC and users of the JPEG * 2000 Standard (Users) any of their rights under the copyright, not * including other intellectual property rights, for this software module * with respect to the usage by ISO/IEC and Users of this software module * or modifications thereof for use in hardware or software products * claiming conformance to the JPEG 2000 Standard. Those intending to use * this software module in hardware or software products are advised that * their use may infringe existing patents. The original developers of * this software module, JJ2000 Partners and ISO/IEC assume no liability * for use of this software module or modifications thereof. No license * or right to this software module is granted for non JPEG 2000 Standard * conforming products. JJ2000 Partners have full right to use this * software module for his/her own purpose, assign or donate this * software module to any third party and to inhibit third parties from * using this software module for non JPEG 2000 Standard conforming * products. This copyright notice must be included in all copies or * derivative works of this software module. *  * Copyright (c) 1999/2000 JJ2000 Partners. * */package jj2000.j2k.codestream.writer;import jj2000.j2k.quantization.quantizer.*;import jj2000.j2k.wavelet.analysis.*;import jj2000.j2k.entropy.encoder.*;import jj2000.j2k.quantization.*;import jj2000.j2k.image.input.*;import jj2000.j2k.roi.encoder.*;import jj2000.j2k.codestream.*;import jj2000.j2k.wavelet.*;import jj2000.j2k.encoder.*;import jj2000.j2k.entropy.*;import jj2000.j2k.image.*;import jj2000.j2k.util.*;import jj2000.j2k.io.*;import jj2000.j2k.*;import java.util.*;import java.io.*;/** * This class writes almost of the markers and marker segments in main header * and in tile-part headers. It is created by the run() method of the Encoder * instance. *  * <p>A marker segment includes a marker and eventually marker segment * parameters. It is designed by the three letter code of the marker * associated with the marker segment. JPEG 2000 part I defines 6 types of * markers: <ul> <li> Delimiting : SOC,SOT,SOD,EOC (written in * FileCodestreamWriter).</li> <li> Fixed information: SIZ.</li> <li> * Functional: COD,COC,RGN,QCD,QCC,POC.</li> <li> In bit-stream: SOP,EPH.</li> * <li> Pointer: TLM,PLM,PLT,PPM,PPT.</li> <li> Informational: * CRG,COM.</li></ul> * * <p>Main Header is written when Encoder instance calls encodeMainHeader * whereas tile-part headers are written when the EBCOTRateAllocator instance * calls encodeTilePartHeader. * * @see Encoder * @see Markers * @see EBCOTRateAllocator * */public class HeaderEncoder implements Markers, StdEntropyCoderOptions {    /** Nominal range bit of the component defining default values in QCD for     * main header */    private int defimgn;    /** Nominal range bit of the component defining default values in QCD for     * tile headers */    private int deftilenr;        /** The number of components in the image */    protected int nComp;    /** The ByteArrayOutputStream to store header data. This handler     * is kept in order to use methods not accessible from a general     * DataOutputStream. For the other methods, it's better to use     * variable hbuf.     *     * @see #hbuf */    protected ByteArrayOutputStream baos;        /** The DataOutputStream to store header data. This kind of object      * is useful to write short, int, .... It's constructor takes     * baos as parameter.     *     * @see #baos     **/    protected DataOutputStream hbuf;    /** The image data reader. Source of original data info */    protected ImgData origSrc;    /** An array specifying, for each component,if the data was signed        or not */    protected boolean isOrigSig[];    /** Reference to the rate allocator */    protected PostCompRateAllocator ralloc;    /** Reference to the DWT module */    protected ForwardWT dwt;    /** Reference to the tiler module */    protected Tiler tiler;    /** Reference to the ROI module */    protected ROIScaler roiSc;    /** The encoder specifications */    protected EncoderSpecs encSpec;    /**     * Initializes the header writer with the references to the coding chain.     *     * @param origsrc The original image data (before any component mixing,     * tiling, etc.)     *     * @param isorigsig An array specifying for each component if it was     * originally signed or not.     *     * @param dwt The discrete wavelet transform module.     *     * @param tiler The tiler module.     *     * @param encSpec The encoder specifications     *     * @param roiSc The ROI scaler module.     *     * @param ralloc The post compression rate allocator.     * */    public HeaderEncoder(ImgData origsrc, boolean isorigsig[],                         ForwardWT dwt, Tiler tiler,EncoderSpecs encSpec, 			 ROIScaler roiSc, PostCompRateAllocator ralloc) {        if (origsrc.getNumComps() != isorigsig.length) {            throw new IllegalArgumentException();        }        this.origSrc   = origsrc;        this.isOrigSig = isorigsig;        this.dwt       = dwt;        this.tiler     = tiler;        this.encSpec   = encSpec;        this.roiSc     = roiSc;        this.ralloc    = ralloc;                baos = new ByteArrayOutputStream();        hbuf = new DataOutputStream(baos);        nComp = origsrc.getNumComps();    }    /**     * Resets the contents of this HeaderEncoder to its initial state. It     * erases all the data in the header buffer and reactualizes the     * headerLength field of the bit stream writer.     * */    public void reset() {        baos.reset();        hbuf = new DataOutputStream(baos);    }    /**      * Returns the byte-buffer used to store the codestream header.     *     * @return A byte array countaining codestream header     * */    protected byte[] getBuffer(){        return baos.toByteArray();    }    /**     * Returns the length of the header.     *     * @return The length of the header in bytes     * */    public int getLength() {        return hbuf.size();    }    /**     * Writes the header to the specified BinaryDataOutput.     *     * @param out Where to write the header.     * */    public void writeTo(BinaryDataOutput out) throws IOException {        int i,len;        byte buf[];        buf = getBuffer();        len = getLength();        for (i=0; i<len; i++) {            out.writeByte(buf[i]);        }    }    /**     * Returns the number of bytes used in the codestream header's     * buffer.     *     * @return Header length in buffer (without any header     * overhead)     * */    protected int getBufferLength(){        return baos.size();    }    /**     * Writes the header to the specified OutputStream.     *     * @param out Where to write the header.     * */    public void writeTo(OutputStream out) throws IOException {        out.write(getBuffer(),0,getBufferLength());    }    /**     * Start Of Codestream marker (SOC) signalling the beginning of a     * codestream.      * */    private void writeSOC() throws IOException {        hbuf.writeShort(SOC);    }    /**     * Writes SIZ marker segment of the codestream header. It is a fixed     * information marker segment containing informations about image and tile     * sizes. It is required in the main header immediately after SOC marker     * segment.     * */    private void writeSIZ() throws IOException {        int tmp;        // SIZ marker        hbuf.writeShort(SIZ);                // Lsiz (Marker length) corresponding to        // Lsiz(2 bytes)+Rsiz(2)+Xsiz(4)+Ysiz(4)+XOsiz(4)+YOsiz(4)+	// XTsiz(4)+YTsiz(4)+XTOsiz(4)+YTOsiz(4)+Csiz(2)+        // (Ssiz(1)+XRsiz(1)+YRsiz(1))*nComp        // markSegLen = 38 + 3*nComp;        int markSegLen = 38 + 3*nComp;        hbuf.writeShort(markSegLen);                // Rsiz (codestream capabilities)	hbuf.writeShort(0); // JPEG 2000 - Part I                // Xsiz (original image width)        hbuf.writeInt(tiler.getImgWidth()+tiler.getImgULX());                // Ysiz (original image height)        hbuf.writeInt(tiler.getImgHeight()+tiler.getImgULY());        	// XOsiz (horizontal offset from the origin of the reference	// grid to the left side of the image area)	hbuf.writeInt(tiler.getImgULX());	// YOsiz (vertical offset from the origin of the reference	// grid to the top side of the image area)	hbuf.writeInt(tiler.getImgULY());        // XTsiz (nominal tile width)        hbuf.writeInt(tiler.getNomTileWidth());                    // YTsiz (nominal tile height)        hbuf.writeInt(tiler.getNomTileHeight());        Coord torig = tiler.getTilingOrigin(null);	// XTOsiz (Horizontal offset from the origin of the reference	// grid to the left side of the first tile)	hbuf.writeInt(torig.x);	// YTOsiz (Vertical offset from the origin of the reference	// grid to the top side of the first tile)	hbuf.writeInt(torig.y);        // Csiz (number of components)        hbuf.writeShort(nComp);                        // Bit-depth and downsampling factors.        for(int c=0; c<nComp; c++){ // Loop on each component                        // Ssiz bit-depth before mixing            tmp = origSrc.getNomRangeBits(c)-1;                        tmp |= ( (isOrigSig[c]?1:0)<<SSIZ_DEPTH_BITS );            hbuf.write(tmp);                        // XRsiz (component sub-sampling value x-wise)            hbuf.write(tiler.getCompSubsX(c));                        // YRsiz (component sub-sampling value y-wise)            hbuf.write(tiler.getCompSubsY(c));                    } // End loop on each component            }    /**     * Writes COD marker segment. COD is a functional marker segment     * containing the code style default (coding style, decomposition,     * layering) used for compressing all the components in an image.     *     * <p>The values can be overriden for an individual component by a COC     * marker in either the main or the tile header.     *     * @param mh Flag indicating whether this marker belongs to the main     * header     *     * @param tileIdx Tile index if the marker belongs to a tile-part header     *      * @see #writeCOC     * */    protected void writeCOD(boolean mh, int tileIdx) 	throws IOException {	AnWTFilter[][] filt;        boolean precinctPartitionUsed;        int tmp;        int mrl=0,a=0;        int ppx=0, ppy=0;	Progression[] prog;                if (mh) {	    mrl = ((Integer)encSpec.dls.getDefault()).intValue();            // get default precinct size             ppx = encSpec.pss.getPPX(-1,-1,mrl);            ppy = encSpec.pss.getPPY(-1,-1,mrl);	    prog = (Progression[])(encSpec.ps.getDefault());        }        else {	    mrl = ((Integer)encSpec.dls.getTileDef(tileIdx)).intValue();            // get precinct size for specified tile            ppx = encSpec.pss.getPPX(tileIdx,-1,mrl);            ppy = encSpec.pss.getPPY(tileIdx,-1,mrl);	    prog = (Progression[])(encSpec.ps.getTileDef(tileIdx));        }        if ( ppx != PRECINCT_PARTITION_DEF_SIZE ||             ppy != PRECINCT_PARTITION_DEF_SIZE ) {            precinctPartitionUsed = true;        }        else {            precinctPartitionUsed = false;        }                if ( precinctPartitionUsed ) {	    // If precinct partition is used we add one byte per resolution	    // level i.e. mrl+1 (+1 for resolution 0).            a = mrl+1;        }                  // Write COD marker	hbuf.writeShort(COD);                // Lcod (marker segment length (in bytes)) Basic : Lcod(2        // bytes)+Scod(1)+SGcod(4)+SPcod(5+a)  where:        // a=0 if no precinct partition is used	// a=mrl+1 if precinct partition used        int markSegLen = 12+a;        hbuf.writeShort(markSegLen);                // Scod (coding style parameter)	tmp=0;        if ( precinctPartitionUsed )             tmp=SCOX_PRECINCT_PARTITION;        // Are SOP markers used ?	if (mh) {            if( ((String)encSpec.sops.getDefault().toString())                 .equalsIgnoreCase("on") ) {                tmp |= SCOX_USE_SOP;            }        }        else {            if ( ((String)encSpec.sops.getTileDef(tileIdx).toString())                 .equalsIgnoreCase("on") ) {                tmp |= SCOX_USE_SOP;            }        }                // Are EPH markers used ?        if(mh){            if ( ((String)encSpec.ephs.getDefault().toString())                 .equalsIgnoreCase("on") ) {                tmp |= SCOX_USE_EPH;            }        }        else{            if ( ((String)encSpec.ephs.getTileDef(tileIdx).toString())                 .equalsIgnoreCase("on") ) {                tmp |= SCOX_USE_EPH;            }        }	hbuf.write(tmp);                // SGcod        // Progression order        hbuf.write(prog[0].type);                // Number of layers        hbuf.writeShort(ralloc.getNumLayers());                // Multiple component transform        // CSsiz (Color transform)        String str = null;        if(mh)            str = (String)encSpec.cts.getDefault();        else            str = (String)encSpec.cts.getTileDef(tileIdx);        if(str.equals("none"))            hbuf.write(0);        else            hbuf.write(1);        // SPcod        // Number of decomposition levels        hbuf.write(mrl);                // Code-block width and height        if ( mh ) {            // main header, get default values            tmp = encSpec.cblks.                getCBlkWidth(ModuleSpec.SPEC_DEF,-1,-1);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩成人av影视| 国产三级欧美三级日产三级99| 中文字幕日韩一区二区| 波多野结衣亚洲一区| 日韩美女视频一区二区| 欧美日韩一卡二卡三卡| 精品亚洲免费视频| 国产欧美va欧美不卡在线| aaa亚洲精品| 亚洲线精品一区二区三区| 欧美久久久一区| 麻豆免费精品视频| 久久亚洲二区三区| 高清成人免费视频| 国产精品白丝在线| 色欧美88888久久久久久影院| 亚洲欧美日韩国产一区二区三区| 色综合久久久久综合体桃花网| 亚洲欧美激情一区二区| 欧美亚洲图片小说| 美国十次了思思久久精品导航| 日韩精品一区二区三区三区免费| 国产九色sp调教91| 国产精品麻豆一区二区| 国产精品一区二区久久不卡| 国产欧美日产一区| 91久久精品一区二区| 日韩av成人高清| 国产欧美日韩另类一区| aaa欧美日韩| 午夜精品福利一区二区三区av | 亚洲精品在线网站| 成人免费毛片片v| 亚洲成av人影院| 久久综合色婷婷| 成人免费视频国产在线观看| 亚洲国产精品激情在线观看| 99久久久精品免费观看国产蜜| 国产精品的网站| 欧美日韩精品福利| 一区二区三区蜜桃网| 欧美一区二区精品在线| 成人看片黄a免费看在线| 亚洲一区二区成人在线观看| 精品国产一区二区三区四区四| 91在线观看一区二区| 五月婷婷激情综合网| 国产欧美日韩在线观看| 欧美三级中文字幕在线观看| 蜜臀av一区二区在线免费观看| 久久精品视频一区二区| 在线亚洲免费视频| 成人毛片老司机大片| 美女视频一区二区三区| 一区二区三区日韩精品视频| 欧美精品一区二区三| 欧美日韩精品福利| 99热精品一区二区| 国内精品视频一区二区三区八戒| 亚洲综合无码一区二区| 中文字幕欧美三区| 欧美一区二区三区在线电影| 色伊人久久综合中文字幕| 国产精品18久久久久久vr| 亚洲成va人在线观看| 综合久久久久综合| 久久综合色一综合色88| 在线电影一区二区三区| 91亚洲精品一区二区乱码| 国产精品一卡二卡在线观看| 日韩av一二三| 亚洲大型综合色站| 亚洲视频一二三| 国产精品成人一区二区艾草 | av电影在线观看完整版一区二区| 韩国av一区二区| 日本不卡视频一二三区| 一区二区久久久久| 国产精品久久久久久户外露出| 26uuu久久天堂性欧美| 日韩一区二区精品葵司在线| 欧美天堂亚洲电影院在线播放| 成人亚洲一区二区一| 国产夫妻精品视频| 天天综合天天综合色| 一个色在线综合| 亚洲婷婷综合色高清在线| 久久这里只有精品视频网| 欧美军同video69gay| 成人激情电影免费在线观看| 久久国产精品无码网站| 香蕉成人啪国产精品视频综合网| 亚洲欧美偷拍另类a∨色屁股| 国产精品美女久久福利网站| 2022国产精品视频| 精品少妇一区二区三区在线播放| 色婷婷久久久久swag精品| 色婷婷av一区二区三区大白胸| 在线精品亚洲一区二区不卡| 欧美午夜寂寞影院| 91精品国产欧美一区二区成人| 日韩免费一区二区| 欧美精品一区二区三区久久久 | 国产精品乱人伦| 亚洲婷婷在线视频| 亚洲精品免费看| 亚洲国产另类av| 奇米777欧美一区二区| 精品夜夜嗨av一区二区三区| 国产成人三级在线观看| eeuss鲁片一区二区三区| 色综合天天做天天爱| 欧美性色欧美a在线播放| 91国产福利在线| 欧美一区二区在线播放| 国产午夜精品一区二区三区视频 | 成人综合在线视频| 色欧美日韩亚洲| 欧美老年两性高潮| 精品va天堂亚洲国产| 国产精品久久久久久妇女6080| 一区二区欧美视频| 韩国午夜理伦三级不卡影院| 成人免费视频播放| 欧美女孩性生活视频| 久久品道一品道久久精品| 国产精品第13页| 日本午夜精品视频在线观看 | 婷婷中文字幕综合| 国产精品18久久久久久久久 | 午夜欧美电影在线观看| 五月婷婷激情综合网| 国产成人av一区二区三区在线| 色综合久久久久网| xf在线a精品一区二区视频网站| 亚洲欧洲无码一区二区三区| 午夜精品aaa| 成人va在线观看| 日韩一卡二卡三卡四卡| 亚洲黄色免费电影| 天堂资源在线中文精品| 国产盗摄一区二区三区| 欧美精品在线一区二区| 中文字幕一区二区三区色视频 | 最新国产成人在线观看| 免费观看成人鲁鲁鲁鲁鲁视频| 色婷婷综合久久久久中文| 91精品国产综合久久福利软件| 久久夜色精品国产噜噜av| 亚洲欧洲性图库| 国产一区二区伦理| 欧美三级电影在线看| 中国av一区二区三区| 麻豆精品在线播放| 欧美剧情片在线观看| 亚洲精品写真福利| 成人av资源在线观看| 欧美成人艳星乳罩| 亚洲成人中文在线| www.在线欧美| 国产女主播视频一区二区| 精品一区二区综合| 91精品国产欧美一区二区| 夜夜精品浪潮av一区二区三区| 粉嫩av一区二区三区在线播放| 欧美一级黄色录像| 首页亚洲欧美制服丝腿| 欧美亚洲国产怡红院影院| 国产精品剧情在线亚洲| 国产成人在线看| 精品国产乱子伦一区| 免费观看在线色综合| 337p亚洲精品色噜噜噜| 天涯成人国产亚洲精品一区av| 99国产精品久久久久久久久久久| 亚洲欧洲另类国产综合| 福利一区福利二区| 国产三级精品三级| 国产老肥熟一区二区三区| 久久综合一区二区| 国产精品99久久久久久有的能看 | 99久久99久久免费精品蜜臀| 国产精品免费av| 91一区二区三区在线观看| 亚洲视频网在线直播| 一本大道久久精品懂色aⅴ| 椎名由奈av一区二区三区| 色综合天天性综合| 亚洲一二三区在线观看| 欧美精品久久一区二区三区| 一区二区在线免费观看| 8x8x8国产精品| 精品中文av资源站在线观看| 久久久久国产精品人| 波多野结衣在线一区| 亚洲另类在线制服丝袜| 欧美日韩第一区日日骚| 老司机免费视频一区二区| 久久综合色鬼综合色| 国产99久久久国产精品免费看|