For Programmers: Free Programming Magazines  


Home > Archive > Compression > October 2004 > "Down Pillow" Control Code Creation: Step 16 of 88









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author "Down Pillow" Control Code Creation: Step 16 of 88
Plato777

2004-10-12, 8:55 pm

Creation of the "Down Pillow"
Compression Algorithm Control
Codes: Step 16 of 88

I am posting a series of steps
to comp.compression so that
there can be an external record
of my efforts to create a
sucessful copy of control codes
to use in the "Down Pillow"
compression algorithm as
discussed earlier this year.

Erik T. Evenson
====================================

Step 16 of 88

The basic mapping of the prearranged
XOR groups is created by the following
QBASIC program. This mapping is a
special subgroup of the complete XOR
grouping section of the beta buffer.
The rest of the XOR groupings will
be mapped out excluding the infomation
used in the prearranged subgroup mapping.
Both mapping subgroups will be combined
to give the complete final mapping of the
XOR groupings contained in the beta
buffer.

Make sure the files dpc11_01.dat,
dpc15_01.dat, dpc15_02.dat, and
dpc15_03.dat is located in the
working directory.

The program creates the file dpc16_01.dat.
This file contains 3774 records, listing
the elements in 1020 groups needed to
isolate 102 unique element(labels) in the
intergroup relationship phase of the
decompression routine of the algorithm.

The listing format is as follows:
2 bytes--> marker (1=nonexchangeable element)
10 bytes--> group number identifier
3 bytes--> number of elements in group
10 bytes--> element(label) in group [designated alpha-buffer bit]
2 bytes--> cr/lf coding for ascii listing.
------------
27 bytes total per record.

---------------------------------------
REM QBASIC program: PREARR2.BAS
REM This program creates a list
' of groups and labels to make
' up the prearrangement section
' of the XOR Groups.
' Make sure the files dpc11_01.dat,
' dpc15_01.dat, dpc15_02.dat, and
' dpc15_03.dat are in the working
' directory. The program creates
' the output file dpc16_01.dat.

DIM a(4, 10): DIM h(37): DIM e&(19)
s1 = 1: s2 = 1: s3 = 1
FOR b = 1 TO 4
FOR c = 1 TO 10
READ d
LET a(b, c) = d
NEXT c
NEXT b
FOR i = 1 TO 37
READ d
LET h(i) = d
NEXT i
OPEN "R", #1, "dpc11_01.dat", 10
OPEN "O", #3, "dpc16_01.dat"
FIELD #1, 8 AS f1$, 2 AS f2$
FOR j = 1 TO 102
FOR k = 1 TO 19
LET g = (j - 1) * 19 + k
GET #1, g
LET f1 = VAL(f1$): LET e&(k) = f1
NEXT k
IF j < 103 THEN LET l = 4
IF j < 69 THEN LET l = 3
IF j < 35 THEN LET l = 2
LET q = 0
FOR m = 1 TO 10
LET n = a(1, m): LET r = a(l, m)
IF r = 1 THEN GOSUB 100
IF r = 2 THEN GOSUB 200
IF r = 3 THEN GOSUB 300
GET #2, s4
FOR o = 1 TO n
LET p = q + o: LET u = h(p)
LET v = e&(u): LET v$ = STR$(v)
LET n$ = STR$(n): LET w1$ = SPACE$(10)
LET w2$ = SPACE$(10): LET w4$ = SPACE$(3)
RSET w1$ = t1$: RSET w2$ = v$: RSET w4$ = n$
LET w3$ = "1 "
PRINT #3, w3$; w1$; w4$; w2$
NEXT o
LET q = p
NEXT m
NEXT j
CLOSE
END
100 CLOSE #2
OPEN "R", #2, "dpc15_01.dat", 12
FIELD #2, 10 AS t1$, 2 AS t2$
LET s4 = s1: LET s1 = s1 + 1
RETURN
200 CLOSE #2
OPEN "R", #2, "dpc15_02.dat", 12
FIELD #2, 10 AS t1$, 2 AS t2$
LET s4 = s2: LET s2 = s2 + 1
RETURN
300 CLOSE #2
OPEN "R", #2, "dpc15_03.dat", 12
FIELD #2, 10 AS t1$, 2 AS t2$
LET s4 = s3: LET s3 = s3 + 1
RETURN
DATA 5,4,4,4,4,4,3,3,3,3
DATA 1,1,1,1,2,3,3,2,2,2
DATA 2,2,2,2,3,1,1,3,3,3
DATA 3,3,3,3,1,2,2,1,1,1
DATA 1,2,3,4,5,6,7,8,9
DATA 10,11,12,13,14,15,16
DATA 17,18,19,1,6,10,14,18,2
DATA 7,11,19,15,3,8,12,16
DATA 4,9,13,17
REM end of program
-----------------------------------

More to follow.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com