public void performIDRMarking(RefPicMarkingIDR refPicMarkingIDR, Frame picture) { clearAll(); pictureBuffer.clear(); Frame saved = saveRef(picture); if (refPicMarkingIDR.isUseForlongTerm()) { lRefs.put(0, saved); saved.setShortTerm(false); } else sRefs[firstSliceHeader.frame_num] = saved; }
private void saveLong(Frame saved, int longNo) { Frame prev = lRefs.get(longNo); if (prev != null) releaseRef(prev); saved.setShortTerm(false); lRefs.put(longNo, saved); }
public Picture decodeFrame(List<ByteBuffer> data, int[][] buffer) { Frame frame = new FrameDecoder().decodeFrame(data, getSameSizeBuffer(buffer)); return frame == null ? null : frame.toPicture(8, buffer); }
@Override public Picture decodeFrame(ByteBuffer data, int[][] buffer) { Frame frame = new FrameDecoder().decodeFrame(H264Utils.splitFrame(data), getSameSizeBuffer(buffer)); return frame == null ? null : frame.toPicture(8, buffer); }
private Frame saveRef(Frame decoded) { Frame frame = pictureBuffer.size() > 0 ? pictureBuffer.remove(0) : Frame.createFrame(decoded); frame.copyFrom(decoded); return frame; }