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 > Capturing and Editing Video > Avisynth Development
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th February 2012, 12:12   #1  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 595
SSRC: which is correct?

I tried follow script,
Code:
ColorBars()
AssumeSampleRate(48000)
SSRC(40000, false)
and got error "SSRC: could not to resample between two samplerates." with both avs2.58 and avs2.60alpha3.

According to docs, these samplerates must be proper.

fs1 / dfrq = sfrq / frqgcd = 48000 / 8000 = 6
6 % 2 = 0 (also 6 % 3 = 0)

but code(SSRC.cpp) says as follows
Code:
if (dfrq>sfrq){
    int fs1 = sfrq / frqgcd * dfrq;
    if (fs1/dfrq == 1) return 1;
    else if (fs1/dfrq % 2 == 0) return 1;
    else if (fs1/dfrq % 3 == 0) return 1;
    else return 0;
} else {
    if (dfrq/frqgcd == 1) return 1;
    else if (dfrq/frqgcd % 2 == 0) return 1;
    else if (dfrq/frqgcd % 3 == 0) return 1;
    else return 0;
}
Which is correct between docs and code
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 16th February 2012, 23:10   #2  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
The documentation seem to be incomplete. That condition applies only for dest freq > source freq. i.e. for the class Upsampler case.

Your case is dest freq < source freq, and the reciprocal test needs to be applied. i.e. for the class Downsampler case.

40000 / 8000 = 5 and 5 is not mod 2 or mod 3.


You can work around the restriction by using ResampleAudio or doing it in 2 passes, i.e.
Code:
ColorBars()
AssumeSampleRate(48000)
SSRC(80000, false)
SSRC(40000, false)
SSRC typically uses a sinc window between 2 and 3 times more than ResampleAudio, which theoretically makes is more accurate. When SSRC was added to Avisynth (v2.5.4), ResampleAudio only worked with 16 bit samples, it has since (v2.5.6) been enhanced to support float samples. For 48000 <-> 44100 both filters far exceed the requirements of 16bit audio. Doing 2 conversions may negate any advantages SSRC has over ResampleAudio.
IanB is offline   Reply With Quote
Old 17th February 2012, 09:27   #3  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 595
i see,

EDIT:
I fixed the descliption of the doc.
http://avisynth.org/mediawiki/SSRC
__________________
my repositories

Last edited by Chikuzen; 17th February 2012 at 14:28.
Chikuzen is offline   Reply With Quote
Reply


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 02:29.


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