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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? decoder.java

?? J2ME MPEG4 解碼代碼。 以及使用方法。
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
        mPastIntraAddress = -2; // See ISO-11172-2 page 36

        // Reset at start of each slice
        mForward.resetPrevious();
        mBackward.resetPrevious();

        /*
         * Macroblocks have an address which is the number of the macroblock 
         * in raster scan order. The top left macroblock in a picture has 
         * address 0, the next one to the right has address 1 and so on. 
         * If there are M macroblocks in a picture, then the bottom right 
         * macroblock has an address M-1.
         */
        mMacroblockAddress = (sliceVerticalPosition - 1) * mMacroblockWidth - 1;

        mQuantizerScale = mInput.getBits(5);

        int extraBitSlice = 0;
        while (mInput.nextBits(1) == 0x1) {
            extraBitSlice = mInput.getBits(1);
            int extraInformationSlice = mInput.getBits(8);
        }
        extraBitSlice = mInput.getBits(1);

        do {
            parseMacroblock();
        } while (mInput.nextBits(23) != 0x0);

        nextStartCode();
    }

    // Used for decoding motion vectors
	private int mMotionHorizontalForwardR;
	private int mMotionVerticalForwardR;

	private int mMotionHorizontalBackwardR;
	private int mMotionVerticalBackwardR;

    private Vlc.MacroblockType mMacroblockType = mVlc.new MacroblockType(); 

    /*
     * A macroblock has 4 luminance blocks and 2 chrominance blocks.
     * The order of blocks in a macroblock is top-left, top-right, 
     * bottom-left, bottom-right block for Y, followed by Cb and Cr.
     * A macroblock is the basic unit for motion compensation and 
     * quantizer scale changes.
     */
	private void parseMacroblock() throws IOException {
        // Discarded by decoder
        while (mInput.nextBits(11) == 0xf) {
            int macroblockStuffing = mInput.getBits(11);
        }

		int macroblockAddressIncrement = 0;

		while (mInput.nextBits(11) == 0x8) {
            int macroblockEscape = mInput.getBits(11);
            macroblockAddressIncrement += 33;
        }

        macroblockAddressIncrement += mVlc.getMacroblockAddressIncrement(mInput);

        // Process skipped macroblocks
		if (macroblockAddressIncrement > 1) {
			mDctDcYPast = mDctDcCrPast = mDctDcCbPast = 1024;

			/*
			 * In P-pictures, the skipped macroblock is defined to be 
			 * a macroblock with a reconstructed motion vector equal 
			 * to zero and no DCT coefficients.
			 */
			if (mPictureCodingType == Picture.P_TYPE) {
				mForward.resetPrevious();

				for (int i = 0; i < macroblockAddressIncrement; ++i) {
					int mbRow = (mMacroblockAddress + 1 + i) / mMacroblockWidth;
					int mbCol = (mMacroblockAddress + 1 + i) % mMacroblockWidth;

					mPictureStore[mCurrent].copy(mPictureStore[mPrevious], mbRow, mbCol);
				}
			}
			/*
			 * In B-pictures, the skipped macroblock is defined to have 
			 * the same macroblock_type (forward, backward, or both motion 
			 * vectors) as the prior macroblock, differential motion 
			 * vectors equal to zero, and no DCT coefficients.
			 */
			else if (mPictureCodingType == Picture.B_TYPE) {
				for (int i = 0; i < macroblockAddressIncrement; ++i) {
					int mbRow = (mMacroblockAddress + 1 + i) / mMacroblockWidth;
					int mbCol = (mMacroblockAddress + 1 + i) % mMacroblockWidth;

    				if (!mMacroblockType.mMacroblockMotionForward && mMacroblockType.mMacroblockMotionBackward)
				    	mPictureStore[mCurrent].compensate(mPictureStore[mFuture], mbRow, mbCol, mBackward);
    				else if (mMacroblockType.mMacroblockMotionForward && !mMacroblockType.mMacroblockMotionBackward)
				    	mPictureStore[mCurrent].compensate(mPictureStore[mPrevious], mbRow, mbCol, mForward);
    				else if (mMacroblockType.mMacroblockMotionForward && mMacroblockType.mMacroblockMotionBackward) {
    					mPictureStore[mCurrent].interpolate(mPictureStore[mPrevious], mPictureStore[mFuture], mbRow, mbCol, mForward, mBackward);
					}
				}
			}
		}

		mMacroblockAddress += macroblockAddressIncrement;

		mMacroblockRow = mMacroblockAddress / mMacroblockWidth;
		mMacroblockCol = mMacroblockAddress % mMacroblockWidth;

		/*
		 * For macroblocks in I pictures, and for intra coded macroblocks in 
		 * P and B pictures, the coded block pattern is not transmitted, but 
		 * is assumed to have a value of 63, i.e. all the blocks in the 
		 * macroblock are coded.
		 */
		int codedBlockPattern = 0x3f;

		mVlc.getMacroblockType(mPictureCodingType, mInput, mMacroblockType);

	    if (!mMacroblockType.mMacroblockIntra) {
	    	mDctDcYPast = mDctDcCrPast = mDctDcCbPast = 1024;
	    	codedBlockPattern = 0;
	    }

		if (mMacroblockType.mMacroblockQuant)
			mQuantizerScale = mInput.getBits(5);

		if (mMacroblockType.mMacroblockMotionForward) {
			int motionHorizontalForwardCode = mVlc.getMotionVector(mInput);
			if (mForwardF != 1 && motionHorizontalForwardCode != 0) {
				mMotionHorizontalForwardR = mInput.getBits(mForwardRSize);
			}

			int motionVerticalForwardCode = mVlc.getMotionVector(mInput);
			if (mForwardF != 1 && motionVerticalForwardCode != 0) {
				mMotionVerticalForwardR = mInput.getBits(mForwardRSize);
			}

			mForward.calculate(motionHorizontalForwardCode, mMotionHorizontalForwardR, motionVerticalForwardCode, mMotionVerticalForwardR);
		}

		if (mMacroblockType.mMacroblockMotionBackward) {
			int motionHorizontalBackwardCode = mVlc.getMotionVector(mInput);
			if (mBackwardF != 1 && motionHorizontalBackwardCode != 0) {
				mMotionHorizontalBackwardR = mInput.getBits(mBackwardRSize);
			}

			int motionVerticalBackwardCode = mVlc.getMotionVector(mInput);
			if (mBackwardF != 1 && motionVerticalBackwardCode != 0) {
				mMotionVerticalBackwardR = mInput.getBits(mBackwardRSize);
			}

			mBackward.calculate(motionHorizontalBackwardCode, mMotionHorizontalBackwardR, motionVerticalBackwardCode, mMotionVerticalBackwardR);
		}

		if (mPictureCodingType == Picture.P_TYPE) {	// See 2.4.4.2
			if (mMacroblockType.mMacroblockMotionForward) {
				mPictureStore[mCurrent].compensate(mPictureStore[mPrevious], mMacroblockRow, mMacroblockCol, mForward);
			}
			else {
				mPictureStore[mCurrent].copy(mPictureStore[mPrevious], mMacroblockRow, mMacroblockCol);
			}
		}
		else if (mPictureCodingType == Picture.B_TYPE) {	// See 2.4.4.3
			if (mMacroblockType.mMacroblockMotionForward && !mMacroblockType.mMacroblockMotionBackward) {
				mPictureStore[mCurrent].compensate(mPictureStore[mPrevious], mMacroblockRow, mMacroblockCol, mForward);
			}
			else if(!mMacroblockType.mMacroblockMotionForward && mMacroblockType.mMacroblockMotionBackward) {
				mPictureStore[mCurrent].compensate(mPictureStore[mFuture], mMacroblockRow, mMacroblockCol, mBackward);
			}
			else if (mMacroblockType.mMacroblockMotionForward && mMacroblockType.mMacroblockMotionBackward) {
				mPictureStore[mCurrent].interpolate(mPictureStore[mPrevious], mPictureStore[mFuture], mMacroblockRow, mMacroblockCol, mForward, mBackward);
			}
		}

		if (mPictureCodingType == Picture.P_TYPE && !mMacroblockType.mMacroblockMotionForward)
			mForward.resetPrevious();

		if (mPictureCodingType == Picture.B_TYPE && mMacroblockType.mMacroblockIntra) {
			mForward.resetPrevious();
			mBackward.resetPrevious();
		}

		if (mMacroblockType.mMacroblockPattern)
			codedBlockPattern = mVlc.getCodedBlockPattern(mInput);

		/*
		 * The Coded Block Pattern informs the decoder which of the six blocks 
		 * in the macroblock are coded, i.e. have transmitted DCT quantized 
		 * coefficients, and which are not coded, i.e. have no additional 
		 * correction after motion compensation
		 */
		for (int i = 0; i < 6; i++)	{
			if ((codedBlockPattern & (1 << (5 - i))) != 0) {
				parseBlock(i);

				if (mMacroblockType.mMacroblockIntra) {
				 	if (i < 4) mPictureStore[mCurrent].setLumBlock(mDctRecon, mMacroblockRow, mMacroblockCol, i);
					else	   mPictureStore[mCurrent].setColBlock(mDctRecon, mMacroblockRow, mMacroblockCol, i);
				}
				else {
					if (i < 4) mPictureStore[mCurrent].correctLumBlock(mDctRecon, mMacroblockRow, mMacroblockCol, i);
					else       mPictureStore[mCurrent].correctColBlock(mDctRecon, mMacroblockRow, mMacroblockCol, i);
				}
			}
		}

		if (mPictureCodingType == Picture.D_TYPE)
			mInput.getBits(1);
	}

    private int[] mNullMatrix = new int[64];
    private int[] mDctRecon   = new int[64];
    private int[] mDctZigzag  = new int[64];

    /*
     * A block is an orthogonal 8-pel by 8-line section of a 
     * luminance or chrominance component.
     */
	private void parseBlock(int index) throws IOException {
		Vlc.RunLevel runLevel = mVlc.new RunLevel();

        System.arraycopy(mNullMatrix, 0, mDctRecon, 0, 64);
        System.arraycopy(mNullMatrix, 0, mDctZigzag, 0, 64);

        int run = 0;

		if (mMacroblockType.mMacroblockIntra) {
            if (index < 4) {
                int dctDCSizeLuminance = mVlc.decodeDCTDCSizeLuminance(mInput);
                int dctDCDifferential = 0;

                if (dctDCSizeLuminance != 0) {
                    dctDCDifferential = mInput.getBits(dctDCSizeLuminance);

                    if ((dctDCDifferential & (1 << (dctDCSizeLuminance - 1))) != 0)
                        mDctZigzag[0] = dctDCDifferential;
                    else
                        mDctZigzag[0] = ((-1 << dctDCSizeLuminance) | (dctDCDifferential + 1));
                }
            }
            else {
                int dctDCSizeChrominance = mVlc.decodeDCTDCSizeChrominance(mInput);
                int dctDCDifferential = 0;

                if (dctDCSizeChrominance != 0) {
                    dctDCDifferential = mInput.getBits(dctDCSizeChrominance);

                    if ((dctDCDifferential & (1 << (dctDCSizeChrominance - 1))) != 0)
                        mDctZigzag[0] = dctDCDifferential;
                    else
                        mDctZigzag[0] = ((-1 << dctDCSizeChrominance) | (dctDCDifferential + 1));
                }
            }
        }
        else {
            // dctCoeffFirst
            mVlc.decodeDCTCoeff(mInput, true, runLevel);

		    run = runLevel.run;
	    	mDctZigzag[run] = runLevel.level;
        }

        if (mPictureCodingType != Picture.D_TYPE) {
            while (mInput.nextBits(2) != 0x2) {
                // dctCoeffNext
            	mVlc.decodeDCTCoeff(mInput, false, runLevel);

                run += runLevel.run + 1;
                mDctZigzag[run] = runLevel.level;
            }
            int endOfBlock = mInput.getBits(2); // Should be == 0x2 (EOB)

            if (mMacroblockType.mMacroblockIntra) {
                if (index == 0)
                    firstLuminanceBlock(mDctRecon);
                else if (index >= 1 && index <= 3)
                    nextLuminanceBlock(mDctRecon);
                else if (index == 4)
                    cbBlock(mDctRecon);
                else if (index == 5)
                    crBlock(mDctRecon);

                mPastIntraAddress = mMacroblockAddress;
            }
            else {
            	// See ISO/IEC 11172 2.4.4.2 / 2.4.4.3
            	for (int i = 0; i < 64; ++i) {
                    int idx = ScanMatrix[i];
                    mDctRecon[i] = ((2 * mDctZigzag[idx] + sign(mDctZigzag[idx])) * mQuantizerScale * NonIntraQuantizerMatrix[i]) >> 4;

                    if ((mDctRecon[i] & 1) == 0) {
                        mDctRecon[i] -= sign(mDctRecon[i]);
                        if (mDctRecon[i] > 2047) mDctRecon[i] = 2047;
                        if (mDctRecon[i] < -2048) mDctRecon[i] = -2048;

                        if (mDctZigzag[idx] == 0)
                            mDctRecon[i] = 0;
                    }
                }
            }

            mIdct.calculate(mDctRecon);
        }
	}

	
	/*
	 * Helper function
	 */
	private int sign(int n) {
		return n > 0? 1 : (n < 0? -1 : 0);
	}

	/*
	 * Reconstruct DCT coefficients, as defined in ISO/IEC 11172 2.4.4.1
	 */
	private void firstLuminanceBlock(int[] dct_recon) throws IOException {
		for (int i = 0; i < 64; ++i) {
			int index = ScanMatrix[i];
			dct_recon[i] = (mDctZigzag[index] * mQuantizerScale * IntraQuantizerMatrix[i]) >> 3;

			if ((dct_recon[i] & 1) == 0) {
				dct_recon[i] -= sign(dct_recon[i]);
				if (dct_recon[i] > 2047) dct_recon[i] = 2047;
				if (dct_recon[i] < -2048) dct_recon[i] = -2048;
			}
		}

		dct_recon[0] = mDctZigzag[0] << 3;

		if (mMacroblockAddress - mPastIntraAddress > 1)
			dct_recon[0] += 1024;
		else
			dct_recon[0] += mDctDcYPast;

		mDctDcYPast = dct_recon[0];
	}

	private void nextLuminanceBlock(int[] dct_recon) throws IOException {
		for (int i = 0; i < 64; ++i) {
			int index = ScanMatrix[i];
			dct_recon[i] = (mDctZigzag[index] * mQuantizerScale * IntraQuantizerMatrix[i]) >> 3;

			if ((dct_recon[i] & 1) == 0) {
				dct_recon[i] -= sign(dct_recon[i]);
				if (dct_recon[i] > 2047) dct_recon[i] = 2047;
				if (dct_recon[i] < -2048) dct_recon[i] = -2048;
			}
		}

		dct_recon[0] = mDctDcYPast + (mDctZigzag[0] << 3);

		mDctDcYPast = dct_recon[0];
	}

	private void cbBlock(int[] dct_recon) throws IOException {
		for (int i = 0; i < 64; ++i) {
			int index = ScanMatrix[i];
			dct_recon[i] = (mDctZigzag[index] * mQuantizerScale * IntraQuantizerMatrix[i]) >> 3;

			if ((dct_recon[i] & 1) == 0) {
				dct_recon[i] -= sign(dct_recon[i]);
				if (dct_recon[i] > 2047) dct_recon[i] = 2047;
				if (dct_recon[i] < -2048) dct_recon[i] = -2048;
			}
		}

		dct_recon[0] = mDctZigzag[0] << 3;

		if (mMacroblockAddress - mPastIntraAddress > 1)
			dct_recon[0] += 1024;
		else
			dct_recon[0] += mDctDcCbPast;

		mDctDcCbPast = dct_recon[0];
	}

	private void crBlock(int[] dct_recon) throws IOException {
		for (int i = 0; i < 64; ++i) {
			int index = ScanMatrix[i];
			dct_recon[i] = (mDctZigzag[index] * mQuantizerScale * IntraQuantizerMatrix[i]) >> 3;

			if ((dct_recon[i] & 1) == 0) {
				dct_recon[i] -= sign(dct_recon[i]);
				if (dct_recon[i] > 2047) dct_recon[i] = 2047;
				if (dct_recon[i] < -2048) dct_recon[i] = -2048;
			}
		}

		dct_recon[0] = mDctZigzag[0] << 3;

		if (mMacroblockAddress - mPastIntraAddress > 1)
			dct_recon[0] += 1024;
		else
			dct_recon[0] += mDctDcCrPast;

		mDctDcCrPast = dct_recon[0];
	}
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
9久草视频在线视频精品| 亚洲bt欧美bt精品777| 欧美精品久久99久久在免费线 | 91老司机福利 在线| 国产成人在线色| 国产精品中文字幕日韩精品| 国产真实乱对白精彩久久| 国产一区二区三区四| 国产精品一品视频| youjizz久久| 色哟哟一区二区在线观看| 日本国产一区二区| 在线精品视频免费观看| 欧美日韩亚洲综合一区二区三区| 另类专区欧美蜜桃臀第一页| 亚洲免费看黄网站| 欧美性猛交xxxx乱大交退制版| 97se亚洲国产综合在线| 波波电影院一区二区三区| 成人动漫精品一区二区| 日本三级亚洲精品| 午夜精品久久久久久久久久| 国产精品久久久久久久蜜臀| 1024国产精品| 亚洲电影中文字幕在线观看| 日本最新不卡在线| 风间由美一区二区三区在线观看 | 亚洲男同性视频| 亚洲国产精品久久不卡毛片| 日韩电影免费一区| 国产精品18久久久久久久久久久久 | 日韩一区二区三区视频| 欧美精品一区二区三区蜜桃视频| 欧美国产日韩精品免费观看| 亚洲人成网站在线| 日韩精品国产欧美| 国产精品白丝av| 欧美系列日韩一区| 精品日产卡一卡二卡麻豆| 国产精品色在线| 午夜激情一区二区| 国产91清纯白嫩初高中在线观看 | 欧美国产禁国产网站cc| 亚洲激情自拍视频| 美女脱光内衣内裤视频久久网站| 国产精品白丝av| 欧美亚洲高清一区二区三区不卡| 日韩一卡二卡三卡四卡| 成人免费小视频| 精品一区二区精品| 91黄色激情网站| 精品国产露脸精彩对白| 亚洲综合在线第一页| 韩国欧美国产一区| 欧美色爱综合网| 国产精品美女久久久久久久网站| 日本亚洲欧美天堂免费| 99re这里只有精品首页| 精品人在线二区三区| 亚洲四区在线观看| 国产一区二区调教| 欧美精品少妇一区二区三区| 中文字幕五月欧美| 激情综合色综合久久综合| 欧美性受xxxx黑人xyx性爽| 久久精品人人做人人综合| 日韩精品91亚洲二区在线观看| 国产成人夜色高潮福利影视| 91精品在线观看入口| 日韩一区在线看| 国产专区欧美精品| 欧美一区二区三区在线观看 | 一区二区三区**美女毛片| 国产电影精品久久禁18| 日韩美女视频在线| 丝袜美腿亚洲色图| 91久久精品国产91性色tv| 欧美国产1区2区| 国产资源在线一区| 欧美一区二区精美| 亚洲一区二区三区中文字幕在线| 国产91精品免费| 亚洲精品在线电影| 久久99精品久久久久久动态图| 欧美揉bbbbb揉bbbbb| 自拍偷拍国产亚洲| www.日韩在线| 国产精品伦一区| 国产剧情一区二区三区| 日韩欧美不卡在线观看视频| 日韩在线一区二区| 欧美日韩免费视频| 亚洲国产成人91porn| 欧美体内she精高潮| 一区二区三区四区蜜桃 | 国产日韩欧美精品一区| 久久精品国产999大香线蕉| 日韩一区二区免费在线观看| 男男成人高潮片免费网站| 欧美精品在线一区二区| 首页综合国产亚洲丝袜| 91精品国产综合久久小美女| 亚洲成人高清在线| 337p亚洲精品色噜噜狠狠| 午夜婷婷国产麻豆精品| 欧美日韩精品一区二区在线播放| 亚洲精品高清视频在线观看| 欧洲人成人精品| 亚洲成人精品一区二区| 欧美精品vⅰdeose4hd| 日本午夜精品一区二区三区电影| 91精品国产aⅴ一区二区| 美女久久久精品| 久久精品人人做人人综合 | 这里只有精品免费| 免费不卡在线观看| 2020国产精品自拍| 国产成人在线免费观看| 中文一区二区完整视频在线观看| 99久久精品国产毛片| 依依成人精品视频| 欧美一级黄色片| 国产伦精品一区二区三区视频青涩| 国产欧美中文在线| 91一区二区在线| 亚洲bdsm女犯bdsm网站| 精品理论电影在线观看 | 日韩欧美激情一区| 国产精品一区二区三区乱码| 国产精品久久毛片av大全日韩| 色老汉一区二区三区| 日韩av一区二区三区四区| 精品国产一区a| 99久久综合国产精品| 亚洲综合在线观看视频| 日韩一区二区视频| 成人美女视频在线观看| 亚洲精选视频免费看| 欧美一级黄色录像| 成人一区二区三区视频| 夜色激情一区二区| xf在线a精品一区二区视频网站| 成人av午夜电影| 午夜精品一区二区三区免费视频 | 日韩欧美不卡在线观看视频| 成人午夜大片免费观看| 亚洲成人久久影院| 欧美韩国日本一区| 欧美日韩精品一区二区三区| 国产一区欧美日韩| 洋洋av久久久久久久一区| 久久亚洲影视婷婷| 欧美伊人久久久久久久久影院| 精品一区二区三区在线视频| 亚洲欧洲综合另类在线| 欧美一级片免费看| 91麻豆国产在线观看| 久久成人久久鬼色| 一区二区三区四区不卡在线| 精品国精品自拍自在线| 欧美综合久久久| 成人短视频下载 | 欧美电影精品一区二区| 一本一本大道香蕉久在线精品| 精品夜夜嗨av一区二区三区| 亚洲综合在线电影| 国产精品嫩草影院av蜜臀| 91麻豆精品国产| 在线观看日韩精品| 成人免费观看av| 免费精品99久久国产综合精品| 亚洲色图.com| 久久久亚洲精品一区二区三区| 欧美日韩综合色| av在线不卡免费看| 国产盗摄一区二区三区| 免费国产亚洲视频| 亚洲一二三四久久| 中文字幕亚洲视频| 久久精品欧美一区二区三区不卡| 欧美图区在线视频| 一本一本久久a久久精品综合麻豆| 久久99久久久久| 午夜不卡av在线| 一区二区三区四区精品在线视频| 亚洲国产精品国自产拍av| 日韩精品一区二区三区四区视频| 欧美日韩中文另类| 色综合天天综合| 丁香激情综合国产| 极品销魂美女一区二区三区| 日韩影院免费视频| 亚洲国产中文字幕在线视频综合| 亚洲日本青草视频在线怡红院| 日本一区二区免费在线观看视频| 精品国精品自拍自在线| 欧美成人三级电影在线| 日韩免费看的电影| 欧美大片拔萝卜| 精品福利一二区|