Mercurial > hg > dmlib
annotate tests/encbr1test.c @ 2313:866e036d7706
Clean up some code duplication.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 09 Jul 2019 11:52:15 +0300 |
parents | 8cd012260976 |
children | 9807ae37ad69 |
rev | line source |
---|---|
2039
210a0041081b
Fix MinGW build of encbr1test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2024
diff
changeset
|
1 #include "dmtool.h" |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2 #include "dmlib.h" |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3 #include "dmres.h" |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
4 #include "dmmutex.h" |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
5 |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
6 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
7 #define BR_DEBUG 1 |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
8 //#define BR_WRITE |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
9 |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
10 enum |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
11 { |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
12 DMODE_LIT, |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 DMODE_RLE, |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
14 }; |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
15 |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
16 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
17 #if BR_DEBUG == 1 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
18 static int mcount = 0; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
19 static int moffs = 0; |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
20 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
21 static void mprintbyte(const Uint8 data) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
22 { |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
23 if (mcount == 0) printf("%04x | ", moffs); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
24 printf("%02x ", data); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
25 if (mcount++ >= 15) { printf("\n"); mcount = 0; } |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
26 moffs++; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
27 } |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
28 #endif |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
29 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
30 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
31 BOOL dmIFFEncodeByteRun1LIT(DMResource *fp, |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
32 const Uint8 *buf, const size_t offs, |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
33 const size_t count) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
34 { |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
35 if (count <= 0) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
36 return TRUE; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
37 |
2074 | 38 #if BR_DEBUG != 0 || defined(BR_WRITE) |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
39 Uint8 tmp = count - 1; |
2074 | 40 #endif |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
41 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
42 #if BR_DEBUG == 2 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
43 printf("L: %02x ", tmp); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
44 for (size_t n = 0; n < count; n++) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
45 printf("%02x ", buf[offs + n]); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
46 printf("[%" DM_PRIu_SIZE_T "]\n", count); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
47 #elif BR_DEBUG == 1 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
48 mprintbyte(tmp); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
49 for (size_t n = 0; n < count; n++) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
50 mprintbyte(buf[offs + n]); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
51 #endif |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
52 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
53 #ifdef BR_WRITE |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
54 if (!dmf_write_byte(fp, tmp) || |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
55 !dmf_write_str(fp, buf + offs, count)) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
56 return FALSE; |
2074 | 57 #else |
58 (void) fp; | |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
59 #endif |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
60 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
61 return TRUE; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
62 } |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
63 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
64 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
65 BOOL dmIFFEncodeByteRun1RLE(DMResource *fp, |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
66 const Uint8 *buf, const size_t offs, |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
67 const size_t count) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
68 { |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
69 if (count <= 0) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
70 return TRUE; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
71 |
2074 | 72 #if BR_DEBUG != 0 || defined(BR_WRITE) |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
73 Uint8 tmp = ((Uint8) count - 2) ^ 0xff; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
74 Uint8 data = buf[offs]; |
2074 | 75 #endif |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
76 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
77 #if BR_DEBUG == 2 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
78 printf("R: %02x %02x [%" DM_PRIu_SIZE_T "]\n", tmp, data, count); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
79 #elif BR_DEBUG == 1 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
80 mprintbyte(tmp); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
81 mprintbyte(data); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
82 #endif |
2074 | 83 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
84 #ifdef BR_WRITE |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
85 if (!dmf_write_byte(fp, tmp) || |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
86 !dmf_write_byte(fp, data)) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
87 return FALSE; |
2074 | 88 #else |
89 (void) fp; | |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
90 #endif |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
91 |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
92 return TRUE; |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
93 } |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
94 |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
95 |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
96 BOOL dmIFFEncodeByteRun1Row(DMResource *fp, const Uint8 *buf, const size_t bufLen) |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
97 { |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
98 int prev = -1, mode = DMODE_LIT; |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
99 size_t offs, l_offs, r_offs; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
100 BOOL ret = TRUE; |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
101 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
102 #if BR_DEBUG == 1 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
103 mcount = 0; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
104 #endif |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
105 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
106 for (offs = l_offs = r_offs = 0; offs < bufLen; offs++) |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
107 { |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
108 Uint8 data = buf[offs]; |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
109 BOOL flush = FALSE; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
110 int pmode = mode; |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
111 |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
112 if (data == prev) |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
113 { |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
114 if (mode == DMODE_LIT && |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
115 offs - r_offs >= 2) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
116 { |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
117 ret = dmIFFEncodeByteRun1LIT(fp, buf, l_offs, r_offs - l_offs); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
118 mode = DMODE_RLE; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
119 } |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
120 } |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
121 else |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
122 { |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
123 if (mode != DMODE_LIT) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
124 { |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
125 ret = dmIFFEncodeByteRun1RLE(fp, buf, r_offs, offs - r_offs); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
126 mode = DMODE_LIT; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
127 l_offs = offs; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
128 } |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
129 r_offs = offs; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
130 } |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
131 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
132 if (!ret) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
133 goto out; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
134 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
135 #if BR_DEBUG == 2 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
136 printf("%04" DM_PRIx_SIZE_T ": %02x | r_count=%" DM_PRIu_SIZE_T ", l_count=%" DM_PRIu_SIZE_T ", mode=%s | [%04" DM_PRIx_SIZE_T ", %04" DM_PRIx_SIZE_T "]", |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
137 offs, data, offs - r_offs, offs - l_offs, |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
138 mode == DMODE_RLE ? "RLE" : "LIT", |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
139 r_offs, l_offs); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
140 #endif |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
141 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
142 // NOTE! RLE max is 128, checked against DP2e |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
143 // Not sure about LIT max yet |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
144 if ((pmode == DMODE_RLE && offs - r_offs >= 128) || |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
145 (pmode == DMODE_LIT && offs - l_offs >= 128)) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
146 { |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
147 flush = TRUE; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
148 #if BR_DEBUG == 2 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
149 printf(" <LEN FLUSH>"); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
150 #endif |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
151 } |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
152 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
153 // Check for last byte of input |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
154 if (offs == bufLen - 1) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
155 { |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
156 offs++; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
157 flush = TRUE; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
158 pmode = mode; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
159 #if BR_DEBUG == 2 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
160 printf(" <FINAL FLUSH>"); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
161 #endif |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
162 } |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
163 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
164 #if BR_DEBUG == 2 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
165 printf("\n"); |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
166 #endif |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
167 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
168 if (flush) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
169 { |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
170 if (pmode == DMODE_RLE) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
171 ret = dmIFFEncodeByteRun1RLE(fp, buf, r_offs, offs - r_offs); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
172 else |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
173 ret = dmIFFEncodeByteRun1LIT(fp, buf, l_offs, offs - l_offs); |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
174 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
175 r_offs = l_offs = offs; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
176 mode = DMODE_LIT; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
177 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
178 if (!ret) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
179 goto out; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
180 } |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
181 |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
182 prev = data; |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
183 } |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
184 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
185 out: |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
186 return ret; |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
187 } |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
188 |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
189 |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
190 |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
191 int main(int argc, char *argv[]) |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
192 { |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
193 DMResource *fp = NULL; |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
194 (void) argc; |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
195 (void) argv; |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
196 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
197 #ifdef BR_WRITE |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
198 dmf_open_stdio_stream(stderr, &fp); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
199 #endif |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
200 |
2060
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
201 #if 1 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
202 static const Uint8 test[] = |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
203 { |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
204 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
205 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
206 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
207 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
208 |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
209 0, |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
210 1, |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
211 |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
212 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
213 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
214 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
215 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
216 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
217 2, 2, 3, 4, 5, 5, 5, 6, |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
218 |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
219 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
220 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
221 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
222 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
223 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
224 1, 3, |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
225 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
226 0, 0, 0, 1, |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
227 }; |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
228 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
229 { |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
230 int cnt = 0; |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
231 for (size_t xc = 0; xc < sizeof(test); xc++) |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
232 { |
2074 | 233 if (cnt == 0) printf("%04" DM_PRIx_SIZE_T " | ", xc); |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
234 printf("%02x ", *(test + xc)); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
235 if (cnt++ >= 15) { printf("\n"); cnt = 0; } |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
236 } |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
237 printf("\n\n"); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
238 |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
239 dmIFFEncodeByteRun1Row(fp, test, sizeof(test)); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
240 printf("\n--\n"); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
241 } |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
242 |
2060
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
243 #else |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
244 |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
245 #if 1 |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
246 # include "TEST03.cdump" |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
247 #else |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
248 # include "BABYFACE.cdump" |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
249 # undef SET_WIDTH |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
250 # define SET_WIDTH 80 |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
251 #endif |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
252 |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
253 printf("DATA = %" DM_PRIu_SIZE_T "\n", sizeof(img_data)); |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
254 for (int yc = 0; yc < sizeof(img_data) / SET_WIDTH; yc++) |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
255 { |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
256 Uint8 *nptr = img_data + (yc * SET_WIDTH); |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
257 int cnt = 0; |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
258 |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
259 printf("#%03d\n", yc); |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
260 for (int xc = 0; xc < SET_WIDTH; xc++) |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
261 { |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
262 if (cnt == 0) printf("%04x | ", xc); |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
263 printf("%02x ", *(nptr + xc)); |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
264 if (cnt++ >= 15) { printf("\n"); cnt = 0; } |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
265 } |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
266 printf("\n\n"); |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
267 |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
268 dmIFFEncodeByteRun1Row(fp, nptr, SET_WIDTH); |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
269 printf("\n--\n"); |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
270 } |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
271 #endif |
d5ea82da40ab
Add some disabled BR1 encoder test code.
Matti Hamalainen <ccr@tnsp.org>
parents:
2051
diff
changeset
|
272 |
2051
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
273 #ifdef BR_WRITE |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
274 dmf_close(fp); |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
275 #endif |
c67d863384a5
Changes to the BR1 encoder test.
Matti Hamalainen <ccr@tnsp.org>
parents:
2039
diff
changeset
|
276 |
2024
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
277 return 0; |
f41bc7203a16
Add a test program for BR1 compression.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
278 } |