ccccd: Channel Code Copy of Compact Discs
Copyright (c) 2012-2021 by Klaus Michael Indlekofer. All rights reserved.
Note: Special restrictions apply. See disclaimers below and within the distribution.

Release ccccd-6.24 (26-MAY-2021)

Email: m.indlekofer@gmx.de



Introduction:
-------------

The project "ccccd" has the goal to archive the complete content of Compact Discs (CDs)
on the channel code layer. Here, the NRZI signal which stems from the laser-pickup of
a CD-player is recorded directly, providing sort of a pit-land photo of the CD.
The resulting image file, in turn, is demodulated and decoded in software, i.e. within
a virtual CD-player. The digital audio channel code on LaserDiscs and CD Video discs
can be handled as well.



Workflow:
---------

1.) "ImgExt": extract image-file from disc, NRZI demodulation:
input for NRZI bitstream (1x bitrate = 4.3218Mbit/s): FT245R-based USB device or UDP/IP socket
test.img is the recorded image-file (in NRZ or NRZI format)

2.) "FrameSync": find and extract frames and sectors, EFM demodulation:
test.frma contains the frame start bit-addresses (1 frame = 588 bits)
test.frm contains the demodulated frames (33 bytes per frame: 1 subcode, 24 audio, 8 parity)
test.seca contains the sector start addresses (1 sector = 98 frames)
test.efmstat.txt contains infos about EFM-symbol usage
Note: requires EFM.txt as an input

3.) "Subcode": subcode decoder, sort sectors, find sessions and tracks:
test.secq contains Q-subchannel and sector usage infos
test.seca2 contains sector mapping infos
test.trka contains track infos (start addresses etc.) and session infos (TOC etc.)
test.sc contains the subcode in binary format
test.sc.txt contains a subcode summary in text format
test.pq.txt contains the P and Q subchannels in text format
test.cdg contains the decoded R,S,T,U,V,W subchannels in binary format (for CD+G)
test.rstuvw.txt contains the decoded R,S,T,U,V,W subchannels in text format

4.) "TrackExt": CIRC decoder, extract tracks:
test.dout, test_T01_X01.dout, ... are temporary files
test.errdout, test_T01_X01.errdout, ... are temporary files
test.dout.txt, test_T01_X01.dout.txt, ... are temporary files
test.wav, test_T01_X01.wav, ... contain the audio samples in WAV format (with cue points)
test.err.wav, test_T01_X01.err.wav, ... contain the sample error flags in WAV format (with cue points)
test.wav.txt, test_T01_X01.wav.txt, ... contain infos about the wav-file in text format
test_T01_X01.sc, ... contain the subcode in binary format
test_T01_X01.cdg, ... contain the R,S,T,U,V,W subchannels in binary format
test.dfrm, test_T01_X01.dfrm, ... contain the audio/data output frames
test.errdfrm, test_T01_X01.errdfrm, ... contain the audio/data output frame error flags
test.dfrm.txt, test_T01_X01.dfrm.txt, ... contain infos about the dfrm-file in text format
if a new test.frm file is created (recursion), testO.frm is the previous file
if a new test.seca file is created (recursion), testO.seca is the previous file

5.) "DSecExt": find and extract data sectors (CD-ROM, CD-I, CD-ROM XA, pregap CD-DA), RSPC ECC, EDC:
test.dseca, test_T01_X01.dseca, ... contain the data sector start addresses
test.dsec, test_T01_X01.dsec, ... contain the data sectors
test.dsec.txt, test_T01_X01.dsec.txt, ... contain infos about data sectors in text format

6.) "dsec2iso": convert CD-ROM / CD-ROM XA / CD-I / pregap CD-DA dsec-file to iso-file
test.iso, test_T01_X01.iso, ... are the iso-files

7.) "dsec2mpg": convert Video CD dsec-file to mpg-file
test.mpg, test_T01_X01.mpg, ... are the mpg-files



Notes:
------

* log-files are used to save parameters and console logs

