For Programmers: Free Programming Magazines  


Home > Archive > Compression > October 2004 > "Down Pillow" Control Code Creation: Step 17 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 17 of 88
Plato777

2004-10-14, 3:55 pm

Creation of the "Down Pillow"
Compression Algorithm Control
Codes: Step 17 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 17 of 88

Use the QBASIC program supplied below.

An index ascii list file is created showing
what groups are needed to isolate certain
label elements. The format is as follows:

[space]
label id
group #1 id
group #2 id
group #3 id
group #4 id
group #5 id
group #6 id
group #7 id
group #8 id
group #9 id
group #10 id

Use this information to find the
bit [label id] by XORing together
all the group id bits.

A database is also created that will be
used to reformat the random label
listing file to exclude those labels used
in the special subgroup mapping in the
previous step.

Make sure the file dpc16_01.dat is located
in the working directory when running the
program. The program creates the files
dpc17_01.dat and dpc17_02.dat.

-----------------------------------------
REM QBASIC program: STEP17.BAS
REM This program creates an
' index file that lists which
' groups are needed to isolate
' certain label elements.
' Also, a database is created
' which is needed to reformat
' the randomized label listing
' created in a previous step.
' Make sure the file dpc16_01.dat
' is located in the working
' directory. The program creates
' the files dpc17_01.dat and
' dpc17_02.dat.

OPEN "R", #1, "dpc16_01.dat", 27
FIELD #1, 2 AS a1$, 10 AS a2$, 3 AS a3$, 10 AS a4$, 2 AS a5$
OPEN "O", #2, "dpc17_01.dat"
OPEN "R", #3, "dpc17_02.dat", 3
FIELD #3, 1 AS d1$, 1 AS d2$, 1 AS d3$
LET f$ = CHR$(0): LET h$ = CHR$(1)
FOR e& = 1 TO 1048576
GET #3, e&
LSET d1$ = f$: LSET d2$ = f$: LSET d3$ = f$
PUT #3, e&
NEXT e&
FOR b = 1 TO 3774
LET g = 0
GET #1, b
LET a2& = VAL(a2$): LET a4& = VAL(a4$)
IF a2& < 393217 THEN LET g = 3
IF a2& < 262145 THEN LET g = 2
IF a2& < 131073 THEN LET g = 1
GET #3, a4&
IF g = 1 THEN LSET d1$ = h$
IF g = 2 THEN LSET d2$ = h$
IF g = 3 THEN LSET d3$ = h$
PUT #3, a4&
LET c = ((b - 1) MOD 37) + 1
IF c = 5 THEN GOSUB 100
IF c = 6 THEN GOSUB 200
IF c = 10 THEN GOSUB 200
IF c = 14 THEN GOSUB 200
IF c = 18 THEN GOSUB 200
IF c = 22 THEN GOSUB 200
IF c = 26 THEN GOSUB 200
IF c = 29 THEN GOSUB 200
IF c = 32 THEN GOSUB 200
IF c = 35 THEN GOSUB 200
NEXT b
CLOSE
END
100 PRINT #2,
PRINT #2, a4$: PRINT #2, a2$
RETURN
200 PRINT #2, a2$
RETURN
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