AC3Filter ver 0.6b

SourceForge Logo
Russian version
Download Sourceforge project page


AC3Filter - it is DirectShow filter for AC3 decoding to play .AVI with AC3 audio tracks and MPEG2 (DVD). Distributed absolutely for free (FREEWARE, OpenSource). Sorry if my English is bad, but I think it is better to have something than nothing.

Main features:



Contents



Download.

New versions can be found at site:
http://ac3filter.sourceforge.net - home page
http://xvalex.hotbox.ru/programs/ac3filter - home page at author's site
http://sourceforge.net/projects/ac3filter - sourceforge project page

If you want to subscibe to a mailing list that announces new versions (low traffic) you can post a message to:
mailto:ac3filter_news-subscribe@yahoogroups.com


All versions:
http://sourceforge.net/projects/ac3filter

ac3filter ver 0.6b
http://prdownloads.sourceforge.net/ac3filter/ac3filter_0_6b.zip?download - binary
http://prdownloads.sourceforge.net/ac3filter/ac3filter_0_6b_src.zip?download - sources



Install.

Ñommand file - install.bat.

To install from command line run:
x:\somedir\> regsvr32 ac3filter.ax
Then import presets file preset.reg.

If you are using Windows 98 Simplified Chineese and filter's property dialog is too small you can try dialog_patch.exe patch (run it again to revert changes).



Uninstall.

Ñommand file - uninstall.bat.

To install from command line run:
x:\somedir\> regsvr32 ac3filter.ax /u
If you want to remove all settings from registry then import uninstall.reg file.



Usage.

If everything good then after install filter is ready to work. If speakers configuration was not set explicitly then for first start Control Panel settings are used (Control Panel->Sounds and Multimedia->Audio->Sound Playback->Advanced->Speaker Setup).

You can configure filter with:



Main settings

Here is Main property page (levels and bitstream info are only shown when property page is called from player):



* Bitstream information.

Top left it is bitstream information (BSI):

* Speaker configuration switch.

Left bottom it is an output speaker configuration switch. It define the real speaker configuration to wich ac3 channels will be mixed. Shown in form front_channels/surround_channels + LFE presence flag. For some configurations common names are given. When mode with LFE channel is set then LFE channel from ac3 stream is routed to subwoofer. Otherwise LFE is mixed to front channels.

'Dolby Surround/ProLogic' mode means that that all channels presented in ac3 stream will be mixed into two channels so Dolby Surround/Pro Logic decoder can extract surround channel. 'Dolby ProLogic II mode is similar to DPL but for DPL II decoder. DPLII support is only experimental because of lack of reliable information.

'SPDIF' checkbox means that ac3 stream will be routed to digital out of sound card directly and without any modification. So no one of other settings will work if this checkbox is checked.

'Sample format' combo box sets output sample format. There are PCM 16 bit, PCM 24 bit and PCM Float (most precise) formats are now supported. On some sound cards some formats may not work so use this option with care. If format is not suported then filter will be disabled! Some drivers allows formats other that PCM 16bit but gives a noise at playback.

It is nessesary to note that speaker configuration at playback can be changed only in certain cases. First of all playing must be stopped before (not paused). Second, all intermediate audio filters must support dynamic reconfiguring (format change without full graph rebuild). So in some cases you cannot cange speaker configuration from player at all. In such cases you need to set it before playing.

In most cases problems are because of mmswitch filter (filter that support .avi (and DVDs too) with several audio tracks and allow to switch between, especially for multi-language films). If you mainly watch DVDs it is better to uninstall this filter and use MPEG2 parser wich support stream switching directly (standart MPEG2 Splitter for example). In this case you'll also get lower CPU usage. If MPEG2 parser does not support stream switching (Elecard for example) then many audio rendering chains created, all of them are working together when only one really reproducing.

If mmswitch is really needed then it is several possibilities:
* Gain levels. Buttom middle it is gain level controls. Master and Gain controls are responsible for global gain level. Master sets desired gain level. If current sound level is too high and overflow occurs then real gain level will decrease. Current gain level shown at Gain control.

* Dynamic range compression.

