public PictureHiBD toPictureHiBD() { PictureHiBD create = PictureHiBD.doCreate(width, height, color, lowBitsNum + 8, crop); return toPictureHiBDInternal(create); }
@Override public Picture decodeField(ByteBuffer data, byte[][] data2, int field, int step) { Picture res = super.decodeField(data, data2, field, step); return new Picture(res.getWidth() >> 2, res.getHeight() >> 2, res.getData(), null, res.getColor(), 0, new Rect( 0, 0, res.getCroppedWidth() >> 2, res.getCroppedHeight() >> 2)); } }
/** * Calculates the component size based on the fullt size and color subsampling of the given component index. * @param size * @return Component size */ public Size compSize(Size size, int comp) { if (compWidth[comp] == 0 && compHeight[comp] == 0) return size; return new Size(size.getWidth() >> compWidth[comp], size.getHeight() >> compHeight[comp]); } }
@Override public int estimateBufferSize(Picture frame) { int fullPlaneSize = frame.getWidth() * frame.getCroppedHeight(); ColorSpace color = frame.getColor(); int totalSize = 0; for (int i = 0; i < color.nComp; i++) { totalSize += (fullPlaneSize >> color.compWidth[i]) >> color.compHeight[i]; } return totalSize; }
public VideoStreamDescriptor() { this.frameRates = new Rational[] { null, new Rational(24000, 1001), new Rational(24, 1), new Rational(25, 1), new Rational(30000, 1001), new Rational(30, 1), new Rational(50, 1), new Rational(60000, 1001), new Rational(60, 1), null, null, null, null, null, null, null}; }
@Override public int estimateBufferSize(Picture frame) { return frame.getCroppedWidth() * frame.getCroppedHeight() * 4; } }
public EncodedMB() { pixels = Picture.create(16, 16, ColorSpace.YUV420J); nc = new int[16]; mx = new int[16]; my = new int[16]; }
public int compare(Packet o1, Packet o2) { if (o1 == null && o2 == null) return 0; else if (o1 == null) return -1; else if (o2 == null) return 1; else return o1.getDisplayOrder() > o2.getDisplayOrder() ? 1 : (o1.getDisplayOrder() == o2 .getDisplayOrder() ? 0 : -1); } });
public static TapeTimecode tapeTimecode(long frame, boolean dropFrame, int tapeFps) { if (dropFrame) { long D = frame / 17982; long M = frame % 17982; frame += 18 * D + 2 * ((M - 2) / 1798); } long sec = frame / tapeFps; return new TapeTimecode((short) (sec / 3600), (byte) ((sec / 60) % 60), (byte) (sec % 60), (byte) (frame % tapeFps), dropFrame, tapeFps); } }
public PictureHiBD toPictureHiBDWithBuffer(int[][] buffer) { PictureHiBD create = new PictureHiBD(width, height, buffer, color, lowBitsNum + 8, crop); return toPictureHiBDInternal(create); }
public static PictureHiBD createPictureWithDepth(int width, int height, int[][] data, ColorSpace color, int bitDepth) { return new PictureHiBD(width, height, data, color, bitDepth, new Rect(0, 0, width, height)); }
public void copyFromFrame(Frame src) { super.copyFrom(src); this.frameNo = src.frameNo; this.mvs = src.mvs; this.shortTerm = src.shortTerm; this.refsUsed = src.refsUsed; this.poc = src.poc; }
private ColorSpace(String name, int nComp, int[] compPlane, int[] compWidth, int[] compHeight, boolean planar) { this._name = name; this.nComp = nComp; this.compPlane = compPlane; this.compWidth = compWidth; this.compHeight = compHeight; this.planar = planar; calcBitsPerPixel(); }