
AAC-ELD decoder Refsoft user instructions:

This document describes how to checkout, compile and apply the MPEG reference software in order to decode AAC-(E)LD stereo 
bitstreams which contain Low Delay MPEG surround (LD-MPS) extension payload. Two software packages AAC-ELD and SAOC are 
needed. The MPEG Reference software uses QMF data interface between both codecs.

--------------
Download
--------------

AAC-(E)LD Refsoft decoder:
- type the following line into your browser address line, replace the PASSWORD with the 87th MPEG password and hit enter
ftp://mpeg4vm:PASSWORD@ftp.tnt.uni-hannover.de/incoming/cvs/
- choose the package
refSoft_mpeg4audio_<most recent date>.tgz


SAOC Refsoft (with LD-MPS functionality!!!):
- type the following line into your browser address line and download
http://wg11.sc29.org/svn/repos/MPEG-D/Part02-Spatial_Audio_Object_Coding/archives/SAOC_IS2_ReferenceSoftware__20110812.zip

NOTE: MPEG login and password needed here

-------------
Prerequisites
-------------

The libraries "libisomedia" and "AFsp" are needed.

UNIX:

create some folders:
- mkdir RefSoft
- cd RefSoft
- mkdir lib/
- cd lib/
- mkdir AFsp/
- mkdir libisomedia/

get libisomedia in place:
- download http://standards.iso.org/ittf/PubliclyAvailableStandards/c045527_ISO_IEC_14496-5_2001_Amd_12_2007_Reference_Software.zip
- unzip package
- cd c045527_ISO_IEC_14496-5_2001_Amd_12_2007_Reference_Software/mp4_file_format/libisomediafile/osxs/libisomediafile/
- make
- cp c045527_ISO_IEC_14496-5_2001_Amd_12_2007_Reference_Software/mp4_file_format/libisomediafile/ RefSoft/lib/libisomediafile/

get AFsp in place:
- download http://www-mmsp.ece.mcgill.ca/Documents/Downloads/AFsp/AFsp-v9r0.tar.gz
- unzip package
- cd AFsp-v9r0/
- make
- cp -r include/ RefSoft/lib/AFsp/include/
- cp -r lib/ /RefSoft/lib/AFsp/lib/
- mv RefSoft/lib/AFsp/lib/libtsplite.a RefSoft/lib/AFsp/lib/libtsp.a

Add the following variables to your environment:
for bash(Linux):
export ISOMP4_PATH=RefSoft/lib/libisomediafile/
export AFSP_LIBRARY_PATH=RefSoft/lib/AFsp/lib/
export AFSP_INCLUDE_PATH=RefSoft/lib/AFsp/include/


WIN32:

* (E)LD decoder
- create folder Refsoft\
- copy downloaded refSoft_mpeg4audio_<most recent date>.tgz into Refsoft\
- copy downloaded SAOC_IS2_ReferenceSoftware__20110812.zip into Refsoft\
- go into folder Refsoft\
- unpack refSoft_mpeg4audio_<most recent date>.tgz
- unpack SAOC_IS2_ReferenceSoftware__20110812.zip


get libisomedia in place:
- download http://standards.iso.org/ittf/PubliclyAvailableStandards/c045527_ISO_IEC_14496-5_2001_Amd_12_2007_Reference_Software.zip
- unzip package into folder Refsoft\
- go into \Refsoft\c045527_ISO_IEC_14496-5_2001_Amd_12_2007_Reference_Software\mp4_file_format\libisomediafile\w32\libisomediafile\
- open libisomedia.dsw with MS Visual 6
- build with F7
- copy \Refsoft\c045527_ISO_IEC_14496-5_2001_Amd_12_2007_Reference_Software\mp4_file_format\libisomediafile\w32\libisomediafile\Debug\libisomedia.lib to Refsoft\mpeg4Audio\import\lib
and overwrite the already existing libisomedia.lib

get Afsp in place:
- download http://www-mmsp.ece.mcgill.ca/Documents/Downloads/AFsp/AFsp-v9r0.tar.gz
- unzip package into folder Refsoft\
- go into \Refsoft\AFsp-v9r0\MSVC
- open MSVC.sln with MS Visual 2008
- build with F7
- rename \Refsoft\AFsp-v9r0\MSVC\lib\libtsplite.lib to \Refsoft\AFsp-v9r0\MSVC\lib\libtsp.lib
- copy \Refsoft\AFsp-v9r0\MSVC\lib\libtsp.lib to Refsoft\mpeg4Audio\import\lib
and overwrite the already existing libtsp.lib


