fh.qMatChroma, fh.scan, 0, fh.chromaType); return new Picture[] { Picture.createPicture(codedWidth, codedHeight, target[0], ColorSpace.YUV422) }; } else { lumaSize >>= 1; Picture.createPicture(codedWidth, codedHeight >> 1, target[0], ColorSpace.YUV422), Picture.createPicture(codedWidth, codedHeight >> 1, target[1], ColorSpace.YUV422) };
Picture pic = Picture.createPicture(context.codedWidth, context.codedHeight, buf, context.color); if ((ph.picture_coding_type == MPEGConst.IntraCoded || ph.picture_coding_type == MPEGConst.PredictiveCoded)
public Picture decode(byte[] data) { ByteBuffer littleEndian = (ByteBuffer) ByteBuffer.wrap(data).order(LITTLE_ENDIAN); IntBuffer dat = littleEndian.asIntBuffer(); ByteBuffer y = ByteBuffer.wrap(new byte[width * height]); ByteBuffer cb = ByteBuffer.wrap(new byte[width * height / 2]); ByteBuffer cr = ByteBuffer.wrap(new byte[width * height / 2]); while (dat.hasRemaining()) { int i = dat.get(); cr.put(to8Bit(i >> 20)); y.put(to8Bit((i >> 10) & 0x3ff)); cb.put(to8Bit(i & 0x3ff)); i = dat.get(); y.put(to8Bit(i & 0x3ff)); y.put(to8Bit(i >> 20)); cb.put(to8Bit((i >> 10) & 0x3ff)); i = dat.get(); cb.put(to8Bit(i >> 20)); y.put(to8Bit((i >> 10) & 0x3ff)); cr.put(to8Bit(i & 0x3ff)); i = dat.get(); y.put(to8Bit(i & 0x3ff)); y.put(to8Bit(i >> 20)); cr.put(to8Bit((i >> 10) & 0x3ff)); } return Picture.createPicture(width, height, new byte[][] { y.array(), cb.array(), cr.array() }, YUV422); }
@Override public Picture decodeFrame(ByteBuffer data, byte[][] buffer) { Picture create = Picture.createPicture(width, height, buffer, ColorSpace.YUV420); ByteBuffer pix = data.duplicate(); copy(pix, create.getPlaneData(0), width * height); copy(pix, create.getPlaneData(1), width * height / 4); copy(pix, create.getPlaneData(2), width * height / 4); return create; }
throw new IllegalStateException("no IHDR tag"); return Picture.createPicture(ihdr.width, ihdr.height, buffer, ihdr.colorSpace());
public Picture decodeFrame(ByteBuffer data, byte[][] data2) { if (interlace) { Picture r1 = decodeField(data, data2, topFieldFirst ? 0 : 1, 2); Picture r2 = decodeField(data, data2, topFieldFirst ? 1 : 0, 2); return Picture.createPicture(r1.getWidth(), r1.getHeight() << 1, data2, r1.getColor()); } else { return decodeField(data, data2, 0, 1); } }
dataTemp[1] = pic.getPlaneData(2); dataTemp[2] = pic.getPlaneData(1); final Picture tmpBuf = Picture.createPicture(pixelWidth, pixelHeight, dataTemp, ColorSpace.YUV420J); transform.transform(tmpBuf, rgb); AWTUtil.toBufferedImage(rgb, bufferedImage);
dataTemp[1] = pic.getPlaneData(2); dataTemp[2] = pic.getPlaneData(1); final Picture tmpBuf = Picture.createPicture(pixelWidth, pixelHeight, dataTemp, ColorSpace.YUV420J); transform.transform(tmpBuf, rgb); AWTUtil.toBufferedImage(rgb, renderImage);
Picture p = Picture.createPicture(width, height, buffer, ColorSpace.YUV420);