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

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

?? filecodestreamwriter.java

?? jpeg2000編解碼
?? JAVA
字號:
/* * CVS identifier: * * $Id: FileCodestreamWriter.java,v 1.1.1.1 2002/07/22 09:26:47 grosbois Exp $ * * Class:                   FileCodestreamWriter * * Description:             Implementation of the bit stream writer for streams. * * * * 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.codestream.*;import java.io.*;/** * This class implements a CodestreamWriter for Java streams. The streams can * be files or network connections, or any other resource that presents itself * as a OutputStream. See the CodestreamWriter abstract class for more details * on the implementation of the CodestreamWriter abstract class. * * <p>Before any packet data is written to the bit stream (even in simulation * mode) the complete header should be written otherwise incorrect estimates * are given by getMaxAvailableBytes() for rate allocation. * * @see CodestreamWriter * */public class FileCodestreamWriter extends CodestreamWriter     implements Markers {    /** The upper limit for the value of the Nsop field of the SOP marker */    private final static int SOP_MARKER_LIMIT = 65535;    /** Index of the current tile */    private int tileIdx = 0;    /** The file to write */    private OutputStream out;    /** The number of bytes already written to the codestream, excluding the     * header length, magic number and header length info. */    int ndata=0;    /** The default buffer length, 1024 bytes */    public static int DEF_BUF_LEN = 1024;        /** Array used to store the SOP markers values */    byte sopMarker[];    /** Array used to store the EPH markers values */    byte ephMarker[];        /** The packet index (when start of packet markers i.e. SOP markers) are     *  used. */    int packetIdx=0;        /** Offset of end of last packet containing ROI information */    private int offLastROIPkt = 0;    /** Length of last packets containing no ROI information */    private int lenLastNoROI = 0;    /**     * Opens the file 'file' for writing the codestream. The magic number is     * written to the bit stream. Normally, the header encoder must be empty     * (i.e. no data has been written to it yet). A BufferedOutputStream is     * used on top of the file to increase throughput, the length of the     * buffer is DEF_BUF_LEN.     *     * @param file The file where to write the bit stream     *     * @param mb The maximum number of bytes that can be written to the bit     * stream.     *     * @exception IOException If an error occurs while trying to open the file     * for writing or while writing the magic number.     * */    public FileCodestreamWriter(File file, int mb) throws IOException {        super(mb);        out = new BufferedOutputStream(new FileOutputStream(file),DEF_BUF_LEN);        initSOP_EPHArrays();    }    /**     * Opens the file named 'fname' for writing the bit stream, using the 'he'     * header encoder. The magic number is written to the bit     * stream. Normally, the header encoder must be empty (i.e. no data has     * been written to it yet). A BufferedOutputStream is used on top of the     * file to increase throughput, the length of the buffer is DEF_BUF_LEN.     *     * @param fname The name of file where to write the bit stream     *     * @param mb The maximum number of bytes that can be written to the bit     * stream.     *     * @param encSpec The encoder's specifications     *     * @exception IOException If an error occurs while trying to open the file     * for writing or while writing the magic number.     * */    public FileCodestreamWriter(String fname, int mb) throws IOException {        super(mb);        out = new BufferedOutputStream(new FileOutputStream(fname),                                       DEF_BUF_LEN);        initSOP_EPHArrays();    }    /**     * Uses the output stream 'os' for writing the bit stream, using the 'he'     * header encoder. The magic number is written to the bit     * stream. Normally, the header encoder must be empty (i.e. no data has     * been written to it yet). No BufferedOutputStream is used on top of the     * output stream 'os'.     *     * @param os The output stream where to write the bit stream.     *     * @param mb The maximum number of bytes that can be written to the bit     * stream.     *     * @exception IOException If an error occurs while writing the magic     * number to the 'os' output stream.     * */    public FileCodestreamWriter(OutputStream os, int mb) throws IOException {        super(mb);        out = os;        initSOP_EPHArrays();    }    /**     * Returns the number of bytes remaining available in the bit stream. This     * is the maximum allowed number of bytes minus the number of bytes that     * have already been written to the bit stream. If more bytes have been     * written to the bit stream than the maximum number of allowed bytes,     * then a negative value is returned.     *     * @return The number of bytes remaining available in the bit stream.     * */    public final int getMaxAvailableBytes() {        return maxBytes-ndata;    }    /**     * Returns the current length of the entire bit stream.     *     * @return the current length of the bit stream     * */    public int getLength() {        if (getMaxAvailableBytes() >= 0) {            return ndata;        }        else {            return maxBytes;        }    }    /**     * Writes a packet head to the bit stream and returns the number of bytes     * used by this header. It returns the total number of bytes that the     * packet head takes in the bit stream. If in simulation mode then no data     * is written to the bit stream but the number of bytes is     * calculated. This can be used for iterative rate allocation.     *     * <P>If the length of the data that is to be written to the bit stream is     * more than the space left (as returned by getMaxAvailableBytes()) only     * the data that does not exceed the allowed length is written, the rest     * is discarded. However the value returned by the method is the total     * length of the packet, as if all of it was written to the bit stream.     *     * <P>If the bit stream header has not been commited yet and 'sim' is     * false, then the bit stream header is automatically commited (see     * commitBitstreamHeader() method) before writting the packet.     *     * @param head The packet head data.     *     * @param hlen The number of bytes in the packet head.     *     * @param sim Simulation mode flag. If true nothing is written to the bit     * stream, but the number of bytes that would be written is returned.     *     * @param sop Start of packet header marker flag. This flag indicates     * whether or not SOP markers should be written. If true, SOP markers     * should be written, if false, they should not.     *     * @param eph End of Packet Header marker flag. This flag indicates     * whether or not EPH markers should be written. If true, EPH markers     * should be written, if false, they should not.     *     * @return The number of bytes spent by the packet head.     *     * @exception IOException If an I/O error occurs while writing to the     * output stream.     *     * @see #commitBitstreamHeader     * */     public int writePacketHead(byte head[],int hlen,boolean sim, 			       boolean sop, boolean eph) throws IOException{        int len = hlen	    + (sop?Markers.SOP_LENGTH:0) 	    + (eph?Markers.EPH_LENGTH:0);                // If not in simulation mode write the data         if(!sim){ 	    // Write the head bytes 	    if(getMaxAvailableBytes()<len){		len = getMaxAvailableBytes(); 	    }             if(len > 0){                 // Write Start Of Packet header markers if necessary                 if(sop){                     // The first 4 bytes of the array have been filled in the                     // classe's constructor.                     sopMarker[4] = (byte)(packetIdx>>8);                     sopMarker[5] = (byte)(packetIdx);                     out.write(sopMarker, 0, Markers.SOP_LENGTH);                     packetIdx++;                     if(packetIdx>SOP_MARKER_LIMIT){                         // Reset SOP value as we have reached its upper limit                         packetIdx = 0;                     }                 }                 out.write(head,0,hlen); 		// Update data length 		ndata += len;                 // Write End of Packet Header markers if necessary                 if(eph){                     out.write(ephMarker,0,Markers.EPH_LENGTH);                }                 // Deal with ROI Information                lenLastNoROI += len;            }         }        return len;     }    /**     * Writes a packet body to the bit stream and returns the number of bytes     * used by this body .If in simulation mode then no data is written to the     * bit stream but the number of bytes is calculated. This can be used for     * iterative rate allocation.     *     * <P>If the length of the data that is to be written to the bit stream is     * more than the space left (as returned by getMaxAvailableBytes()) only     * the data that does not exceed the allowed length is written, the rest     * is discarded. However the value returned by the method is the total     * length of the packet body , as if all of it was written to the bit     * stream.     *     * @param body The packet body data.     *     * @param blen The number of bytes in the packet body.     *     * @param sim Simulation mode flag. If true nothing is written to the bit     * stream, but the number of bytes that would be written is returned.     *     * @param roiInPkt Whether or not this packet contains ROI information     *     * @param roiLen Number of byte to read in packet body to get all the ROI     * information      *     * @return The number of bytes spent by the packet body.     *     * @exception IOException If an I/O error occurs while writing to the     * output stream.     *     * @see #commitBitstreamHeader     * */     public int writePacketBody(byte body[],int blen,boolean sim,                               boolean roiInPkt, int roiLen)         throws IOException{         int len = blen;         // If not in simulation mode write the data         if (!sim) {             // Write the body bytes             len = blen;             if(getMaxAvailableBytes() < len){                len = getMaxAvailableBytes();             }             if(blen > 0){                out.write(body,0,len);             }             // Update data length             ndata += len;             // Deal with ROI information            if(roiInPkt) {                offLastROIPkt += lenLastNoROI + roiLen;                lenLastNoROI = len-roiLen;            } else {                lenLastNoROI += len;            }        }        return len;     }    /**     * Writes the EOC marker and closes the underlying stream.     *     * @exception IOException If an error occurs while closing the underlying     * stream.     * */    public void close() throws IOException {	// Write the EOC marker and close the codestream.        out.write(EOC>>8);        out.write(EOC);                ndata += 2; // Add two to length of codestream for EOC marker                out.close();    }    /**      * Gives the offset of the end of last packet containing ROI information      *     * @return End of last ROI packet      * */    public int getOffLastROIPkt(){        return offLastROIPkt;    }    /**     * Writes the header data in the codestream and actualize ndata with the     * header length. The header is either a MainHeaderEncoder or a     * TileHeaderEncoder.     *     * @param he The current header encoder.     *     * @exception IOException If an I/O error occurs while writing the data.     * */    public void commitBitstreamHeader(HeaderEncoder he) throws IOException {        // Actualize ndata        ndata += he.getLength();        he.writeTo(out);         // Write the header        // Reset packet index used for SOP markers        packetIdx = 0;        // Deal with ROI information        lenLastNoROI += he.getLength();    }    /**     * Performs the initialisation of the arrays that are used to store the     * values used to write SOP and EPH markers     * */    private void initSOP_EPHArrays() {                // Allocate and set first values of SOP marker as they will not be        // modified        sopMarker = new byte[Markers.SOP_LENGTH];        sopMarker[0] = (byte)(Markers.SOP>>8);        sopMarker[1] = (byte)Markers.SOP;        sopMarker[2] = (byte)0x00;        sopMarker[3] = (byte)0x04;        // Allocate and set values of EPH marker as they will not be        // modified        ephMarker = new byte[Markers.EPH_LENGTH];        ephMarker[0] = (byte)(Markers.EPH>>8);        ephMarker[1] = (byte)Markers.EPH;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲日本在线天堂| 国产精品区一区二区三区| 国产1区2区3区精品美女| 视频一区国产视频| 亚洲一区二三区| 亚洲精品视频在线看| 亚洲欧美日韩精品久久久久| 欧美国产精品一区二区三区| 久久久一区二区| 欧美精品一区二| 久久久久久夜精品精品免费| 久久精品视频一区二区| 久久久.com| 欧美激情在线看| 国产精品二区一区二区aⅴ污介绍| 中文字幕精品一区二区精品绿巨人| 久久久久国产成人精品亚洲午夜| 久久久综合精品| 国产精品萝li| 夜夜精品浪潮av一区二区三区| 一区二区日韩电影| 日韩国产精品久久| 国产精品一区一区三区| 成人午夜免费视频| 欧美天堂一区二区三区| 欧美一区二区三区在线看 | 精品国产三级电影在线观看| 精品乱码亚洲一区二区不卡| 国产精品视频免费| 亚洲综合一区在线| 精品一区二区三区香蕉蜜桃| 国产高清一区日本| 欧美综合久久久| 久久综合九色欧美综合狠狠| 一色屋精品亚洲香蕉网站| 香蕉久久夜色精品国产使用方法| 蜜臀av性久久久久蜜臀aⅴ| 国产一区二区免费视频| 色综合久久久网| 欧美tickle裸体挠脚心vk| 国产精品你懂的| 日韩精品电影在线观看| 国产传媒日韩欧美成人| 欧美色区777第一页| 久久精品视频一区二区三区| 亚洲午夜av在线| 成人免费视频网站在线观看| 欧美另类videos死尸| 国产精品成人网| 九九热在线视频观看这里只有精品| 99re在线精品| 久久亚洲春色中文字幕久久久| 亚洲狠狠丁香婷婷综合久久久| 国产自产高清不卡| 欧美色手机在线观看| 国产精品毛片a∨一区二区三区| 日韩国产成人精品| 91福利视频网站| 国产精品全国免费观看高清 | 亚洲午夜激情网站| 成人免费电影视频| 久久天天做天天爱综合色| 亚洲va在线va天堂| 91豆麻精品91久久久久久| 欧美国产丝袜视频| 国产久卡久卡久卡久卡视频精品| 欧美高清www午色夜在线视频| 国产精品毛片大码女人| 国产夫妻精品视频| 精品福利在线导航| 蜜臀91精品一区二区三区| 欧美午夜不卡在线观看免费| 亚洲精品国产一区二区精华液 | 国产一区在线观看视频| 4hu四虎永久在线影院成人| 一区二区三区在线影院| 色综合久久久久综合体| 亚洲男人的天堂在线观看| 91网站最新地址| 中文字幕一区免费在线观看| 波波电影院一区二区三区| 国产欧美精品一区二区色综合| 麻豆国产91在线播放| 欧美不卡123| 国产一区在线观看麻豆| 国产欧美一区二区精品秋霞影院 | 日本一区二区三区dvd视频在线| 久久99精品国产麻豆婷婷| 精品久久久久久久人人人人传媒 | 成人动漫视频在线| 中文字幕不卡一区| 99久久久免费精品国产一区二区| 亚洲欧洲无码一区二区三区| 色偷偷88欧美精品久久久| 一区二区日韩电影| 日韩欧美成人一区| 国产精品原创巨作av| 国产精品久久久一区麻豆最新章节| 成人精品鲁一区一区二区| 亚洲免费三区一区二区| 欧美日本一区二区| 国精品**一区二区三区在线蜜桃| 国产日韩欧美不卡| 在线欧美日韩精品| 久久国产麻豆精品| 国产精品全国免费观看高清| 91精品福利视频| 狂野欧美性猛交blacked| 久久久精品国产免大香伊| 一本一本久久a久久精品综合麻豆| 亚洲一区二区三区激情| 精品国产免费一区二区三区四区| 成人午夜在线视频| 日韩专区欧美专区| 国产精品久久久一本精品| 欧美精品v日韩精品v韩国精品v| 国产精品一区三区| 五月婷婷色综合| 中文字幕一区二区三区四区 | 日韩欧美一区二区在线视频| 国产精品66部| 亚洲丶国产丶欧美一区二区三区| 久久综合久久99| 欧美年轻男男videosbes| 国产成人免费9x9x人网站视频| 亚洲一二三专区| 国产精品天天看| 日韩精品一区二区三区四区| 欧美综合天天夜夜久久| 成人亚洲一区二区一| 久久国产精品一区二区| 亚洲第一福利一区| 亚洲色欲色欲www| 久久免费看少妇高潮| 欧美肥大bbwbbw高潮| 91麻豆国产福利在线观看| 国产一区二区三区精品欧美日韩一区二区三区 | 91麻豆精品国产无毒不卡在线观看| 国产夫妻精品视频| 久久精品国产免费| 亚洲第一主播视频| 一区二区三区电影在线播| 亚洲国产精品二十页| 久久综合成人精品亚洲另类欧美 | 日韩影视精彩在线| 一区二区三区久久| 亚洲人成网站在线| 日本一二三不卡| 久久精品一区八戒影视| 欧美xxxxxxxx| 欧美大黄免费观看| 欧美一区二区三区色| 在线91免费看| 91麻豆精品国产91久久久更新时间| 欧洲视频一区二区| 欧美在线观看视频一区二区三区| 91免费看片在线观看| 色呦呦网站一区| 91福利国产成人精品照片| 在线精品视频一区二区三四| 欧美午夜理伦三级在线观看| 欧美性色综合网| 欧美日韩精品是欧美日韩精品| 欧美日韩在线直播| 67194成人在线观看| 日韩精品一区二区三区在线| 2023国产精华国产精品| 日韩美女天天操| 国产日产欧美一区二区视频| 中文成人av在线| 亚洲色图另类专区| 亚洲国产综合91精品麻豆| 视频一区中文字幕国产| 久久99精品一区二区三区三区| 狠狠色2019综合网| 成人小视频在线| 91久久精品一区二区三区| 欧美日韩精品欧美日韩精品一综合| 3d成人h动漫网站入口| 久久亚洲捆绑美女| 日韩一区中文字幕| 午夜在线成人av| 91网站在线播放| 欧美猛男gaygay网站| 精品理论电影在线| 国产精品国产自产拍高清av| 一区二区免费在线播放| 日韩福利视频网| 国产精品一区二区黑丝| 欧美中文字幕一区二区三区| 日韩欧美国产综合一区| 国产精品美女一区二区| 亚洲成人一区二区在线观看| 国内精品嫩模私拍在线| 日本高清不卡一区| 日韩欧美不卡在线观看视频| 国产精品久久久久久亚洲毛片| 亚洲成av人片一区二区| 国产91精品一区二区麻豆网站 | 丝袜美腿亚洲综合|