Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th September 2014, 15:44   #41  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,177
Try doing what I did and 'cheat' MuxMan into thinking the DTS stream is compliant...

All you have to do is chop-off and save a few milliseconds from the beginning of a compliant (2013 bytes/frame) elementary DTS stream. And add it to the beginning of your 'non compliant' elementary DTS stream
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 16th September 2014, 16:40   #42  |  Link
MrC
AVStoDVD Dev
 
MrC's Avatar
 
Join Date: Apr 2006
Location: Italy
Posts: 1,246
Quote:
Originally Posted by filler56789 View Post
Actually, they are sufficient, IF/WHEN reported correctly. At 48kHz, and with 512 samples per frame,

1006 bytes per frame = 754.500kbps
1024 bytes per frame = 768.000kbps

2013 bytes per frame = 1509.750kbps
2048 bytes per frame = 1536.000kbps
Good point, hence 'bytes per frame' is a derivative property, having bitrate and 'samples per frame'. Still we must be sure that:

'samples per frame' = 512

or is that a constant for DTS?



Bye
__________________
MrC

AVStoDVD Homepage
AVStoDVD @ Doom9 Forum
MrC is offline   Reply With Quote
Old 16th September 2014, 16:54   #43  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 8,851
DTS can in theory go up to 4096 samples per frame, although 512 seems to be the most common at 48kHz.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 16th September 2014, 16:59   #44  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 795
AFAIK, all DCA encoders available (and they are not many ) use 512 samples per audio frame.

Also, I presume/hope that eac3to, LeeAudBi and MediaInfo take the time to measure the frame size,
instead of assuming it always = 512 samples.

Last edited by filler56789; 16th September 2014 at 17:16. Reason: better wording
filler56789 is offline   Reply With Quote
Old 17th September 2014, 08:53   #45  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,192
512 is the standard value but is not mandatory.
From http://www.etsi.org/deliver/etsi_ts/...14v010301p.pdf

NBLKS (Number of PCM Sample Blocks)
This field indicates that there are (NBLKS+1) blocks (a block = 32 PCM core samples per channel, corresponding to
the number of PCM samples that are fed to the core filter bank to generate one subband sample for each subband) in the
current frame (see note). The actual core encoding window size is 32 × (NBLKS+1) PCM samples per channel. Valid
range for NBLKS: 5 to 127. Invalid range for NBLKS: 0 to 4. For normal frames, this indicates a window size of either
4 096, 2 048, 1 024, 512, or 256 samples per channel.

EDIT:
To know the Actual Bitrate you need the fields from DTS header:
NBLKS (Number of PCM Sample Blocks)

FSIZE (Primary Frame Byte Size)
(FSIZE+1) is the total byte size of the current frame including primary audio data as well as any extension audio data.
Valid range for FSIZE: 95 to 16 383. Invalid range for FSIZE: 0 to 94.

SFREQ (Core Audio Sampling Frequency)
This field specifies the sampling frequency of audio samples in the core encoder, based on Table 5-5:
Code:
Table 5-5: Core audio sampling (valid) frequencies
0b0001   8 kHz
0b0010  16 kHz
0b0011  32 kHz
0b0110  11,025 kHz
0b0111  22,05 kHz
0b1000  44,1 kHz
0b1011  12 kHz
0b1100  24 kHz
0b1101  48 kHz
Now the Actual Bitrate (in Kb/s if Sampling frequency in KHz) is:

8 x (FSIZE + 1) x Sampling-rate / (32 x (NBLKS + 1))

Examples:
8 x (2012 + 1) x 48 / (32 x (15 + 1)) = 1509,75 Kb/s
8 x (2011 + 1) x 48 / (32 x (15 + 1)) = 1509 Kb/s
8 x (1005 + 1) x 48 / (32 x (15 + 1)) = 754,5 Kb/s

Seems MediaInfo 0.7.70 (in Advanced mode) can detect the exact FSIZE for NBLKS 15 (standard value). For the 3 samples before:

Overall bit rate : 1509750
Overall bit rate : 1 510 Kbps

Overall bit rate : 1509000
Overall bit rate : 1 509 Kbps

Overall bit rate : 754500
Overall bit rate : 755 Kbps

EDIT 2:
I found dts's from surround Audio CD's with 1024 samples/frame:

