Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: filtering without recompression (Read 4503 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

filtering without recompression

hi.  unfortunately i'm not up with the maths behind MDCT and such, but i'm wondering if it would be possible to perform simple frequency filtering on a transformed sound (like an ac3 file for instance) without having to decode, filter and re-encode (which i obviously don't want to do.)

i'm being driven mad by NTSC pilot tones that make it into foley tracks on my anime (like in "chobits", there's an extremely loud whine whenever a door is opened).  ideally i'd like to build an analog notch filter and hook it into the "accessory" busbars on my amp, but i'm thinking that re-burning the DVDs is a possibility too (they're DVD-5 anyway, so i wouldn't be losing any quality)

i'm pretty sure no tools exist as yet to do what i want, but it'd be good to know it is possible in theory, perhaps by zero-ing coefficients or something (as i said, i don't know the maths behind mDCT).

filtering without recompression

Reply #1
Yes, it is possible to perform filtering in the MDCT domain by zeroing or decreasing the amplitude of high frequency coefficients. I also don't know about any tool that does it though..

/Pontus

filtering without recompression

Reply #2
aaaah.  good.  i'm not mad then.

i suppose outputting the stream after filtering would be a problem - especially for CBR encodes (like ac3).  there'd be re-huffing and stuff to consider.  you wouldn't want the files coming out at wrong bitrates.

i suppose it could also be implemented on the decoder side though.  maybe it could be included in liba52 by a kind hearted coder (like DCTfilter is in ffdshow, on the video side of things, which does exactly this)

filtering without recompression

Reply #3
some comments:

1) because of its "critical sampled"-property and the MDCT's spectrally overlapping bandpass filters, zeroing some coefficiets will introduce alias artefacts. it's not as good as doing the filtering process in the time domain by convolution.

2) AC3 does not make use of prefix codes (ie huffman codes), so it'll be possible to transcode AC3 to AC3 while zeroing some HF MDCT coeffs and keeping the same bitrate. BTW:  It's not always possible to fully zero out any MDCT coeffs because of the different quantizers. low-SNR quantizers use reconstruction levels like (... -3 -2 -1 0 1 2 3 ...) while high-SNR-quantizers use reconstruction levels like (... -3.5 -2.5 -1.5 -0.5 0.5 1.5 2.5 3.5 ...) - no zero. Though, for the HF concent usually low-SNR quantizers are used.

Sebastian

PS: AC3 sucks, doesn't it ? - at least from a technical point of view. no entropy coding of the quantized mantissas, low temporal resolution which may lead to pre-echo artefacts and low spectral resolution of the filterbank. the blockswitch mechanism is pretty much useless, too.

filtering without recompression

Reply #4
hmm.  ac3 is surprisingly good sometimes.

however, i know for a fact that some soundtracks (especially PAL) are decoded, sped up and re-encoded from the NTSC DVD.  this practice should be made a hanging offence, but it happens.  it's usually because of the copyright holders promising a digibeta master and multitrack tape, and then just sending the sodding DVD, often days before the release date.

however, most pre-echo i've heard on ac3 is due to the fold-down to 2 channel (i don't have a 5.1 setup).  when i decode and listen to each channel separately it seems okay.  try it with those "w00t, how cool is dolby, eh?" intros on some DVDs... you know, the ones with helicopters whizzing past, or flying drops of water, or even lost Egyptian tombs in sub-par 3d rendering.  the helicopter one on "the matrix" r4 has rather obvious pre-echo on the snare drums, but it disappears if you listen to each channel separately.

i am shocked to find out that there's no lossless coding... that's rather inefficient for something that's designed for low bitrates (ever hear the commentry track on "fight club"?  it's 96 kbps mono!)

[edit]

oh, about the aliasing, wouldn't this be something you could compensate for to some extent by messing with other coefficients?  i suppose there wouldn't be much precision to work with (although getting rid of that awful noise would suit me.  i'd much prefer aliasing so long as it isn't equal in volume to what i was removing).

filtering without recompression

Reply #5
Quote
i am shocked to find out that there's no lossless coding... that's rather inefficient for something that's designed for low bitrates (ever hear the commentry track on "fight club"?  it's 96 kbps mono!)
[{POST_SNAPBACK}][/a]

Well, what's your definition of "lossless coding" ? :-)
If "lossless coding" involves VLC (variable lengths codes) then: NO.

AC3 is also a very unique architecture. I've never seen a hybrid forward/backward adaptive bit allocation mechanism anywhere else. And maybe VLCs are not worth the effort in this design (I don't know).

[a href="http://www.atsc.org/standards/a_52a.pdf]AC3 Specification[/url]

Quote
[edit]
oh, about the aliasing, wouldn't this be something you could compensate for to some extent by messing with other coefficients?  i suppose there wouldn't be much precision to work with (although getting rid of that awful noise would suit me.  i'd much prefer aliasing so long as it isn't equal in volume to what i was removing).
[a href="index.php?act=findpost&pid=232508"][{POST_SNAPBACK}][/a]

a pure tone is not only present in one MDCT coefficient but also in the surrounding coeffs (because of the band pass filters not being perfect). I guess you could zero out the main coeff and multiply the two surrounding coeffs with 0.5 to get rid of the pilot tone without noticable aliasing.

Sebastian