summaryrefslogtreecommitdiff
path: root/src/app/deflatetest
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-01-24 13:23:05 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-01-24 13:23:05 +0100
commit3e69313f789834c6e83bec187fc7cb7d4dbfe919 (patch)
tree4d78f3251d4cd80c642ccc6481091050c454f112 /src/app/deflatetest
parentfbbb4f04074c7f21d3b334b01db87f88920db18e (diff)
deflatetest: Move data to separate file; add deflate helper
Diffstat (limited to 'src/app/deflatetest')
-rwxr-xr-xsrc/app/deflatetest/deflate.py37
-rw-r--r--src/app/deflatetest/deflate_data.cc6
-rw-r--r--src/app/deflatetest/main.cc30
3 files changed, 45 insertions, 28 deletions
diff --git a/src/app/deflatetest/deflate.py b/src/app/deflatetest/deflate.py
new file mode 100755
index 0000000..3b1d9bd
--- /dev/null
+++ b/src/app/deflatetest/deflate.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python3
+
+import sys
+import zlib
+
+level = -1
+if len(sys.argv) > 2:
+ level = int(sys.argv[2])
+
+input_data = sys.argv[1].encode("utf-8")
+
+try:
+ with open(sys.argv[1], "rb") as f:
+ input_data = f.read()
+except FileNotFoundError:
+ input_data = sys.argv[1].encode("utf-8")
+
+output = zlib.compress(input_data, level=level)
+
+cinfo = (output[0] & 0xF0) >> 4
+window_size = 1 << (8 + cinfo)
+print(f"// CINFO = {cinfo} (window size = {window_size})")
+
+fdict = output[1] & 0x20
+if fdict:
+ print("// FDICT = 1 (preset dictionary in use)")
+else:
+ print("// FDICT = 0 (no preset dictionary)")
+
+is_final = output[2] & 0x01
+block_type = (output[2] & 0x06) >> 1
+
+print(f"// first Huffman block: type={block_type} is_final={is_final}")
+
+print(f"// {sys.argv[1]}")
+print("unsigned char const inflate_input[] = {" + ", ".join(map(str, output)) + "};")
+print(f"unsigned short const inflate_input_size = {len(output)};")
diff --git a/src/app/deflatetest/deflate_data.cc b/src/app/deflatetest/deflate_data.cc
new file mode 100644
index 0000000..bcfd4b8
--- /dev/null
+++ b/src/app/deflatetest/deflate_data.cc
@@ -0,0 +1,6 @@
+// CINFO = 7 (window size = 32768)
+// FDICT = 0 (no preset dictionary)
+// first Huffman block: type=2 is_final=1
+// /home/derf/var/projects/multipass/src/lib/inflate.cc
+unsigned char const inflate_input[] = {120, 156, 205, 90, 109, 111, 219, 56, 18, 254, 108, 255, 10, 110, 23, 215, 179, 19, 59, 177, 36, 203, 150, 235, 164, 135, 54, 73, 175, 197, 101, 219, 69, 155, 197, 29, 80, 4, 134, 108, 209, 177, 80, 89, 50, 36, 57, 105, 118, 147, 255, 126, 51, 124, 19, 37, 81, 142, 147, 251, 114, 133, 131, 218, 228, 112, 94, 159, 25, 14, 41, 29, 31, 180, 201, 1, 249, 51, 10, 231, 253, 128, 46, 35, 63, 167, 253, 56, 201, 242, 0, 6, 96, 2, 231, 206, 146, 205, 125, 26, 222, 172, 114, 98, 15, 108, 139, 156, 251, 113, 72, 35, 242, 33, 13, 105, 70, 35, 65, 243, 237, 247, 243, 255, 244, 47, 195, 5, 141, 51, 218, 255, 20, 208, 56, 15, 151, 33, 77, 223, 144, 247, 223, 206, 251, 118, 255, 44, 242, 183, 25, 5, 194, 227, 118, 251, 215, 48, 94, 68, 219, 128, 146, 87, 32, 226, 56, 140, 153, 204, 163, 213, 171, 118, 251, 152, 177, 186, 90, 81, 178, 72, 214, 155, 148, 102, 25, 13, 72, 71, 80, 4, 93, 18, 198, 155, 109, 78, 2, 63, 247, 143, 24, 171, 109, 156, 133, 55, 49, 208, 44, 86, 126, 74, 14, 132, 250, 51, 70, 54, 139, 147, 187, 233, 110, 10, 26, 7, 83, 93, 104, 64, 117, 177, 130, 22, 196, 38, 219, 28, 229, 102, 121, 74, 253, 245, 78, 201, 156, 114, 167, 104, 65, 82, 149, 189, 216, 166, 41, 56, 141, 204, 195, 156, 36, 203, 101, 70, 115, 176, 150, 228, 48, 195, 141, 230, 194, 123, 36, 92, 18, 63, 190, 63, 18, 94, 63, 231, 76, 197, 108, 70, 252, 148, 18, 248, 22, 144, 101, 154, 172, 73, 68, 253, 44, 39, 121, 66, 214, 16, 79, 130, 218, 64, 76, 22, 62, 151, 130, 44, 200, 187, 88, 10, 75, 150, 196, 2, 81, 1, 204, 231, 52, 3, 193, 126, 206, 164, 115, 30, 149, 181, 36, 204, 72, 246, 35, 220, 108, 104, 128, 92, 58, 225, 17, 61, 234, 145, 36, 142, 238, 113, 54, 35, 227, 30, 25, 245, 136, 219, 35, 195, 30, 113, 122, 196, 238, 129, 206, 1, 240, 151, 234, 117, 133, 19, 195, 56, 247, 102, 16, 80, 225, 26, 88, 59, 19, 234, 156, 146, 129, 114, 207, 123, 63, 67, 61, 226, 155, 124, 149, 145, 101, 146, 138, 239, 128, 145, 0, 52, 237, 224, 127, 196, 118, 199, 104, 168, 237, 185, 140, 55, 64, 86, 12, 46, 18, 240, 107, 182, 73, 226, 32, 67, 2, 31, 6, 54, 247, 104, 173, 67, 230, 247, 96, 105, 143, 208, 124, 81, 168, 99, 141, 64, 159, 69, 18, 103, 133, 86, 92, 154, 80, 44, 251, 126, 13, 186, 253, 213, 110, 57, 204, 56, 151, 25, 10, 230, 122, 61, 50, 233, 17, 107, 0, 127, 22, 252, 193, 172, 5, 115, 22, 204, 88, 48, 110, 163, 19, 224, 187, 3, 115, 14, 186, 5, 126, 187, 240, 221, 157, 244, 218, 173, 17, 46, 135, 129, 9, 50, 96, 171, 144, 204, 26, 33, 143, 9, 252, 180, 113, 165, 237, 122, 237, 71, 229, 145, 139, 159, 121, 234, 115, 87, 63, 215, 31, 43, 63, 35, 113, 66, 168, 226, 208, 35, 124, 193, 200, 101, 115, 86, 49, 197, 66, 139, 129, 43, 96, 225, 75, 89, 8, 23, 139, 128, 108, 203, 6, 71, 109, 0, 205, 97, 124, 3, 8, 32, 168, 211, 173, 31, 109, 105, 183, 226, 89, 175, 201, 177, 168, 132, 244, 42, 248, 207, 248, 177, 180, 143, 173, 125, 28, 237, 51, 44, 62, 237, 150, 203, 98, 195, 63, 3, 238, 185, 99, 2, 240, 37, 126, 148, 37, 100, 78, 193, 74, 153, 232, 96, 52, 148, 152, 128, 254, 36, 39, 100, 72, 30, 30, 8, 255, 113, 122, 10, 222, 235, 146, 127, 144, 1, 121, 35, 8, 250, 195, 46, 121, 251, 150, 216, 37, 96, 6, 97, 150, 251, 241, 130, 242, 80, 200, 95, 165, 96, 12, 88, 40, 38, 90, 36, 6, 37, 159, 170, 69, 232, 213, 167, 1, 41, 201, 171, 144, 180, 164, 75, 56, 48, 199, 28, 146, 14, 135, 161, 13, 35, 14, 206, 193, 216, 8, 190, 79, 16, 154, 54, 18, 76, 16, 156, 46, 162, 211, 115, 209, 115, 184, 98, 60, 98, 104, 198, 69, 150, 235, 224, 242, 1, 46, 116, 6, 99, 100, 49, 192, 197, 35, 107, 8, 179, 30, 91, 110, 217, 182, 55, 97, 152, 245, 16, 176, 67, 119, 60, 110, 70, 235, 222, 46, 106, 130, 234, 80, 0, 21, 134, 158, 196, 152, 242, 85, 19, 202, 116, 76, 233, 56, 114, 101, 114, 243, 252, 230, 41, 206, 179, 156, 39, 58, 248, 91, 102, 59, 254, 217, 226, 15, 189, 225, 60, 9, 56, 137, 55, 187, 140, 47, 155, 225, 203, 146, 142, 251, 20, 147, 121, 148, 44, 126, 144, 252, 126, 3, 25, 10, 91, 210, 125, 236, 175, 195, 5, 89, 109, 151, 203, 53, 240, 102, 30, 132, 68, 203, 87, 220, 155, 170, 74, 2, 144, 162, 48, 167, 169, 31, 29, 243, 33, 100, 135, 169, 172, 156, 239, 71, 155, 149, 63, 135, 74, 139, 53, 25, 214, 175, 97, 43, 191, 133, 112, 100, 121, 146, 114, 29, 75, 66, 142, 200, 85, 66, 50, 255, 22, 182, 154, 141, 191, 192, 141, 28, 183, 167, 5, 38, 0, 43, 251, 62, 89, 210, 187, 178, 14, 200, 24, 246, 252, 160, 166, 158, 8, 60, 206, 115, 105, 130, 27, 146, 45, 147, 40, 74, 238, 88, 45, 73, 3, 154, 130, 216, 21, 236, 53, 62, 14, 102, 66, 8, 3, 82, 206, 124, 138, 10, 5, 184, 37, 102, 201, 154, 139, 64, 86, 37, 5, 226, 45, 115, 57, 152, 142, 236, 197, 207, 154, 158, 98, 179, 131, 50, 134, 174, 99, 251, 30, 56, 106, 23, 176, 86, 11, 88, 63, 99, 97, 83, 249, 55, 18, 21, 223, 99, 200, 242, 100, 10, 142, 248, 198, 224, 114, 164, 12, 57, 80, 28, 142, 21, 132, 204, 144, 163, 208, 213, 82, 230, 172, 18, 76, 212, 232, 149, 166, 245, 43, 110, 66, 39, 163, 160, 251, 60, 185, 165, 13, 59, 234, 106, 33, 170, 108, 246, 221, 154, 92, 239, 100, 95, 198, 139, 25, 44, 153, 89, 74, 20, 5, 74, 140, 99, 121, 133, 156, 119, 89, 182, 93, 111, 242, 16, 60, 247, 6, 127, 31, 148, 64, 37, 225, 0, 1, 142, 194, 53, 136, 15, 48, 172, 22, 75, 236, 140, 147, 131, 98, 24, 29, 248, 139, 177, 139, 97, 80, 133, 213, 182, 235, 150, 225, 73, 238, 66, 96, 132, 102, 100, 254, 90, 50, 22, 61, 210, 87, 31, 21, 240, 35, 250, 134, 68, 73, 124, 67, 211, 202, 210, 53, 235, 108, 125, 104, 102, 160, 77, 187, 91, 209, 24, 202, 75, 12, 221, 47, 96, 48, 242, 211, 27, 202, 250, 77, 100, 132, 181, 246, 136, 252, 27, 6, 146, 248, 239, 96, 125, 194, 186, 164, 41, 64, 55, 203, 161, 169, 233, 145, 59, 150, 229, 116, 145, 11, 172, 105, 221, 100, 150, 108, 83, 112, 100, 158, 32, 163, 121, 197, 28, 142, 235, 31, 239, 49, 20, 69, 115, 43, 55, 25, 104, 183, 84, 222, 108, 99, 192, 62, 134, 38, 134, 170, 200, 157, 8, 77, 35, 54, 226, 172, 180, 94, 138, 24, 94, 138, 24, 138, 176, 137, 162, 186, 158, 135, 216, 142, 42, 87, 149, 178, 0, 242, 207, 16, 78, 150, 187, 144, 227, 107, 255, 7, 24, 180, 193, 95, 200, 171, 73, 14, 249, 70, 89, 49, 129, 145, 155, 36, 5, 57, 107, 228, 251, 245, 195, 25, 118, 50, 22, 56, 112, 129, 161, 32, 206, 145, 125, 100, 163, 194, 200, 43, 160, 185, 31, 70, 153, 236, 104, 63, 41, 61, 164, 236, 91, 63, 13, 253, 121, 36, 42, 6, 43, 167, 44, 137, 209, 96, 148, 37, 163, 169, 42, 90, 24, 51, 190, 149, 90, 201, 42, 105, 3, 128, 231, 209, 140, 249, 22, 76, 255, 110, 217, 128, 95, 181, 243, 74, 10, 244, 247, 12, 29, 166, 72, 94, 16, 158, 243, 106, 62, 61, 161, 77, 240, 164, 50, 130, 162, 13, 124, 115, 176, 181, 70, 153, 210, 219, 217, 29, 84, 210, 142, 154, 193, 95, 61, 34, 69, 98, 166, 117, 219, 80, 187, 212, 124, 42, 155, 239, 98, 104, 237, 103, 63, 96, 204, 130, 49, 180, 162, 224, 149, 202, 25, 114, 114, 66, 58, 172, 46, 247, 137, 213, 157, 138, 137, 183, 192, 70, 126, 125, 11, 84, 93, 44, 146, 45, 168, 214, 29, 84, 130, 188, 230, 115, 124, 180, 133, 114, 31, 78, 153, 44, 144, 211, 122, 132, 63, 182, 242, 228, 132, 75, 134, 1, 32, 217, 166, 49, 106, 56, 109, 63, 150, 108, 174, 28, 34, 112, 97, 71, 51, 145, 187, 147, 217, 41, 120, 116, 152, 202, 197, 20, 234, 93, 101, 90, 114, 228, 13, 205, 185, 35, 155, 188, 37, 244, 239, 212, 206, 160, 223, 7, 215, 184, 169, 215, 207, 56, 93, 109, 149, 100, 216, 37, 245, 245, 214, 53, 115, 175, 7, 58, 154, 153, 160, 71, 13, 51, 204, 175, 92, 0, 124, 33, 240, 79, 19, 99, 208, 211, 190, 38, 175, 49, 18, 173, 170, 39, 13, 188, 187, 76, 37, 107, 68, 250, 108, 5, 251, 215, 160, 221, 206, 192, 213, 124, 140, 32, 82, 161, 139, 183, 235, 89, 19, 66, 235, 129, 1, 89, 134, 131, 228, 225, 169, 98, 3, 4, 119, 171, 48, 162, 38, 111, 17, 0, 168, 199, 93, 86, 243, 204, 225, 225, 180, 221, 50, 241, 238, 195, 154, 170, 133, 0, 235, 170, 255, 148, 25, 186, 245, 183, 73, 24, 20, 148, 219, 16, 106, 174, 172, 10, 202, 126, 213, 202, 244, 10, 103, 101, 225, 159, 180, 199, 156, 14, 1, 45, 8, 101, 205, 208, 40, 15, 136, 170, 19, 101, 7, 134, 122, 114, 179, 34, 85, 75, 248, 159, 184, 1, 136, 97, 150, 243, 33, 251, 65, 66, 232, 89, 45, 27, 254, 63, 60, 228, 206, 146, 114, 191, 135, 215, 130, 28, 76, 172, 45, 65, 165, 181, 69, 8, 88, 217, 47, 132, 215, 162, 0, 40, 78, 197, 204, 53, 247, 252, 99, 109, 9, 148, 22, 161, 163, 88, 92, 104, 92, 16, 137, 165, 37, 125, 44, 174, 143, 36, 63, 100, 3, 82, 45, 225, 10, 126, 32, 57, 36, 133, 105, 88, 29, 174, 25, 228, 177, 18, 181, 148, 91, 185, 209, 248, 141, 217, 189, 3, 218, 184, 9, 237, 23, 86, 204, 211, 23, 198, 149, 13, 179, 210, 218, 144, 30, 170, 122, 235, 201, 197, 189, 162, 126, 241, 248, 202, 159, 210, 53, 101, 25, 98, 89, 109, 147, 81, 10, 244, 136, 134, 121, 30, 60, 229, 77, 57, 3, 213, 230, 181, 198, 14, 242, 175, 240, 171, 162, 17, 133, 171, 68, 121, 98, 34, 212, 227, 165, 6, 5, 56, 158, 172, 10, 173, 189, 234, 66, 99, 101, 216, 85, 27, 56, 122, 91, 210, 233, 120, 102, 216, 36, 232, 60, 101, 207, 84, 159, 95, 108, 83, 125, 190, 108, 35, 163, 44, 239, 192, 205, 57, 86, 75, 153, 211, 194, 100, 73, 193, 72, 148, 200, 83, 169, 157, 154, 150, 101, 45, 228, 86, 114, 83, 32, 79, 248, 10, 105, 252, 163, 180, 242, 81, 47, 133, 35, 215, 117, 92, 189, 224, 85, 79, 38, 188, 45, 211, 147, 34, 154, 213, 243, 2, 6, 203, 169, 161, 229, 70, 80, 166, 103, 220, 25, 117, 57, 45, 68, 126, 22, 57, 41, 6, 68, 204, 45, 61, 249, 5, 222, 74, 105, 171, 235, 37, 213, 49, 117, 142, 162, 42, 155, 58, 70, 149, 5, 76, 10, 28, 251, 221, 145, 112, 178, 190, 119, 23, 151, 199, 24, 140, 250, 125, 177, 140, 139, 240, 240, 249, 197, 135, 203, 119, 87, 23, 179, 139, 175, 95, 103, 95, 254, 184, 250, 253, 143, 171, 217, 229, 197, 231, 127, 94, 125, 44, 96, 103, 184, 151, 46, 10, 86, 1, 219, 98, 86, 20, 92, 66, 35, 104, 188, 149, 194, 120, 21, 166, 52, 22, 210, 7, 26, 225, 95, 18, 194, 60, 100, 128, 162, 91, 63, 210, 10, 68, 229, 6, 149, 241, 236, 227, 157, 211, 117, 9, 252, 236, 162, 167, 90, 92, 244, 75, 194, 234, 66, 84, 176, 88, 36, 221, 35, 229, 31, 158, 214, 59, 11, 141, 186, 240, 82, 160, 98, 95, 15, 190, 134, 177, 160, 64, 162, 222, 236, 168, 102, 189, 58, 163, 117, 233, 221, 105, 201, 67, 120, 174, 174, 184, 168, 118, 167, 199, 148, 226, 102, 26, 253, 82, 190, 216, 210, 168, 205, 78, 81, 34, 247, 246, 138, 72, 15, 225, 205, 126, 95, 47, 43, 207, 69, 236, 126, 144, 21, 245, 165, 206, 28, 91, 232, 83, 217, 243, 144, 3, 147, 248, 190, 114, 106, 119, 218, 192, 69, 212, 171, 71, 173, 163, 168, 21, 116, 44, 247, 181, 103, 68, 192, 124, 88, 6, 191, 110, 199, 167, 207, 101, 51, 30, 203, 173, 64, 165, 236, 233, 151, 2, 252, 44, 97, 222, 84, 244, 108, 66, 219, 89, 251, 190, 199, 49, 1, 246, 170, 67, 195, 228, 224, 90, 231, 25, 239, 205, 212, 217, 197, 20, 79, 158, 114, 151, 129, 182, 55, 86, 237, 152, 193, 75, 159, 193, 65, 188, 85, 174, 251, 28, 32, 57, 172, 28, 99, 180, 73, 230, 1, 83, 88, 26, 101, 85, 34, 242, 216, 110, 194, 108, 141, 119, 21, 185, 123, 192, 246, 177, 122, 40, 214, 182, 100, 224, 174, 237, 200, 38, 220, 226, 220, 169, 134, 104, 13, 4, 229, 179, 211, 96, 199, 86, 202, 71, 213, 142, 90, 111, 246, 43, 237, 56, 52, 124, 67, 71, 83, 204, 116, 141, 199, 58, 91, 79, 179, 143, 117, 207, 195, 161, 96, 96, 187, 238, 62, 12, 38, 21, 6, 176, 139, 72, 6, 227, 201, 62, 12, 198, 85, 6, 158, 52, 193, 246, 246, 210, 160, 106, 130, 237, 41, 13, 188, 17, 0, 192, 222, 75, 13, 87, 156, 107, 26, 206, 107, 198, 139, 51, 224, 223, 220, 38, 240, 86, 166, 177, 87, 216, 95, 14, 154, 128, 130, 236, 137, 137, 175, 182, 57, 53, 109, 75, 2, 95, 213, 182, 172, 209, 36, 131, 20, 163, 58, 221, 29, 128, 21, 87, 115, 117, 196, 122, 213, 211, 233, 42, 10, 115, 134, 155, 177, 86, 129, 212, 190, 229, 118, 167, 197, 186, 21, 110, 0, 236, 50, 234, 73, 202, 5, 63, 42, 14, 77, 148, 67, 160, 172, 31, 96, 217, 18, 3, 82, 180, 251, 117, 211, 131, 1, 56, 194, 214, 122, 74, 37, 201, 233, 86, 176, 41, 133, 136, 102, 62, 89, 118, 234, 98, 186, 47, 84, 66, 29, 205, 159, 128, 86, 193, 75, 143, 116, 179, 58, 59, 81, 7, 96, 111, 130, 184, 94, 161, 114, 186, 206, 102, 155, 52, 89, 240, 171, 114, 174, 171, 104, 63, 170, 147, 39, 28, 18, 135, 60, 220, 197, 225, 212, 83, 87, 25, 166, 22, 222, 96, 29, 123, 46, 255, 191, 116, 241, 208, 240, 88, 178, 39, 46, 52, 216, 220, 115, 78, 96, 133, 99, 130, 151, 221, 45, 159, 226, 188, 242, 142, 81, 48, 40, 29, 229, 140, 133, 169, 236, 25, 189, 67, 218, 131, 156, 93, 105, 240, 78, 169, 50, 163, 183, 73, 245, 115, 128, 53, 174, 152, 28, 111, 163, 104, 183, 201, 206, 110, 147, 11, 6, 47, 48, 153, 31, 67, 158, 107, 131, 183, 203, 6, 203, 88, 64, 198, 255, 15, 70, 148, 110, 51, 158, 224, 169, 14, 121, 70, 174, 143, 207, 223, 207, 48, 239, 94, 154, 237, 207, 219, 208, 152, 36, 158, 224, 47, 219, 212, 158, 183, 171, 53, 25, 214, 168, 20, 223, 218, 84, 249, 226, 111, 167, 117, 42, 175, 123, 241, 78, 110, 190, 93, 106, 151, 25, 124, 12, 120, 162, 184, 10, 189, 232, 9, 203, 11, 196, 32, 54, 214, 184, 69, 30, 31, 43, 232, 101, 179, 101, 24, 179, 19, 164, 18, 132, 167, 164, 215, 100, 240, 115, 96, 105, 123, 29, 123, 234, 53, 99, 239, 15, 156, 226, 91, 6, 85, 218, 17, 127, 227, 0, 219, 111, 190, 128, 93, 210, 155, 186, 116, 77, 210, 180, 58, 143, 135, 36, 109, 30, 220, 165, 76, 53, 223, 202, 67, 169, 208, 165, 148, 174, 39, 10, 79, 76, 107, 20, 92, 80, 65, 1, 146, 10, 31, 33, 199, 236, 46, 204, 23, 43, 188, 110, 148, 118, 179, 92, 100, 47, 42, 12, 222, 136, 7, 34, 69, 195, 95, 62, 142, 97, 102, 204, 83, 234, 227, 19, 40, 182, 194, 170, 175, 168, 54, 219, 181, 53, 118, 125, 77, 173, 223, 209, 23, 1, 145, 191, 141, 242, 55, 230, 227, 198, 251, 203, 47, 103, 255, 18, 91, 55, 214, 48, 100, 124, 66, 6, 165, 227, 9, 11, 25, 163, 168, 192, 190, 116, 62, 214, 221, 90, 135, 239, 12, 223, 255, 124, 54, 134, 249, 133, 220, 243, 129, 140, 150, 40, 70, 248, 218, 213, 51, 206, 114, 18, 217, 168, 240, 108, 77, 243, 85, 18, 24, 179, 96, 57, 173, 208, 130, 157, 55, 89, 137, 20, 119, 64, 174, 140, 206, 236, 23, 117, 227, 107, 208, 231, 183, 139, 171, 143, 95, 206, 181, 128, 104, 172, 81, 172, 61, 104, 92, 250, 225, 252, 211, 217, 149, 182, 178, 163, 31, 189, 75, 250, 243, 35, 247, 67, 73, 211, 46, 249, 27, 113, 172, 102, 230, 103, 31, 47, 10, 160, 232, 79, 202, 248, 49, 95, 86, 41, 61, 71, 237, 94, 17, 77, 188, 86, 235, 17, 61, 118, 90, 200, 166, 248, 206, 238, 18, 80, 165, 68, 50, 105, 223, 254, 248, 173, 0, 37, 156, 162, 7, 149, 103, 5, 42, 101, 44, 241, 244, 216, 48, 101, 139, 55, 61, 107, 23, 54, 60, 211, 235, 72, 70, 54, 108, 23, 126, 186, 118, 180, 74, 229, 92, 163, 59, 49, 28, 248, 119, 208, 171, 253, 92, 55, 72, 110, 24, 60, 136, 142, 173, 223, 159, 192, 252, 161, 218, 80, 180, 249, 142, 225, 62, 182, 139, 129, 29, 185, 174, 109, 149, 174, 100, 209, 49, 59, 69, 216, 102, 17, 133, 10, 37, 190, 136, 138, 157, 207, 137, 155, 158, 109, 168, 133, 29, 77, 242, 47, 178, 201, 38, 157, 221, 215, 71, 26, 150, 11, 58, 185, 214, 120, 135, 213, 149, 211, 15, 15, 133, 178, 224, 79, 38, 178, 245, 132, 56, 187, 65, 92, 203, 64, 235, 128, 168, 230, 75, 61, 137, 111, 213, 43, 253, 138, 111, 184, 46, 219, 213, 103, 217, 255, 5, 16, 252, 175, 19};
+unsigned short const inflate_input_size = 3260;
diff --git a/src/app/deflatetest/main.cc b/src/app/deflatetest/main.cc
index 2ced5db..41ff742 100644
--- a/src/app/deflatetest/main.cc
+++ b/src/app/deflatetest/main.cc
@@ -10,33 +10,7 @@
#include "driver/counter.h"
#include "lib/inflate.h"
-
-
-/*
-// bad apple 0042.png
-unsigned char const deflate_input[] = {
- 40, 207, 99, 96, 64, 0, 102, 134, 81, 14, 117, 57, 236, 84, 229, 240, 147, 193, 145, 167, 148, 99, 79, 41, 7, 183, 209, 243, 113, 114, 80, 148, 161, 248, 7, 37, 120, 71, 16, 0, 0, 108, 36, 4, 56
-};
-*/
-
-/*
-// bad apple 1000.png
-unsigned char const deflate_input[] = {
- 40, 207, 173, 210, 189, 13, 194, 48, 16, 5, 224, 103, 82, 208, 225, 17, 204, 32, 72, 153, 129, 13, 50, 4, 189, 205, 36, 180, 244, 44, 16, 38, 193, 27, 96, 58, 138, 196, 6, 147, 31, 191, 68, 73, 4, 18, 215, 125, 186, 211, 249, 78, 62, 4, 10, 252, 11, 55, 198, 137, 97, 52, 1, 146, 145, 37, 120, 136, 132, 10, 72, 120, 2, 186, 135, 3, 114, 134, 226, 50, 201, 153, 4, 124, 7, 55, 130, 154, 125, 71, 241, 160, 146, 86, 192, 154, 51, 3, 40, 46, 235, 32, 34, 218, 125, 28, 100, 213, 163, 4, 118, 61, 12, 98, 52, 168, 64, 112, 27, 194, 195, 19, 66, 3, 253, 27, 68, 124, 170, 131, 140, 107, 119, 80, 193, 166, 214, 58, 162, 93, 193, 7, 202, 52, 131, 15, 160, 167, 97, 150, 144, 243, 255, 228, 211, 101, 131, 110, 118, 116, 33, 51, 153, 241, 4, 233, 196, 182, 4, 95, 112, 198, 50, 74, 190, 81, 187, 128, 108, 2, 245, 37, 220, 223, 168, 63, 184, 30, 87, 197, 254, 112, 22, 75, 221, 94, 223, 233, 137, 202
-};
-*/
-
-
-unsigned char const deflate_input[] = {
- 120, 156, 243, 72, 205, 201, 201, 215, 81, 8, 207, 47, 202, 73, 177, 87, 240, 64, 226, 41, 2, 0, 128, 125, 9, 17
-};
-
-
-/*
-unsigned char const deflate_input[] = {
- 120, 1, 243, 72, 204, 201, 201, 215, 81, 8, 79, 205, 41, 81, 4, 0, 26, 155, 3, 250
-};
-*/
+#include "deflate_data.cc"
unsigned char deflate_output[1024];
@@ -48,7 +22,7 @@ int main(void)
for (uint8_t i = 0; i < 5; i++) {
counter.start();
- int16_t ret = inflate_zlib((unsigned char*)deflate_input, sizeof(deflate_input), deflate_output, sizeof(deflate_output));
+ int16_t ret = inflate_zlib((unsigned char*)inflate_input, inflate_input_size, deflate_output, sizeof(deflate_output));
counter.stop();
kout << "inflate returned " << ret << endl;
kout << "Output: " << (char*)deflate_output << endl;