mirror of
				http://mpg123.de/trunk/.git
				synced 2025-10-31 01:25:33 +03:00 
			
		
		
		
	Using scripts/syn123-channelscaling.sh, I see about 15% benefit for mono/stereo operation when treating it as special cases in the resampler. Fun fact: Even the higher channel counts profit a tiny bit (1% to 2%, not sure how significant) from the separation. Giving the compiler information about what can be likely values for those inner loop rounds still makes sense. git-svn-id: svn://scm.orgis.org/mpg123/trunk@4494 35dc7657-300d-0410-a2e5-dc2837fedb53
		
			
				
	
	
		
			33 lines
		
	
	
		
			939 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			939 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
| #!/bin/sh
 | |
| 
 | |
| # This gives a view at the scaling of resampling runtime with channel count.
 | |
| # The tested resampling mode involves 2X upsampling, lowpass, and interpolation.
 | |
| 
 | |
| set -e
 | |
| 
 | |
| export LANG=C
 | |
| export LC_NUMERIC=C
 | |
| chan_min=1
 | |
| chan_max=10
 | |
| chan_fit=3
 | |
| 
 | |
| out123=src/out123
 | |
| generate="--wave-freq 300 --inputrate 44100 --timelimit 4410000 -q"
 | |
| 
 | |
| wd=$(mktemp -d channelscaling.XXXX)
 | |
| echo "workdir: $wd"
 | |
| for n in $(seq $chan_min $chan_max)
 | |
| do
 | |
|   printf "generate with %d channels\n" "$n" >&2
 | |
|   /usr/bin/time -f "$n\t%e" $out123 $generate -c $n --rate 44100 -t 2>&1
 | |
| done > $wd/generate.txd 
 | |
| for n in $(seq $chan_min $chan_max)
 | |
| do
 | |
|   printf "resample with %d channels\n" "$n" >&2
 | |
|   /usr/bin/time -f "$n\t%e" $out123 $generate -c $n --rate 44101 -t 2>&1
 | |
| done > $wd/resample.txd 
 | |
| txdcalc '[3]=[2]-[1,2]' $wd/generate.txd  < $wd/resample.txd > $wd/resampling-overhead.txd
 | |
| gpfit --plot -g=1 -r='[3:]' $wd/resampling-overhead.txd 
 | |
| 
 | |
| echo "Check results in $wd/."
 |