public BaseAnalyser() { this.pts = new IntArrayList(250000); this.dur = new IntArrayList(250000); }
private static int[][] readReorderingEntries(BitReader _in) { IntArrayList ops = IntArrayList.createIntArrayList(); IntArrayList args = IntArrayList.createIntArrayList(); do { int idc = readUEtrace(_in, "SH: reordering_of_pic_nums_idc"); if (idc == 3) break; ops.add(idc); args.add(readUEtrace(_in, "SH: abs_diff_pic_num_minus1")); } while (true); return new int[][] { ops.toArray(), args.toArray() }; } }
private void _invert() { IntArrayList values = IntArrayList.createIntArrayList(); IntArrayList valueSizes = IntArrayList.createIntArrayList(); invert(0, 0, 0, values, valueSizes); this.values = values.toArray(); this.valueSizes = valueSizes.toArray(); }
private void cacheSamples(SampleToChunkEntry[] sampleToChunks, long[] chunkOffsets) throws IOException { synchronized (input) { int stscInd = 0; IntArrayList ss = new IntArrayList(); for (int chunkNo = 0; chunkNo < chunkOffsets.length; chunkNo++) { int nSamples = sampleToChunks[stscInd].getCount(); if (stscInd < sampleToChunks.length - 1 && chunkNo + 1 >= sampleToChunks[stscInd + 1].getFirst()) stscInd++; long offset = chunkOffsets[chunkNo]; input.position(offset); ByteBuffer buf = NIOUtils.fetchFrom(input, nSamples * 4); for (int i = 0; i < nSamples; i++) { ss.add(buf.getInt()); } } sampleCache = ss.toArray(); } }
public VLC getVLC() { final VLCBuilder self = this; return new VLC(codes.toArray(), codesSizes.toArray()) { public int readVLC(BitReader _in) { return self.inverse.get(super.readVLC(_in)); } public int readVLC16(BitReader _in) { return self.inverse.get(super.readVLC16(_in)); } public void writeVLC(BitWriter out, int code) { super.writeVLC(out, self.forward.get(code)); } }; } }
public int estimateSize() { return (pts.size() << 2) + 4; }
private int invert(int startOff, int level, int prefix, IntArrayList values, IntArrayList valueSizes) { int tableEnd = startOff + 256; values.fill(startOff, tableEnd, -1); valueSizes.fill(startOff, tableEnd, 0); int prefLen = level << 3; for (int i = 0; i < codeSizes.length; i++) { if ((codeSizes[i] <= prefLen) || (level > 0 && (codes[i] >>> (32 - prefLen)) != prefix)) continue; int pref = codes[i] >>> (32 - prefLen - 8); int code = pref & 0xff; int len = codeSizes[i] - prefLen; if (len <= 8) { for (int k = 0; k < (1 << (8 - len)); k++) { values.set(startOff + code + k, i); valueSizes.set(startOff + code + k, len); } } else { if (values.get(startOff + code) == -1) { values.set(startOff + code, tableEnd); tableEnd = invert(tableEnd, level + 1, pref, values, valueSizes); } } } return tableEnd; }
public Integer() { super(); this.lastValue = Integer.MIN_VALUE; this.values = IntArrayList.createIntArrayList(); }
private void cacheSamples(SampleToChunkEntry[] sampleToChunks, long[] chunkOffsets) throws IOException { synchronized (input) { int stscInd = 0; IntArrayList ss = new IntArrayList(); for (int chunkNo = 0; chunkNo < chunkOffsets.length; chunkNo++) { int nSamples = sampleToChunks[stscInd].getCount(); if (stscInd < sampleToChunks.length - 1 && chunkNo + 1 >= sampleToChunks[stscInd + 1].getFirst()) stscInd++; long offset = chunkOffsets[chunkNo]; input.position(offset); ByteBuffer buf = NIOUtils.fetchFrom(input, nSamples * 4); for (int i = 0; i < nSamples; i++) { ss.add(buf.getInt()); } } sampleCache = ss.toArray(); } }
@Override public int estimateSize() { return super.estimateSize() + (sizes.size() << 2) + 32; }
public ISO639LanguageDescriptor() { super(); this.languageCodes = IntArrayList.createIntArrayList(); }
/** * @param arguments * vlc codes * @return */ public static VLC createVLC(String... arguments) { IntArrayList _codes = IntArrayList.createIntArrayList(); IntArrayList _codeSizes = IntArrayList.createIntArrayList(); for (int i = 0; i < arguments.length; i++) { String string = arguments[i]; _codes.add(Integer.parseInt(string, 2) << (32 - string.length())); _codeSizes.add(string.length()); } VLC vlc = new VLC(_codes.toArray(), _codeSizes.toArray()); return vlc; }