libdata-gcf  1.1.2
Functions
Transcode blocks between difference formats.

Functions

int gcf_transcode_24_to_32 (struct gcf_data_hdr *hdr, char *block)
 Transcode 24-bit differences to 32-bit differences. More...
 

Detailed Description

This module contains a routine which transcodes the 24-bit modulo compression scheme used by a DM24mk3 over BRP into 32-bit differences used elsewhere. The 24-bit scheme cannot be a primary encoding because it relies on the block length being available. BRP will preserve the block length but disk files and Scream! will not.

Function Documentation

◆ gcf_transcode_24_to_32()

int gcf_transcode_24_to_32 ( struct gcf_data_hdr hdr,
char *  block 
)

Transcode 24-bit differences to 32-bit differences.

Parameters
[in,out]hdrThe header of the data block.
[in,out]blockThe raw block data.
Return values
0on success.
-1on error (and see gcf_errstr).

This function will transcode the 24-bit modulo difference compression scheme used by a DM24mk3 over BRP into standard 32-bit differences. It must be passed a valid 24-bit block. It may fail if there is a checksum error, in which case it will return -1. Otherwise, the data pointed to by block and hdr is modified and 0 is returned.