Code:
Number of PCM Sample Blocks .: 31 ( 1024 samples/frame)
Primary Frame Byte Size .....: 3583 ( 3584 bytes/frame)
Audio Channel Arrangement ...: 9 (5 C + L + R + SL + SR)
Core Audio Samp. Frequency ..: 8 (44,1 kHz)
Transmission Bit Rate .......: 22 (1411,2 Kb/s)
Actual Bitrate = 8 x (3583 + 1) x 44,1 / (32 x (31 + 1)) = 1234,8 Kb/s

MediaInfo show ok:
Bit rate : 1234800
Bit rate : 1 235 Kbps

BTW, ffdcaenc with -b 1411.2 for 44.1 KHz make:

Code:
Number of PCM Sample Blocks .: 15 ( 512 samples/frame)
Primary Frame Byte Size .....: 2047 ( 2048 bytes/frame)
Audio Channel Arrangement ...: 9 (5 C + L + R + SL + SR)
Core Audio Samp. Frequency ..: 8 (44,1 kHz)
Transmission Bit Rate .......: 22 (1411,2 Kb/s)
With Actual Bitrate = Transmission Bit Rate
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.

Last edited by tebasuna51; 17th September 2014 at 12:07. Reason: Add info
tebasuna51 is offline   Reply With Quote
Old 17th September 2014, 15:24   #46  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 795
Thanks for the complete info, tebasuna51

Quote:
Originally Posted by tebasuna51 View Post
EDIT 2:
I found dts's from surround Audio CD's with 1024 samples/frame:
It would be very-interesting to know what was the software (or firmware?) that was used for producing that DCA stream...

BTW, and according to the file 4_dts-cae-4_cad-4_encode-decode.pdf,
there exist two more "DVD-compliant" bitrates
(for 2.0 and 2.1 only),

503.25kbps and 377.25kbps

And yes, the «1-byte granularity» strikes again

EDIT: Wow, ffdcaenc already supports them too

Code:
File ........: D:\DVD-18\mlpdir\48tunntest.dts
Size ........: 4844620 bytes

----------------------------------------- First Frame Info
CRC present .................: 0 (Not)
Number of PCM Sample Blocks .: 15 ( 512 samples/frame)
Primary Frame Byte Size .....: 670 ( 671 bytes/frame)
Audio Channel Arrangement ...: 2 (2 L + R stereo)
Core Audio Samp. Frequency ..: 13 (48 kHz)
Transmission Bit Rate .......: 12 (512 Kb/s)
Embedded Down Mix Enabled ...: 0 (Not)
Embedded Dynamic Range Flag .: 0 (Not)
Embedded Time Stamp Flag ....: 0 (Not)
Auxiliary Data Flag .........: 0 (Not)
Mastered in HDCD format .....: 0 (Not)
Extension Audio Descr. Flag .: 0 (Channel Extension XCh)   
Extended Coding Flag ........: 0 (Not)
Audio Sync Word Insert. Flag : 0 (Sub-frame)
Low Frequency Effects Flag ..: 0 (Not present)
Predictor History Flag Switch: 1 (Yes)
Multirate Interpolator Switch: 0 (Non-perfect Reconstruction)
Encoder Software Revision ...: 7 (Current)
Copy History ................: 0 (Definition deliberately omitted)
Source PCM Resolution .......: 6 (24 bits)
Front Sum/Difference Flag ...: 0 (Not)
Surrounds Sum/Difference Flag: 0 (Not)
Dialog Normalization Param. .: - 0 dB
--------------------------------------------- Revised Info
Total Frames ......: 7220 
Duration ..........: 77.013 seconds. ( 0 h. 1 m. 17.013 s.)
------------------------------------------------- End Info

Last edited by filler56789; 17th September 2014 at 15:33.
filler56789 is offline   Reply With Quote
Old 17th September 2014, 15:47   #47  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,177
Quote:
Originally Posted by filler56789 View Post
BTW, and according to the file 4_dts-cae-4_cad-4_encode-decode.pdf,
there exist two more "DVD-compliant" bitrates
(for 2.0 and 2.1 only),

503.25kbps and 377.25kbps

And yes, the «1-byte granularity» strikes again
This being the case, it would probably make sense if the GUI's in DTS encoders were only able to offer the 'compliant' bit-rate levels, ie: 2.0 channel DTS-CD (if it exists), 5.1 channel DTS-CD, 2.0 channel DVD, 2.1 channel DVD, 5.1 channel DVD, etc...
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 9th December 2014, 03:44   #48  |  Link
siella
Registered User
 
siella's Avatar
 
Join Date: Mar 2007
Location: Turkey
Posts: 65
I tried ffdcaenc.exe-213_GCC.7z but stdin didnt work.

Code:
Input:   -
Output:  G:\001.dts
Bitrate: 1509 kbps

