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 2nd July 2006, 18:16   #1  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,182
Aften 0.0.8 is out

Just found this at HA.org...and it sounds promizing.

Quote:
Aften is a simple, open-source, A/52 (AC-3) audio encoder.

The name, Aften, is an acronym for:
A / Fifty-Two ENcoder
It is also Danish and Norwegian for 'evening'.

This program started as a simple cutting-out of the AC3 encoder from FFmpeg, but then I reworked the structure of the encoder a bit. Most of the basic code is still the same though. Here are some of the things I've changed so far.

* Implemented my own wav reader and bitwise file writer
* Converted the fixed-point algorithms to floating-point
* Rearranged the methods and structures
* Added stereo rematrixing (mid/side)
* Added short block MDCT and block switching
* Added VBR encoding mode

Future Plans

* Variable bandwidth
* Channel coupling

Changelog of the last release:
Quote:
* fixed piped input from FFmpeg
* added support for MPEG channel order remapping
* restructured audio input. enables raw pcm file support.
* bugfixes in MMX/SSE2 code
* stack align hack for x86 MinGW with threads
* API changes
* SIMD and threads usage is shown and is configurable
* screen output gets updated every 200ms to reduce load
* SIMD detection changed to compiler-independent inline assembly, thus nasm/yasm not needed anymore
So, I've made a compile for win32 OS and I added pipeline & 2 switches for CBR and VBR Mode. Could be great if somebody can test multichannel encoding also.
  • Command Line example for VBR :
    Code:
    aften -q 300 input.wav output.ac3
  • Command Line example for CBR :
    Code:
    aften -b 256 input.wav output.ac3
  • Command Line example with pipeline :
    Code:
    aften -q 320 - output.ac3

Last edited by Kurtnoise; 10th September 2007 at 08:41.
Kurtnoise is offline   Reply With Quote
Old 3rd July 2006, 06:03   #2  |  Link
vmesquita
Registered User
 
Join Date: Mar 2003
Posts: 126
I've tested with a 6-channel WAV produced by BeSweet from an AC3 file and it worked. However I can't tell if the channels were mapped correctly because I don't have a good home theater...
__________________
VMesquita

My Tools:
DIKO
FreeEnc: AVS->MPEG2 Encoder
Get them here: http://www.vmesquita.com
vmesquita is offline   Reply With Quote
Old 5th July 2006, 22:39   #3  |  Link
vmesquita
Registered User
 
Join Date: Mar 2003
Posts: 126
Did a test using A test file and AC3Filter, and channel mapping is incorrect (relating to BeSweet output).

EDIT:
I've tried to fix this in BeSweet using this:
Code:
D:\Temp\besweet>BeSweet.exe -core( -input "D:\Temp\besweet\6ch.ac3" -output "D:\Temp\besweet\6ch.wav"  -6chwav ) -azid( -o l,c,r,sl,sr,lfe)
However the switch doesn't seem to be working, or maybe the sintax is wrong.
__________________
VMesquita

My Tools:
DIKO
FreeEnc: AVS->MPEG2 Encoder
Get them here: http://www.vmesquita.com

Last edited by vmesquita; 6th July 2006 at 00:18.
vmesquita is offline   Reply With Quote
Old 6th July 2006, 10:20   #4  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,182
Could you test this sample please ?

This is not made with BeSweet. It's just for testing channel mapping.
Kurtnoise is offline   Reply With Quote
Old 7th July 2006, 02:36   #5  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,253
Quote:
Originally Posted by Kurtnoise13
Could you test this sample please ?

This is not made with BeSweet. It's just for testing channel mapping.
The sample seems ok.
tebasuna51 is offline   Reply With Quote
Old 7th July 2006, 14:28   #6  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,208
Or you could try this sample
__________________
| 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 8th July 2006, 17:56   #7  |  Link
danpos
BDVD Team
 
danpos's Avatar
 
Join Date: Dec 2004
Location: Rio de Janeiro - RJ/Brasil
Posts: 306
Quote:
Originally Posted by SeeMoreDigital
Or you could try this sample
Hi there! VMesquita had tried your sample out already (I sent it to him ). BTW, it's a very usefull ac3 5.1 sample for channels mapping tests. Thanks for share it.

See you,
danpos is offline   Reply With Quote
Old 9th July 2006, 02:49   #8  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,253
@Kurtnoise
If you want improve the aften encoder I have two suggestions

1) To make a correct channel remapping we can replace the Int to Float routine at aften.c (line 125):
Code:
for(i=0; i<A52_FRAME_SIZE*wf.channels; i++) {
    if(i < nr*wf.channels)
        fwav[i] = wav[i] / 32768.0;
    else
        fwav[i] = 0.0;
}
With this new one:
Code:
if(wf.channels == 6) {
    for(i=0; i<A52_FRAME_SIZE*6; i+=6) {
        if(i < nr*6) {
            fwav[i] = wav[i] / 32768.0;      // FL
            fwav[i+1] = wav[i+2] / 32768.0;  // C
            fwav[i+2] = wav[i+1] / 32768.0;  // FR
            fwav[i+3] = wav[i+4] / 32768.0;  // SL
            fwav[i+4] = wav[i+5] / 32768.0;  // SR
            fwav[i+5] = wav[i+3] / 32768.0;  // LFE
        }
        else
            for(j=0; j<6; j++) fwav[i+j] = 0.0;
    }
}
else {
    for(i=0; i<A52_FRAME_SIZE*wf.channels; i++) {
        if(i < nr*wf.channels)
            fwav[i] = wav[i] / 32768.0;
        else
            fwav[i] = 0.0;
    }
}