* this version is incomplete, exhibits sub-optimal algorithms, and might be buggy

* file formats may change with a new version

* supported disc formats:
  Compact Disc (CD)
  digital audio on LaserDisc (LD) and CD Video (CD-V)

* optional audio monitoring function for ImgExt:
  can produce high level signals which could be unsuitable for audio reproduction systems (e.g. loudspeakers),
  the usage of the audio monitoring function is at the user's own risk

* ImgExt requires a proprietary hardware interface to readout the signal from the laser-pickup of a CD-player,
  for example using an FTDI FT245R USB FIFO and other components

* This software is licensed under the GNU General Public License (http://www.gnu.org/licenses/).

* This sofware uses D2XX driver software by FTDI (http://www.ftdichip.com/).
  D2XX driver software can be obtained from: https://www.ftdichip.com/Drivers/D2XX.htm
  FTDI Driver License Terms: https://www.ftdichip.com/Drivers/FTDriverLicenceTermsSummary.htm
  ImgExt requires the following D2XX driver files:
  under Windows 64bit: ftd2xx.h, amd64/ftd2xx.lib, amd64/ftd2xx64.dll
  under Windows 32bit: ftd2xx.h, i386/ftd2xx.lib, i386/ftd2xx.dll
  under Linux: ftd2xx.h, WinTypes.h, /usr/lib/libftd2xx.so
  under Mac OSX: ftd2xx.h, WinTypes.h, /usr/local/lib/libftd2xx.dylib

* This sofware uses Qt (https://www.qt.io/),
  licensed under the GNU Lesser General Public License version 3 (http://www.gnu.org/licenses/lgpl-3.0.txt).
  Qt (in particular its sources) can be obtained from:
	https://www.qt.io/download/ (and previously http://qt.nokia.com/downloads/)
	https://www.qt.io/download-open-source/
	https://www.qt.io/offline-installers/

* the Windows 64bit Qt5 version of ccccd can be compiled by using the ccccdqt64.pro file
  the following files are required from Qt5:
  libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll, Qt5Core.dll, Qt5Gui.dll, Qt5Multimedia.dll, Qt5Network.dll, Qt5Widgets.dll

* the Windows 32bit Qt4 version of ccccd can be compiled by using the ccccdqt32.pro file
  the following files are required from Qt4:
  libgcc_s_dw2-1.dll, mingwm10.dll, pthreadGC2.dll, QtCore4.dll, QtGui4.dll, QtMultimedia4.dll

* the Linux Qt5 version of ccccd can be compiled by using the ccccdqtl.pro file

* the Linux command line (batch mode) version of ccccd
  uses PulseAudio (https://www.freedesktop.org/wiki/Software/PulseAudio/)
  if "PULSEAUDIO=1" is defined during compilation by using Makefile.console (see below)

* the Mac OSX Qt4 version of ccccd can be compiled by using the ccccdqtm.pro file

* the command line (batch mode) version of ccccd can be compiled
  by using the Makefile.console file in the following way:
  under CYGWIN 64bit:          "make -f Makefile.console CYGWIN=1"
  under CYGWIN 32bit:          "make -f Makefile.console CYGWIN=1 WINDOWS32=1"
  under Linux:                 "make -f Makefile.console PULSEAUDIO=1"
  under Mac OSX:               "make -f Makefile.console"
  under Visual C++ 8.0 32bit:  use the ccccd32.vcproj file

* usage of the command line (batch mode) version of ccccd:
  the command line version reads parameters (in log-file format) from stdin
  and optionally accepts fname as an argument
  usage examples:
  "./ccccd myfname < /dev/zero"
  "./ccccd otherfname < myparams.log"
  "./ccccd < batchinput.log > batchoutput.log 2> /dev/null"
  "./ccccd < audiomonitor.log > /dev/null"
  "./ccccd myfname < imgplayback.log > /dev/null"



References:
-----------
* "Red Book" Standard IEC 60908:1999
* "Yellow Book" Standard ECMA-130
* "Orange Book Part II Volume 2" Standard ECMA-394
* "Laser vision" Standard IEC 60856/A2
* "Laser vision" Standard IEC 60857/A2
* "CD Video" Standard IEC 61104
* "ITTS" Standard IEC 61866
* H. Peek, J. Bergmans, J. van Haaren, F. Toolenaar, and S. Stan: "Origins and Successors of the Compact Disc",
  Philips Research Book Series, Volume 11, Springer (2009)
* K. C. Pohlmann: "Principles of Digital Audio", McGraw-Hill (2010)
* J. Watkinson: "The Art of Digital Audio", Focal Press (2000)
* K. M. Indlekofer and M. Dietrich: "Channel Code Copy of Compact Discs",
  Tagungsband 27. Tonmeistertagung (VDT International Convention, Kln), ISBN 978-3-9812830-3-7, 369-374 (2012)
* K. M. Indlekofer and R. Hedtke: "Archivierung digitaler Audio- und Videospeichermedien
  auf der Ebene des Leitungs- oder Kanalcodes", FKT 5, 240-245 (2013)
* FTDI D2XX drivers: https://www.ftdichip.com/Drivers/D2XX.htm
* http://www.ftdichip.com/Support/Documents/ProgramGuides/D2XX_Programmer%27s_Guide(FT_000071).pdf
* Qt: https://www.qt.io/ (and previously http://qt.nokia.com/)
* PulseAudio: https://www.freedesktop.org/wiki/Software/PulseAudio/
* GNU licenses: http://www.gnu.org/licenses/
* Note: EFM.txt was created according to the standard ECMA-130
* Note: information about de-interleaving and CIRC check matrices is given in the standard ECMA-130
* Note: Compact Disc principles are described in publications
  by K. Odaka, Y. Sako, I. Iwamoto, T. Doi, K. B. Vries and others
* Note: additional information about the TOC structure is given in http://www.fr-an.de/projects/02/dc4302.htm



---
The following holds for all files in this distribution (unless stated otherwise on an
individual basis for each file and statement):

These program/data/document/HTML/picture/media files (materials) are distributed in the
hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. In no event shall the author be
liable for any direct, indirect, incidental, special, exemplary, or consequential damages
(including, but not limited to, procurement of substitue goods or services; loss of use,
data, or profits; or business interruption) however caused and on any theory of liability,
whether in contract, strict liability, or tort (including negligence or otherwise) arising
in any way out of the use of data/information/software from this distribution, even if
advised of the possibility of such damage. 

The contents of this distribution are intended for educational, non-commercial purposes
only. Materials contained herein are property of their respective owners.
All brand names and trademarks are property of their respective owners.
If any copyrighted works/trademarks have been used, please contact the author
and the item will be either removed or properly credited (at the copyright/trademark
owner's discretion). We have no intention of violating any copyrights or trademarks.
This distribution might use inlining and deep-linking, i.e. links in this distribution
might lead directly to materials on other web sites/distributions (in which case the
target page normally should be listed/credited in a "links" section). The author does
not take responsibility for the contents of any links referred to. We do not necessarily 
endorse, sanction, support, encourage, verify or agree with the contents, opinions or
statements of/on any of the linked pages. These statements hold for all links/references
in all files in this distribution. We are in no way affiliated with any
companies/institutions/individuals which might be mentioned in any manner in this
distribution.

The author does not take responsibility for incorrect, incomplete or misleading information.
Statements are to be considered as the author's free personal opinion. The author does not
necessarly possess any of the items mentioned in files in this distribution.

Files (and the information therein) created by the author are copyright
(c) by the author. Unless protected/restricted otherwise, the author permits
reproduction/redistribution of material contained in this distribution under the condition
that the item is properly credited. Links to items/materials in this distribution are welcome.
Projects/publications/papers that make use of materials, programs, or generated output
of this distribution must properly credit the author and mention the usage of this distribution.
Please contact the author for comments or further questions
and permission to use materials/information from this distribution.



---
End of file