By its nature ac3 is a logarithmic format. Samples are stored in form of exponents and mantissas. In terms of bits one sample can be up to 40bits long (only theoretically) or up to 24bits (normal). It provide huge dynamic range (but, as said by great Einstein all good things in this word are relative :-). This means that quiet sound with low level when played on 16-bit sound card will be not audible at all or will have very low absolute level (=> high distortions). To solve this problem it is dynamic range comression. Main idea is to raise level when sound is quiet (and vice versa when loud) before converting to 16-bit form. There are special markers in ac3 stream for current level change. This markers are set by producer at a mastering stage, so it guarantees high quality. DRC level indicates this level. With 'Use DRC' chekbox you can enabe/disable using DRC. (of course this is only rough problem description).

DRC Power control adjusts how much DRC level changes sound level. When DRC Power is increased all quiet sounds will be more stressed and loud sound will be more shaded. When decrease DRC Power dynamic range compression will have less influence at output. Zero DRC Power level means that dynamic range compression applied at normal.

* CPU load.

Indicates CPU load by sound decoding and processing. All sound processing (if exists) before reproduction included here.

* Input/output levels.

Right part - levels indication. Note that levels here are in logarithmic scale. Input levels shows real channels configuration. Often happens that when BSI shows 5.1 in real LFE channel is absent.

* Presets

Combo box at bottom left allows to load predefined sets of settings (presets):


Mixer settings

Second page is mixer settings.



Main controls here is mixing matrix. It is in form of matrix multiplication: S' = M S, where S = { L, C, R, SL, SR, LFE } - input sample, S' = { L', C', R', SL', SR', LFE' } - output sample.

For convenience some controls from Main page are placed here. For its description look at Main settings.

Settings description:
Combo-box allows to save and load saved matrices.


Equalizer and delays.



Right part are fully about equalizer. Everything is obvious so I will not bother myself with full description ;-).

Left top corner are delay settings. Each channel is configured independent. Delays are for output channels, i.e. after mixing. Measurenent units are samples. For most common case 1 sample equals to 1/48000ñ ~= 21microsecs. There are two possible usage for delays:

Configuration advices

Windows 98

Only stereo configuratin supported by default in Windows 98 (and no spdif also). Support of this modes is at experimental stage now so it may not work on some systems.

First you need is install microsoft patch for WaveOut:
http://xvalex.hotbox.ru/download/269601usa8.exe

Second is set WaveOut Device as default device for audio output. In some players you can configure it but in most you cannot. So in most cases you need to explicitly set WaveOut Device as default sound renderer. You can do it with set_waveout.bat comamnd file (set_directsound.bat command file set back DirectSound as default renderer).

After it in most players multichannel modes and spdif output may work. Speaker configuration you have to set before (it will not work in filter properties).

General advices

Maximum standart compatibility

Recommended in all cases.

One-pass normalization.

To play at maximum loudness.



Registry.

Filter saves its state in registry key: [HKEY_CURRENT_USER\Software\AC3Filter].
'preset' subkey contain different subkeys for each set of settings (preset). When filter is loading '_deafult' preset is always loaded, when filter is unloading all settings are saved there.
Mixer matrices are stored under 'matrix' subkey. As before each matrix is stored in its own subkey. '_default' matrix is loaded at startup and saved at shutdown.
Equalizer settings are stored under 'equalizer' subkey. '_default' equalizer is loaded at startup and saved at shutdown.
Delay settings are stored under 'delay' subkey. '_default' delay is loaded at startup and saved at shutdown.

All floating point values are stored as 'REG_SZ' registry values.
All levels are stored in factor form (not dB!).

To reset all settings to default values just import reset.reg file. It deletes all _default presets loaded at startup.

Channel abbreviation used as part of some values name:
Abbreviation
Meaning
L
Left front
C
Center
R
Right front
SL
Left surround
SR
Right surround
LFE
LFE channel

Presets

Registry values:

Mixing matrices.

Matrix values called next way: [from_channel]_[to_channel], where from_channel is mixed to to_channel with factor given in value.



Misc.