Encoding... 0:00 [100.0%]
Done.
stdin is working with ffdcaenc.2014-07-27.win32
__________________
Behappy
BePack.v3.2BeHappy,BeSweet,BeLight,BeSplit,BeSliced,BdAC) with last plugin, encoder and extensions.
Avisynth Movie Screenshot, thumbnails creator

Last edited by siella; 9th December 2014 at 03:48.
siella is offline   Reply With Quote
Old 9th December 2014, 04:35   #49  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 795
Quote:
Originally Posted by siella View Post
I tried ffdcaenc.exe-213_GCC.7z but stdin didnt work.

Code:
Input:   -
Output:  G:\001.dts
Bitrate: 1509 kbps

Encoding... 0:00 [100.0%]
Done.
stdin is working with ffdcaenc.2014-07-27.win32
Thanks for reporting.
I will TRY to fix the problem, since I'm not a programmer ---
--- therefore, no guarantees...

Last edited by filler56789; 9th December 2014 at 10:39. Reason: update
filler56789 is offline   Reply With Quote
Old 9th December 2014, 11:18   #50  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 795
FIXED - or at least I think so

Code:
637	#if defined(_WIN32) || defined(_WIN64)
638	
639	#include <Windows.h>
640	#include <io.h>
641	#include <fcntl.h>
642	
643	int32_t main( int32_t argc, char **argv )
644	{
645		_setmode(_fileno(stdin),  _O_BINARY);
646		_setmode(_fileno(stdout), _O_BINARY);
647		return dcaenc_main(argc, argv);
648	}
649	
650	#else
651	
652	int32_t main( int32_t argc, char **argv )
653	{
654		return dcaenc_main(argc, argv);
655	}
656	
657	#endif
Attached Files
File Type: 7z ffdcaenc_213-20141209.7z (109.7 KB, 366 views)

Last edited by filler56789; 9th December 2014 at 12:41. Reason: add code
filler56789 is offline   Reply With Quote
Old 9th December 2014, 14:31   #51  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,182
Quote:
Originally Posted by filler56789 View Post
FIXED - or at least I think so
The following lines should be better...

Code:
637	#if defined(_WIN32) || defined(_WIN64)
638	
639	#include <Windows.h>
640	#include <io.h>
641	#include <fcntl.h>
642	#endif

643	int32_t main( int32_t argc, char **argv )
644	{
645          #if defined(_WIN32) || defined(_WIN64)
645		 _setmode(_fileno(stdin),  _O_BINARY);
646		 _setmode(_fileno(stdout), _O_BINARY);
647          #endif		
648          return dcaenc_main(argc, argv);
649	}
650
Kurtnoise is offline   Reply With Quote
Old 9th December 2014, 15:53   #52  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 795
Quote:
Originally Posted by Kurtnoise View Post
The following lines should be better...

Code:
637	#if defined(_WIN32) || defined(_WIN64)
638	
639	#include <Windows.h>
640	#include <io.h>
641	#include <fcntl.h>
642	#endif

643	int32_t main( int32_t argc, char **argv )
644	{
645          #if defined(_WIN32) || defined(_WIN64)
645		 _setmode(_fileno(stdin),  _O_BINARY);
646		 _setmode(_fileno(stdout), _O_BINARY);
647          #endif		
648          return dcaenc_main(argc, argv);
649	}
650
Merci beaucoup
filler56789 is offline   Reply With Quote
Old 10th December 2014, 04:04   #53  |  Link
siella
Registered User
 
siella's Avatar
 
Join Date: Mar 2007
Location: Turkey
Posts: 65
Many thanks, it is working without any problem now
__________________
Behappy
BePack.v3.2BeHappy,BeSweet,BeLight,BeSplit,BeSliced,BdAC) with last plugin, encoder and extensions.
Avisynth Movie Screenshot, thumbnails creator
siella is offline   Reply With Quote
Old 15th February 2016, 15:57   #54  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 795
Quote:
Originally Posted by filler56789 View Post
Sooner or later, I will have to update ffdcaenc's "README2.TXT" @ GitHub.
Even better, I wrote a new file — DECODING_ISSUES.TXT.

https://raw.githubusercontent.com/fi...ING_ISSUES.TXT
filler56789 is offline   Reply With Quote
Old 6th June 2016, 05:58   #55  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 795
Better late than jamais... I added a configure file to the source-code, so that the users don't need to mess around with autoreconf anymore...

https://github.com/filler56789/ffdcaenc-2/releases
filler56789 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:11.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.