2) New parameters, valid values and default, to be passed to output_frame_header (a52enc.c):

-c 0,1,2 Default: 0 (-3,-4.5,-6 dB) Center Mix Level
-s 0,1,2 Default: 0 (-3,-6,0 dB) Surround Mix Level
-d 0,1,2 Default: 0 (Ignored,Not,Yes) Dolby Surround Mode
-n 0..31 Default: 31 (-0..-31 dB) Dialogue normalization
tebasuna51 is offline   Reply With Quote
Old 10th July 2006, 09:39   #9  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,253
@vmesquita
Thanks, but in your .rar the aften.exe is missing.
tebasuna51 is offline   Reply With Quote
Old 10th July 2006, 10:28   #10  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,182
Allright...I patched tebasuna stuff and merged it with the 0.01 version.

Quote:
Originally Posted by Justin Ruggles
Thanks to some improvements posted on the doom9 forum, I have done some work on Aften today and released a new version.

http://jbr.homelinux.org/aften/aften-0.01.tar.bz2

* simple configure script
* piped input and output
* corrected 6-channel mapping
* corrected defaults for mix levels
* commandline options
* quiet mode (no console output)
* per-frame or average statistics
* big-endian support (not tested though)
I had PMed Justin to this thread. Download here.
Kurtnoise is offline   Reply With Quote
Old 10th July 2006, 12:28   #11  |  Link
vmesquita
Registered User
 
Join Date: Mar 2003
Posts: 126
@tebasuna51
Sorry, here is the full package:
http://www.mytempdir.com/795181
__________________
VMesquita

My Tools:
DIKO
FreeEnc: AVS->MPEG2 Encoder
Get them here: http://www.vmesquita.com
vmesquita is offline   Reply With Quote
Old 10th July 2006, 18:27   #12  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,253
@vmesquita
Thanks for your job, but maybe there are a problem because your aften.exe never finish to encode. Stoped with Ctrl-C, the first part is ok and after a long silence. The parameters are taken ok.

@kurtnoise
Your new version works fine for me. Thanks for the patch.

In firsts tests I detected:
Aften accept any wav type, but only work with 16 bit Int wav's. With 24,32 bit Int or float the resultant ac3 is unusable. With 8 bit Int Aften abort.
Accept also WAVE_FORMAT_EXTENSIBLE (16 bit Int), then the faad output can be used directly with Aften.

Tested also the pipe issue with AviSynth based Bepipe and BeHappy.

