diff options
Diffstat (limited to 'isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn')
5 files changed, 376 insertions, 0 deletions
diff --git a/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/all-wcprops b/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/all-wcprops new file mode 100644 index 0000000..6a318ac --- /dev/null +++ b/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/!svn/ver/528/trunk/isoparser/src/main/java/com/googlecode/mp4parser/h264 +END +CharCache.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/!svn/ver/236/trunk/isoparser/src/main/java/com/googlecode/mp4parser/h264/CharCache.java +END +BTree.java +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/!svn/ver/236/trunk/isoparser/src/main/java/com/googlecode/mp4parser/h264/BTree.java +END +Debug.java +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/!svn/ver/236/trunk/isoparser/src/main/java/com/googlecode/mp4parser/h264/Debug.java +END diff --git a/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/entries b/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/entries new file mode 100644 index 0000000..a6fb43e --- /dev/null +++ b/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/entries @@ -0,0 +1,139 @@ +10 + +dir +778 +http://mp4parser.googlecode.com/svn/trunk/isoparser/src/main/java/com/googlecode/mp4parser/h264 +http://mp4parser.googlecode.com/svn + + + +2012-04-26T13:35:04.700844Z +528 +hoemmagnus@gmail.com + + + + + + + + + + + + + + +7decde4b-c250-0410-a0da-51896bc88be6 + +model +dir + +CharCache.java +file + + + + +2012-09-14T17:27:51.457232Z +c3b2a16e50a2b43f07cc729ba83f6b84 +2011-09-20T18:03:23.375910Z +236 +Sebastian.Annies@gmail.com + + + + + + + + + + + + + + + + + + + + + +1868 + +BTree.java +file + + + + +2012-09-14T17:27:51.457232Z +3dd3d07d1bd0c3bdbcb2aeb45c375f1d +2011-09-20T18:03:23.375910Z +236 +Sebastian.Annies@gmail.com + + + + + + + + + + + + + + + + + + + + + +2116 + +Debug.java +file + + + + +2012-09-14T17:27:51.457232Z +f136a4c416c039d97eedee9f96667284 +2011-09-20T18:03:23.375910Z +236 +Sebastian.Annies@gmail.com + + + + + + + + + + + + + + + + + + + + + +2796 + +write +dir + +read +dir + diff --git a/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/text-base/BTree.java.svn-base b/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/text-base/BTree.java.svn-base new file mode 100644 index 0000000..57391ba --- /dev/null +++ b/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/text-base/BTree.java.svn-base @@ -0,0 +1,69 @@ +/* +Copyright (c) 2011 Stanislav Vitvitskiy + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. +*/ +package com.googlecode.mp4parser.h264; + + +/** + * Simple BTree implementation needed for haffman tables + * + * @author Stanislav Vitvitskiy + */ +public class BTree { + private BTree zero; + private BTree one; + private Object value; + + /** + * Adds a leaf value to a binary path specified by path + * + * @param str + * @param value + */ + public void addString(String path, Object value) { + if (path.length() == 0) { + this.value = value; + return; + } + char charAt = path.charAt(0); + BTree branch; + if (charAt == '0') { + if (zero == null) + zero = new BTree(); + branch = zero; + } else { + if (one == null) + one = new BTree(); + branch = one; + } + branch.addString(path.substring(1), value); + } + + public BTree down(int b) { + if (b == 0) + return zero; + else + return one; + } + + public Object getValue() { + return value; + } +}
\ No newline at end of file diff --git a/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/text-base/CharCache.java.svn-base b/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/text-base/CharCache.java.svn-base new file mode 100644 index 0000000..2fe8ead --- /dev/null +++ b/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/text-base/CharCache.java.svn-base @@ -0,0 +1,57 @@ +/* +Copyright (c) 2011 Stanislav Vitvitskiy + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. +*/ +package com.googlecode.mp4parser.h264; + +public class CharCache { + private char[] cache; + private int pos; + + public CharCache(int capacity) { + cache = new char[capacity]; + } + + public void append(String str) { + char[] chars = str.toCharArray(); + int available = cache.length - pos; + int toWrite = chars.length < available ? chars.length : available; + System.arraycopy(chars, 0, cache, pos, toWrite); + pos += toWrite; + } + + public String toString() { + return new String(cache, 0, pos); + } + + public void clear() { + pos = 0; + } + + public void append(char c) { + if (pos < cache.length - 1) { + cache[pos] = c; + pos++; + } + } + + public int length() { + return pos; + } +} diff --git a/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/text-base/Debug.java.svn-base b/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/text-base/Debug.java.svn-base new file mode 100644 index 0000000..d0bea73 --- /dev/null +++ b/isoparser/src/main/java/com/googlecode/mp4parser/h264/.svn/text-base/Debug.java.svn-base @@ -0,0 +1,88 @@ +/* +Copyright (c) 2011 Stanislav Vitvitskiy + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. +*/ +package com.googlecode.mp4parser.h264; + +import java.nio.ShortBuffer; + +public class Debug { + public final static void print8x8(int[] output) { + int i = 0; + for (int x = 0; x < 8; x++) { + for (int y = 0; y < 8; y++) { + System.out.printf("%3d, ", output[i]); + i++; + } + System.out.println(); + } + } + + public final static void print8x8(short[] output) { + int i = 0; + for (int x = 0; x < 8; x++) { + for (int y = 0; y < 8; y++) { + System.out.printf("%3d, ", output[i]); + i++; + } + System.out.println(); + } + } + + public final static void print8x8(ShortBuffer output) { + for (int x = 0; x < 8; x++) { + for (int y = 0; y < 8; y++) { + System.out.printf("%3d, ", output.get()); + } + System.out.println(); + } + } + + public static void print(short[] table) { + int i = 0; + for (int x = 0; x < 8; x++) { + for (int y = 0; y < 8; y++) { + System.out.printf("%3d, ", table[i]); + i++; + } + System.out.println(); + } + } + + public static void trace(String format, Object... args) { + // System.out.printf("> " + format + "\n", args); + } + + public final static boolean debug = false; + + public static void print(int i) { + if (debug) + System.out.print(i); + } + + public static void print(String string) { + if (debug) + System.out.print(string); + } + + public static void println(String string) { + if (debug) + System.out.println(string); + } +} |