Steven M. Schultz wrote:
>>i'm trying to create a dvd video with an lpcm
>>soundtrack that has a sample size of 24 bits and a
>>sample frequency of 48 kHz.  when i run mplex:
>>
> 
>>are there problems with mplex and lpcm audio?  if so,
> 
> 
>       No, there are not any known problems if you give mplex a lpcm audio
>       file.
> 
>       There are problems with a WAV files though.  Strip off the WAV header
>       and produce a 'raw' LPCM file and it will work. 

Unfortunately, it's not quite as simple as that for 24-bit audio.

For 24-bit audio, the method of packing of the data in the LPCM stream
is different to a WAV file.

I've been working on DVD-Audio authoring, and the same packing for
24-bit samples is used there (in the .AOB files).  As an example, here
are 12 bytes of data from a 24-bit stereo WAV file and the same data in
an LPCM stream in a VOB/AOB file:

WAV: 01 23 45 bf 60 8c 67 89 ab b7 d4 e3
AOB: 45 23 8c 60 ab 89 e3 d4 01 bf 67 b7

A WAV file is little-endian, so it consists of the samples 0x452301
(sample 0, left), 0x8c60bf (sample 0, right), 0xab8967 (sample 1, left),
0xe3d4b7 (sample 1, right).

As you can see, the packing consists of the most significant 16-bits of
the four samples (in big-endian byte order), followed by the least
significant 8 bits of the four samples.

The following unoptimised C code performs the above manipulation - you
must ensure that the PCM data is a multiple of 12 bytes, if necessary by
padding the end of the stream with an extra sample.

for (i=0;i<count;i+=12) {
  x=buf[i];
  buf[i]=buf[i+2];
  buf[i+2]=buf[i+5];
  buf[i+5]=buf[i+7];
  buf[i+7]=buf[i+10];
  buf[i+10]=buf[i+6];
  buf[i+6]=buf[i+11];
  buf[i+11]=buf[i+9];
  buf[i+9]=buf[i+3];
  buf[i+3]=buf[i+4];
  buf[i+4]=buf[i+8];
  buf[i+8]=x;
}

I don't know if any tools exist to do this manipulation.

But if anyone is interested in a simple "vts2wav" tool (i.e. the reverse
 process) that handles 24-bit audio, there is one in my dvd-audio
project CVS repository (under the "tools" module).  Follow the CVS links
on the following page:

http://dvd-audio.sourceforge.net/

Regards,

Dave.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to