Filter was primarily based on Open Source LibA/52 library (http://liba52.sourceforge.net) and mainly inherits its characteristics. Much was rewritten but I tried to keep its merits. I want to note high quality of this lib and high compliance with standart (http://www.atsc.org/standards/a_52a.pdf).

I want to say thanks to Marcello Mota for support and big help in hard work of debugging and testing.
Big thaks to Gabest for DVD playback support.
To Frank (doom9 forum) for Dolby ProLogic II downmix matrix
And much of other people who made this project live.....



Distribution.

This program distributed under GNU General Public Licence v2, placed in GNU_eng.txt at english language and GNU_rus.txt at russian language. Russain language version is only for information purpose only and english version have priority with all variant reading.

This application may solely be used for demonstration and educational purposes. Any other use may be prohibited by law in some coutries. The author has no liability regarding this application whatsoever. This application may be distributed freely unless prohibited by law.

This product distributed in hope it may be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose and compliance with any standarts. I do not guarantee 24-hour (and any) support, bug correction, repair of lost data, I am not responsible for broken hardware and lost working time. I am not responsible for legality of reproducted with this program multimedia production.



Contact author.

With all questions about this program please, email to this address. Please, respond about all errors in porgram with following information:
This will help me a much in bug fixing.


Changelog.

0.6b - 17.12.2002
+ Equalizer
+ Audio delay adjust
+ Support for different output sample formats: PCM16, PCM 24, Float
+ Dolby Surround/ProLogic/ProLogicII downmix.
+ Control Panel icon
! Mono output bug fixed
! Bug with WMP9 playback fixed
* Mixer page is redesigned
* Made filter code smaller


0.55b - 25.11.2002
! Bug fixed: surround and voice gain controls did not work in 5 channel mode
! Bug with decoding stereo files fixed


0.54b - 01.10.2002
+ SPDIF pass-through output.
+ Preset loading and several standart presets added.
* Speaker configuration is now saved to registry.
+ Speaker configuration program added.
+ Patch for dialog size in Win98 Chieneese
! Bug filxed - in some cases filter settings was not saved.


0.53b - 14.09.2002
* Filter is distributed under GPL lisence now.
+ Save settings to registy.
+ Mixer control page with mixer matrix added.
* LFE channel is now mixed only to front speakers.
* 'Normalize' checkbox on main page means now one-pass normalization.
! Some bug fixed and new added.


0.52b - 01.09.2002
! Bug fixed - hang on corrupted PES streams.
+ Sound volume increased.
+ Overflow control and automatic gain control added.
+ Master gain control added.
+ DRC power control added.


0.51b - 18.07.2002
! Bug fixed (crash on some ac3 formats)


0.5b - 07.07.2002
* AC3 decoder code was fully rewritten
+ PES support added.
+ Levels for LFE, Surround and Voice locked to BSI by default.
+ CPU usage indicator
+ Input and output levels inidicators.
+ DRC level indicator.
+ Some information about stream added.
! Some bug fixes.


0.4a - 23.06.2002
+ LFE support and LFE gain added.
+ Added buttons for reset all gains to BSI values.
+ Stereo now transmitted in standart format, so now filter can work
with sustems with no multi-channel support (Win9x/WinNT).
+ DVD decoding added.
! Syncronization problem fixed.
+ Option to enable/disable dynamic range compression added.


0.3a - 03.04.2002
+ Volume gain for central (voice) and surround channels.
+ Speaker configuration change support added. Only works when
all intermediate filters support dynamic reconfiguring and only
in stopped (not paused!) state.


0.2a - 01.04.2002
* LibA52 code was rewritten for multitasing, so now possible to
create many instances of the filter in a filtergraph. It is primary
used for multi-language films.
+ Information panel added (but settings are not working now).


0.1a - first working alfa



Useful links


AC3Filter site (rus+eng): (http://xvalex.hotbox.ru/programs/ac3filter)
AC3Filter site (rus+eng): (http://ac3filter.sourceforge.net)

A/52a standart (AC3) (eng): (http://www.atsc.org/standards/a_52a.pdf).
LibA52 library (was ac3dec) (eng): (http://liba52.sourceforge.net).
Multichannel audio reproduction at Windows (eng): (http://www.microsoft.com/hwdev/tech/audio/multichaudP.asp).
Just useful video-related site (eng): (http://www.doom9.org).
And one more (rus): (http://freetime.sinor.ru/observatory/digitalvideo).



Copyright (c) 2002 by Vigovsky Alexander.
Last updated 17.12.2002