* (E)LD-MPS decoder
- create \Refsoft\SAOC_IS2_ReferenceSoftware__20110812\import\AFsp\lib\
- create \Refsoft\SAOC_IS2_ReferenceSoftware__20110812\import\AFsp\include\
- create \Refsoft\SAOC_IS2_ReferenceSoftware__20110812\import\AFsp\include\libtsp
- rename \Refsoft\AFsp-v9r0\MSVC\lib\libtsplite.lib to \Refsoft\AFsp-v9r0\MSVC\lib\libtsp.lib
- copy \Refsoft\AFsp-v9r0\MSVC\lib\libtsp.lib to Refsoft\SAOC_IS2_ReferenceSoftware__20110812\import\AFsp\lib\
- copy all files in \Refsoft\AFsp-v9r0\include\* to Refsoft\SAOC_IS2_ReferenceSoftware__20110812\import\AFsp\include\
- copy all files in \Refsoft\AFsp-v9r0\include\libtsp\* to Refsoft\SAOC_IS2_ReferenceSoftware__20110812\import\AFsp\include\libtsp

-----------
Compilation
-----------

UNIX:

* (E)LD decoder
	- cd /Refsoft/mpeg4audio/mp4AudVm_Rewrite
	- call  "make"
	- the binary "mp4audec" can be found in
		/Refsoft/mpeg4audio/bin/mp4AudVm_Tbt_VmMp4AuDecRewrite/<platform>

		
* (E)LD-MPS decoder
    - cd /Refsoft/SAOC_IS2_ReferenceSoftware__20110812/mp4spatialdec
	- call  "make"
	- the binary "sac_dec_standalone" can be found in
		/Refsoft/SAOC_IS2_ReferenceSoftware__20110812/<platform>


WIN32:

* (E)LD decoder
    - go into
	    \Refsoft\mpeg4audio\mp4AudVm_Rewrite\win32\mp4v2dec
	- open mp4v2dec.dsw	with Visual 6.0
	- set Mp4v2dec as active project
	- unload projects
	    objs_dec_ssc
		objs_sls
		as they lead to compile error in the windows project
	- push F7 to build
	- the binary can be found in
	    \Refsoft\mpeg4audio\mp4AudVm_Rewrite\win32\bin\<Configuration>
	  
* (E)LD-MPS decoder	
	- go into
	    \Refsoft\SAOC_IS2_ReferenceSoftware__20110812\mp4spatialdec\win32
	- open spatialdec.dsw with Visual 6.0
	- push F7 to build
    - the binary can be found in
	    \Refsoft\SAOC_IS2_ReferenceSoftware__20110812\saoc2mps\win32\<Configuration>
	
------------------
Decode process
------------------	

* Decode AAC-ELD core yielding QMF data and embedded MPS (MPEG surround) payload:

	To decode the (E)LD MPS bitstream call the ELD refsoft decoder in the aforementioned folder (see Compilation subsection) as follows:
	
	mp4audec(.exe) -qmf extracted_QMF.dat -pay extracted_MPS_payload.bs -o extracted.wav <BITSTREAM.mp4>

	input:
	- BITSTREAM.mp4 is the output of the encoding process and serves as input here.
	output:
	- "extracted_QMF.dat" contains the complex QMF data
	- "extracted_MPS_payload.bs" contains configuration and payload
	- "extracted.wav" decoded wave file

* MPS decoding, e.g.:
  
	For AAC-ELD, decode the QMF data together with the MPS payload. Therefore, call the LD-MPS refsoft decoder in the aforementioned folder (see Compilation subsection) as follows:
    
	sac_dec_standalone -qmfin 0 extracted_QMF.dat extracted_MPS_payload.bs <OUTPUT.wav>
	
	
	input:
	- "extracted_QMF.dat"
	- "extracted_MPS_payload.bs" 
	output:
	- OUTPUT.wav is the stereo output of the LD-MPS decoding process.

	For AAC-LD, decode the mono wav data together with the MPS payload. Therefore, call the LD-MPS refsoft decoder in the aforementioned folder (see Compilation subsection) as follows:
    
	sac_dec_standalone(.exe) 0 extracted.wav extracted_MPS_payload.bs <OUTPUT.wav>
	
	
	input:
	- "extracted.wav"
	- "extracted_MPS_payload.bs" 
	output:
	- OUTPUT.wav is the stereo output of the LD-MPS decoding process.


Erlangen 15.11.2011