Edit: More tests (not important because isn't frequently used)

wav_3chan, acmod used 3 (L,C,R) needed remap [0,2,1], the acmod 4 (L,R,S) is not accesible (remap not needed)

wav_4chan, acmod used 6 (L,R,SL,SR) remap not needed, the acmod 5 (L,C,R,S) is not accesible (needed remap [0,2,1,3])

wav_5chan, acmod used 7 (L,C,R,SL,SR) needed remap [0,2,1,3,4] (without LFE).

Edit 2: Work also with wav > 4GB
Test with wav 4.2 GB, 6 chan, 130 min. encoded in 12 min. in a P IV 2.4GHz

Last edited by tebasuna51; 10th July 2006 at 21:17.
tebasuna51 is offline   Reply With Quote
Old 10th July 2006, 22:10   #13  |  Link
vmesquita
Registered User
 
Join Date: Mar 2003
Posts: 126
@tebasuna51
Thanks for the test, I'll check this. I have tested with a small 6h wav and Six Waves and it seemed to work fine (with no need for ^C). I'll run more testes to try to reproduce the issue.
__________________
VMesquita

My Tools:
DIKO
FreeEnc: AVS->MPEG2 Encoder
Get them here: http://www.vmesquita.com
vmesquita is offline   Reply With Quote
Old 11th July 2006, 12:23   #14  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,253
After the test I think Aften is the best free ac3 encoder.

I want compare the options with the old reference encoder Sonic Foundry SoftEncode (in speed Aften is clearly the winner, Softencode need hours to encode a 6 chan 130 min long):

Audio service configuration
There are some more options in SoftEncode
-Audio coding mode: mode 4 (L,R,S) and mode 5 (L,C,R,S)
-Bit stream mode: other than Main audio service. Complete main
-Save frames in Intel byte order
I don't need this options.

Bit Stream
-Copyright bit
-Original bit stream
-Audio production information
Default is ok for me.

Preprocessing
-Input filtering->Digital deemphasis
-Input filtering->DC high-pass filter
-Input filtering->Bandwidth low-pass filter
-Input filtering->LFE low-pass filter
-Surround channel processing->90 degree phase shift
-Surround channel processing->3 dB atenuation
All this utilities can be applied to the wav input before the encoder process.
-Dynamic range compression (DRC):
This info must be generated be the encoder and, I think, is the more important difference between free and commercial encoders at this moment.

Conclusions
To improve Aften encoder there are two priorities for me:
-Generate DRC info. I know is not easy, and out of my knowledge, but I think is important.
-Accept 32 bit Int and Float wav's. If we have a more precise source we lose quality converting to 16 bit Int to be accepted by Aften. I can collaborate with this point if needed.

Questions
About ac3 VBR. Is compatible with avi container and DVD authoring programs?

@Kurtnoise. What is the difference between aften.exe and aften_g.exe in your last pack?
tebasuna51 is offline   Reply With Quote
Old 11th July 2006, 14:38   #15  |  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 tebasuna51
What is the difference between aften.exe and aften_g.exe in your last pack?
Honestly, I don't know...I tested both and compared bits-to-bits each results : this is the same. I hope that Justin can access as soon as possible in doom9 forum to give some answers.

Otherwise, you can post some notes here.

About compatibility for AVI container : I think this is the same thing like mp3 vbr.

Only worries I have come from vbr mode. Some decoders aren't able to decode/play properly this kind of files (at least on windows). With some Dshow filters like AC3 parser + AC3 filter, it works fine though.
Kurtnoise is offline   Reply With Quote
Old 11th July 2006, 18:40   #16  |  Link
raquete
Registered User
 
Join Date: Nov 2004
Posts: 741
@ Kurtnoise13
have a new aften version in the homepage
http://jbr.homelinux.org/aften/

thanks

@ tebasuna51
Quote:
After the test I think Aften is the best free ac3 encoder.
good to know.

ot:
i don't know command lines.can you(anyone) please do one single "how to" ?
raquete is offline   Reply With Quote
Old 26th July 2006, 04:42   #17  |  Link
raquete
Registered User
 
Join Date: Nov 2004
Posts: 741
Quote:
Originally Posted by tebasuna51
After the test I think Aften is the best free ac3 encoder.

I want compare the options with the old reference encoder Sonic Foundry SoftEncode (in speed Aften is clearly the winner, Softencode need hours to encode a 6 chan 130 min long)
Quote:
Originally Posted by Mug Funky
this sounds exciting...
Quote:
Originally Posted by danpos
I did encode a batchlist with 5 waves files to AC3, using the same settings than I use with SoftEncode and the resulting AC3 files working great (and the time for total batch encode was very quick compared with SoftEncode).
good posts!

i confirm.
Aften is faster,the sound have more "punch" and is more clever than from softencode(that i removed from my system).
another detail is that softencode use "low pass filter"(20 ~ 120Hz) to encode LFE and Aften encode my .wavs 6 channels without change my parameters.

AftenGui is now my "emperor" AC-3 encoder.

Kurtnoise13 & jruggle (tebasuna51 and all that help)
congratulations!
raquete is offline   Reply With Quote
Old 26th July 2006, 07:58   #18  |  Link
Rockaria
nobody's nobody
 
Join Date: Mar 2005
Location: The Sun, somewhere around
Posts: 553
I kinda feel the seniority or maturity on everything in this project. C not c++ nor net and ,, java (itself is a perfect language in the server level computing), by gathering lots of interests and satisfactions already with the v0.03, and having the clear objectives and open approaches, not necessarily driven by the NEW technology.

Although I cannot make you guys happier with the cheerleading and nominating, I admit I have almost nothing to add to the development but just wait and evaluate the outputs( including the clearly organized sources). I just wanted the discussions a tad bit more based(with formal references) and considered in easy words.
Myself being a music lover than a movie manicac, I am more focused on the player/mixer level DD/DPL II link to the receivers than encoding clips(I might still prefer AAC though).
But doing things correctly in a fully considered open approaches is certainly the wonderful thing to be appreciated. It looks like genuine.
__________________
u know everything in the end, or now if aligned... no right(x).right(y) pls. it's confusing... : phase-shift /Jun.2006
Rockaria is offline   Reply With Quote
Old 25th January 2009, 09:59   #19  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 8,957
Does anybody (maybe Justin?) happen to know the "official" way on how a discrete 6.1 source should be mixed/prepared for AC3 EX encoding?

As far as I understand, Dolby always wants a 90° shift in the surround channels. But what about the back center? I guess it should be lowered in volume by 3db, right? But should it also be phase shifted by 90° or by something else?

Thanks!!
madshi is offline   Reply With Quote
Old 12th July 2006, 06:58   #20  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,182
iirc, there are no new things in the 0.02 version compared to my 0.01 build. I'll check later because I can't access to the official website right now.

For a "How to", I gave some commands in the 1st post but I'll try to integrate this into BeLight asap.
Kurtnoise 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 14:21.


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