CW-HDCD 1.0.1.0
Cole Williams HDCD Audio Converter
Cole Williams Software Limited

OVERVIEW
========

CW-HDCD detects and decodes HDCD signalling in stereo PCM audio.

Decoded output is written as 24-bit PCM in WAV/RF64 or FLAC without resampling,
normalization, ReplayGain, additional DSP or dithering.

HDCD PROCESSING
===============

Implemented:

  - Type A packet detection
  - Type B packet detection and complement validation
  - Peak Extend reconstruction
  - Low-Level Gain reconstruction with stereo-coordinated gain envelope
  - Transient Filter flag detection

Transient Filter signalling is detected and reported but is not reconstructed.

SUPPORTED INPUT
===============

Decode input:

  - Original 16-bit stereo HDCD PCM in WAV/RF64
  - Native FLAC containing original 16-bit stereo HDCD PCM

Scan input additionally supports:

  - 16-bit PCM
  - 20-bit PCM stored in 24-bit containers
  - 24-bit PCM candidate-bit scanning

20-bit and 24-bit input remain scan-only until independently validated for
decode.

OUTPUT
======

CW-HDCD can produce:

  - 24-bit stereo WAV
  - Automatic RF64 when decoded WAV would exceed the RIFF size limit
  - 24-bit stereo native FLAC

BASIC USAGE
===========

Scan:

  cw-hdcd.exe --scan input.wav
  cw-hdcd.exe --scan input.flac

Decode to WAV/RF64:

  cw-hdcd.exe input.wav output.wav
  cw-hdcd.exe input.flac output.wav

Decode to FLAC:

  cw-hdcd.exe input.wav output.flac
  cw-hdcd.exe input.flac output.flac

PRESERVE-HDCD MODE
==================

--preserve-hdcd performs lossless PCM16 container conversion without decoding
the HDCD signal.

Examples:

  cw-hdcd.exe input.wav output.flac --preserve-hdcd
  cw-hdcd.exe input.flac output.wav --preserve-hdcd

In preserve mode the original PCM sample values, including HDCD signalling in
the least-significant bits, are preserved unchanged.

FLAC SUPPORT
============

FLAC support is provided through libFLAC.dll.

For FLAC input or output, libFLAC.dll must be beside cw-hdcd.exe.

WAV/RF64-only operation does not require libFLAC.dll.

NON-HDCD INPUT
==============

Normal decode and --preserve-hdcd conversion perform an HDCD preflight before
opening the output file.

If valid HDCD signalling is not found:

  - Conversion stops
  - Exit code 2 is returned
  - No output file is created

Use --scan for explicit detection/reporting without conversion.

FILE SAFETY
===========

Existing output files are not replaced unless --overwrite is specified.

Ctrl+C aborts conversion and removes an incomplete output file.

VALIDATION
==========

The reconstruction engine was compared sample-for-sample against the reference
FFmpeg HDCD decoder before release.

Real Peak Extend source:

  Frames compared: 129,527,580
  Result: IDENTICAL

Synthetic non-zero Low-Level Gain source:

  Frames compared: 441,000
  Result: IDENTICAL

EXACT AUDIO COPY
================

CW-HDCD includes an --eac integration mode. The tested EAC workflow decodes
valid HDCD audio to 24-bit FLAC.

See EAC.txt for the recommended EAC configuration.

WINDOWS BUILDS
==============

CW-HDCD is supplied as separate 64-bit and 32-bit Windows builds.

PROJECT
=======

Product: CW-HDCD
Version: 1.0.1.0
Release: Final
Company: Cole Williams Software Limited
