本文整理汇总了Java中org.jcodec.common.model.ColorSpace.YUV420J属性的典型用法代码示例。如果您正苦于以下问题:Java ColorSpace.YUV420J属性的具体用法?Java ColorSpace.YUV420J怎么用?Java ColorSpace.YUV420J使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jcodec.common.model.ColorSpace
的用法示例。
在下文中一共展示了ColorSpace.YUV420J属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decodeScan
private Picture decodeScan(ByteBuffer data, FrameHeader header, ScanHeader scan, VLC[] huffTables, int[][] quant,
int[][] data2, int field, int step) {
int blockW = header.getHmax();
int blockH = header.getVmax();
int mcuW = blockW << 3;
int mcuH = blockH << 3;
int width = header.width;
int height = header.height;
int xBlocks = (width + mcuW - 1) >> (blockW + 2);
int yBlocks = (height + mcuH - 1) >> (blockH + 2);
int nn = blockW + blockH;
Picture result = new Picture(xBlocks << (blockW + 2), yBlocks << (blockH + 2), data2,
nn == 4 ? ColorSpace.YUV420J : (nn == 3 ? ColorSpace.YUV422J : ColorSpace.YUV444J), new Rect(0, 0,
width, height));
BitReader bits = new BitReader(data);
int[] dcPredictor = new int[] { 1024, 1024, 1024 };
for (int by = 0; by < yBlocks; by++)
for (int bx = 0; bx < xBlocks && bits.moreData(); bx++)
decodeMCU(bits, dcPredictor, quant, huffTables, result, bx, by, blockW, blockH, field, step);
return result;
}
示例2: getSupportedColorSpaces
@Override
public ColorSpace[] getSupportedColorSpaces() {
return new ColorSpace[] { ColorSpace.YUV420J };
}