[Date Prev][Date Next][Thread Prev][Thread Next] - [Date Index][Thread Index][Author Index]

RE: D-block utility



>I'm looking for a program to convert a set of AO40 D-blocks back to the
>original file.  I've looked through the amsat ftp archives and can't find
>anything.  Any pointers on where to get it would be appreciated.

Lee,

There isn't one in the public domain yet, ... I have a subsystem that
decodes them, but that is part of my telemetry merge program, ... which is
not suitable for public distribution (not bullet proof and deliberately
unstable). I imagine that the command team also have such programs, but
probably on the Acorn ARM platform not the PC. 

However the spec is published on the AMSAT-DL web site, ... the spec
contains all the information to decode the D block files, ... it isn't hard
honestly. Also the telem archive contains all the complete D blocks
captured, ... so test data is readiliy available.

Anyone out there want to take up the challenge? I'm sure Paul (KB5MU), would
be happy to put the utility program on the ftp site.

I'd write it myself for you if I had some free time, which I don't!

The only bit that is not in the spec, is how to decode the jpegs, ... which
you do thus:

-----------------

8. In respect of the downloads, where these are JPEGS, each has a six-byte
time
tag appended. The format of a "D-BLOCK-JPEG" is:

(JFIF File - Extract all bytes upto and including End of JFIF marker and
save 
as .JPG)
 
   APP0 marker	(4 bytes)	0xFF, 0xD8, 0xFF, 0xE0

   length	(2 bytes)	0x00, 0x10 
				Total APP0 field byte count, including the
byte
				count (2 bytes), but excluding the APP0
marker 
				and End of Header marker.

   identifier	(5 bytes)	0x4A, 0x46, 0x49, 0x46, 0x00 ("JFIF" Null 
				terminated)

   version	(2 bytes)	0x01, 0x01 
				The first byte is used for major revisions,
the 
				second for revisions.

   units	(1 byte)	0x00 
				Units for the X and Y densities.
				units = 0x00: no units, X and Y specify the
pixel
				units = 0x01: X and Y are dots per inch
				units = 0x02: X and Y are dots per cm

   Xdensity	(2 bytes)	0x00, 0x01
				Horizontal pixel density

   Ydensity	(2 bytes)	0x00, 0x01
				Vertical pixel density

   Xthumbnail	(1 byte)	0x00
				Thumbnail horizontal pixel count

   Ythumbnail	(1 byte)	0x00
				Thumbnail vertical pixel count

   EndofHeader	(2 bytes)	0xFF, 0xDB

   data(n)	(n bytes)	JPEG Image Data

   End of JFIF	(2 bytes)	0xFF, 0xD9

(Picture Date & Time - use this for filename.)

   ss		(1 byte)	10ms    0-98               )

   SS		(1 byte)	Seconds 0-59               

   MM		(1 byte)	Minute  0-59 

   HH		(1 byte)	Hour    0-23     

   DL		(1 byte)    	AMSAT DAY number MOD 256   

   DH		(1 byte)	AMSAT DAY number DIV 256

				Day 0 = 1978 Jan 01

Tips
----

You can identify a JFIF file by looking for the following 
sequence: 0xFF, 0xD8, 0xFF, 0xE0, <skip 2 bytes>, 
0x4A, 0x46, 0x49, 0x46, 0x00 

A single JFIF file may be downloaded across one or more D-Block
files, e.g. Start in JA, some more in JB, and end in JC. There may 
also be more than one JFIF file in a single D-Block file. 

D-Block FileIDs might not be sequential, there is no rule to say 
that JB follows JA. Also, the same FileID may be reused within the 
same capture period.

Missing bytes within the data(n) section can be filled with 0x00, 
and some of the image can be retrieved

Cheers
Paul
----
Via the amsat-bb mailing list at AMSAT.ORG courtesy of AMSAT-NA.
To unsubscribe, send "unsubscribe amsat-bb" to Majordomo@amsat.org



AMSAT Top AMSAT Home