libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
Loading...
Searching...
No Matches
dpm.h File Reference

Packed on-disk structures of the Data Position Measurement (DPM) block. More...

#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  DpmHeader
 Header of the Data Position Measurement block. More...
struct  DpmEntry
 A DPM control point. More...
struct  DpmCalibration
 A rotation calibration done while measuring. More...

Macros

#define DPM_UNITS_PER_TURN   2560000
 Angle units per turn, Alcohol 120% units (256 per turn) multiplied by 10000.
#define DPM_UNITS_PER_ALCOHOL_UNIT   10000
 Angle units per Alcohol 120% unit.
#define DPM_FLAG_OPPOSITE_TRACK_PATH   0x01
 Bit set in DpmHeader::flags when the layers use opposite track path.

Typedefs

typedef struct DpmHeader DpmHeader
typedef struct DpmEntry DpmEntry
typedef struct DpmCalibration DpmCalibration

Enumerations

enum  DpmEntryStatus {
  DpmStatusUnknown = 0 , DpmStatusMeasured = 1 , DpmStatusRemeasured = 2 , DpmStatusInterpolated = 3 ,
  DpmStatusUnreadable = 4 , DpmStatusLayerBreak = 5
}
 Status of the bin of sectors that ends at an entry. More...

Detailed Description

Packed on-disk structures of the Data Position Measurement (DPM) block.

Data Position Measurement records the physical angle of sectors along the spiral track of an optical disc, as measured by timing reads. The angle is cumulative: it starts at 0 on the first entry and grows by one full turn every DPM_UNITS_PER_TURN units, so it also counts how many times the disc turned.

Binary layout (little-endian, packed):

DpmHeader (sizeof = 40 bytes) uint64_t layerEnd[layerEnds] -> last sector of every layer but the last, increasing DpmEntry entry[entries] -> control points, strictly increasing sector DpmCalibration calibration[calibrations]

length = layerEnds * 8 + entries * sizeof(DpmEntry) + calibrations * sizeof(DpmCalibration) crc64 = CRC64-ECMA of the length bytes that follow the header

The density, in degrees per sector, of the bin between two consecutive entries is (angle[i + 1] - angle[i]) * 360 / DPM_UNITS_PER_TURN / (lba[i + 1] - lba[i]).

Alcohol 120% stores the same cumulative angle, in 256 units per turn, on a uniform grid. A value of this block divided by DPM_UNITS_PER_ALCOHOL_UNIT, rounded, is the Alcohol 120% value.

Warning
Structures are packed; never rely on natural alignment when mapping from a byte buffer.

Definition in file dpm.h.

Macro Definition Documentation

◆ DPM_FLAG_OPPOSITE_TRACK_PATH

#define DPM_FLAG_OPPOSITE_TRACK_PATH   0x01

Bit set in DpmHeader::flags when the layers use opposite track path.

Definition at line 58 of file dpm.h.

◆ DPM_UNITS_PER_ALCOHOL_UNIT

#define DPM_UNITS_PER_ALCOHOL_UNIT   10000

Angle units per Alcohol 120% unit.

Definition at line 55 of file dpm.h.

◆ DPM_UNITS_PER_TURN

#define DPM_UNITS_PER_TURN   2560000

Angle units per turn, Alcohol 120% units (256 per turn) multiplied by 10000.

Definition at line 53 of file dpm.h.

Typedef Documentation

◆ DpmCalibration

typedef struct DpmCalibration DpmCalibration

◆ DpmEntry

typedef struct DpmEntry DpmEntry

◆ DpmHeader

typedef struct DpmHeader DpmHeader

Enumeration Type Documentation

◆ DpmEntryStatus

Status of the bin of sectors that ends at an entry.

Ignored for the first entry.

Enumerator
DpmStatusUnknown 

Unknown, e.g. imported from a format that does not record it.

DpmStatusMeasured 

Measured on the first attempt.

DpmStatusRemeasured 

Measured again because the first measurement was an outlier.

DpmStatusInterpolated 

Measurement failed, interpolated from its neighbours.

DpmStatusUnreadable 

Sectors could not be read, interpolated from its neighbours.

DpmStatusLayerBreak 

Bin crosses a layer boundary or is too short, density copied from the bin before.

Definition at line 63 of file dpm.h.