AC3Filter - it is DirectShow filter for AC3 decoding. Playing
.AVI with AC3 audio tracks and MPEG2 (DVD). Distributed absolutely
for free (FREEWARE). Sorry if my English is bad, but I think it is better
to have something than nothing.
Main features:
Full AC3 standart compliance.
Decode MPEG2 PES streams.
Multichannel output support (Win2k/XP).
LFE support.
Dynamic Range Compression (DRC) support.
Gain levels for LFE, Surround and Voice channels.
Bitstream information (channel format, bitrate,
sample rate, coupling freq and maximun freq).
Nothing is required, just register it. From command line: x:\somedir\> regsvr32 ac3filter.ax
For lazy men (as I am :) it is a command file - install.bat.
It will copy filter to System32 catalog (System for Win9x) and register
it.
Uninstall.
If registred from command line unregister it from command
line too: x:\somedir\> regsvr32 ac3filter.ax /u
For lazy men (as I am :) it is a command file - uninstall.bat.
It will unregister and delete filter from System32 catalog (System
for Win9x).
Setup.
When started filter checks for current speaker configuration
for downmix. It uses settings from Control Panel->Sounds
and Multimedia->Audio->Sound Playback->Advanced->Speaker
Setup. (For SB Live! users. When change speaker configuration
from Surround Mixer it is not always change in Control Panel. So it is
always good to check there.). For Win9x/WinNT use 2-channel mode.
Usage.
Filter decode ac3 streams from .avi and mpeg2 files.
If everything is good then when file is open filter must be in application
filter list. For Windows Media Player 6.4 filter list is at File->Properties->Advanced:
First in this example is ac3filter itself. If we open properties
we'll see:
* Bitstream information.
Top left it is bitstream information (BSI):
Ñhannels - channels configuration in form front_channels/surround_channels
+ LFE (Low frequency effects channel) presence flag. In this example
it is 3 front, 2 surround and LFE channels, i.e. 5.1 configuration.
Sample rate - as named, kHz.
Bitrate - in bits per second.
Freq (coupl/high) - kHz, coupling frequency and
high freuency. In ac3 some channels (in most cases all channels) are
grouped in one coupling channel beginning from some frequency - coupling
frequency and stored in the bitstream in that form. So channels are really
independent only in some frequency band - up to coupling frequency. High
frequency is a maximum frequency coded, so it defines total frequency
bandwidth.
Frames/errors - total number of decoded frames
and number of errors when decoding.
* 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. Checkbox Subwoofer define presence of independent subwoofer
(.1 channel). When present LFE is routed there, else LFE is routed to
all other channels. (In future I plan to route low frequeces from all
channels to subwoofer).
By default output configuration is get from Windows
(see Setup). Change it 'in place' possible only
in certain cases. First, file playing must be stopped (not paused!).
Second, all intermediate audio filters must support dynamic reconfiguring
(format change without full graph rebuild). So if you cannot set output
configuration here you need to set it in Control Panel.
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:
All audio streams are ac3. mmswitch may
be used in any speaker configuration. Speaker switch 'on place' will not
work. So you'll need to set it before playing.
First stream is ac3, and second is mp3 (just for example,
may be any non-multichannel format (stereo or mono)). If ac3 is needed
then everything is ok. You'll need only to set desired speaker configuration
in Control Panel before playing because of online switch will not be
available. If you'll try to switch to mp3 you'll get bad sound because
audio with only stereo channels will be played as audio having quadro
(for example) channels. So if you want to play mp3 track you'll need
to set stereo speakers in Control Panel.
First stream is mp3 and second is ac3. In this case it
is only stereo playing possinble. Do not forget to set it before playing!
No ac3 streams - no problem :).
* Gain levels.
Buttom middle it is relative gain levels.
LFE - for loud BOOM! :). Dolby recommends (it
is not nessesary, just recommendation) to use +10dB level when downmix.
But in this case this also means other channels dynamic range decrease
by this 10dB. And not all films with 5.1 format really have LFE channel.
At a given screenshot you can see presence of real 5 channels but LFE is
absent (when LFE channel is shown in BSI!). When subwoofer exists it is
better to leave it at zero level and ajust it at amlifier. It is because
of this level is relative. So if we set +10dB gain to LFE then all
other channles will be lowered.
Voice - relative level of central channel (dialog
channel). When downmix it is downmix level (got from BSI). When center
channel exists at output then level is not changing. But in both cases
you can change it. It is for some films with offscreen translation where
translator voice level is too high and corrupt overall sound picture.
As LFE level it is relative level.
Surround - surround channels level. All said about
Voice is applied here. It is downmix level when downmix. When surround
channels are exists it is front/surround level balance for example when
front and surround speakers are different type and amplifier have no
such control.
BSI lock checkboxes are for lock levels to standart defined.
LFE level locks at zero.
* 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).
* 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. For exampe at a given screenshot good shown that when
BSI shows 5.1 in real LFE channel is absent.
Misc.
All written in this document is the author's personal opinion.
And of cource author can be honestly mistaken. So misprints, bugs and
fact distotions are possible. About all of that author kindly ask to email immediately.
I want to say thanks to Marcello Mota for support and big help in
hard work of debugging and testing.
Filter was based on OpenSource 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).
For multichannel format reproduction according to Microsoft
recomendations (http://www.microsoft.com/hwdev/tech/audio/multichaudP.asp)
WAVE_FORMAT_EXTENSIBLE is used. In theory it may work in any Winodws
version. But I didn't make it work with Win98/SB Live! with more than stereo.
You can try, especially if you have other sound card.
Distribution.
This program distributed absolutely freely. It is strictly
allowed to install to any number of computers, write any number of
copies to CD or other medium and promote it in any way you want. It is
alowed to decompile it and make reverse engineering (but it may be easier
to write me and ask for sources).
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.
As I said before, I do not guarantee
immediate answer and corrections of all bugs (sometimes I'd like to
sleep at nights). But I'll be glateful for any help in bug-digging,
interesting ideas and expressions of appreciation :).
If you are programmer and you have huge number of genius ideas
about future development of this product (or other, but not less genius
:) - email me for sources.
* 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).