English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 20 September 2016, 12:26   #381
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,356
Quote:
Originally Posted by Thorham View Post
Okay, but does it produce megabytes of bloat?
No, it's just a minor shortcoming.


Quote:
Originally Posted by Thorham View Post
Laptop or Commodore monitor
Yeah. Actually, Atari monitor


Quote:
Originally Posted by Thorham View Post
Simple 2:1 average without cutting any corners (read samples, ext, add, asr).
And you hear noise ? I wonder what kind of sample you tried


Quote:
Originally Posted by Thorham View Post
Just wrote a simple version and it doesn't fit either
Mine is close to fitting. A few words less and we're ok. But i couldn't get them
Anyway, 5:3 does fit.


Quote:
Originally Posted by Thorham View Post
Didn't think it through all that well, though. It'll certainly fit if you don't interleave the channels. If the format you're decoding allows that, problem solved.
The format ? It can just be anything. I currently have code for aiff, wave, flac, mp3, ogg.


Quote:
Originally Posted by Thorham View Post
Easy enough: Unroll once, start moving things around and test.
Yeah, the only method is to actually do it.
meynaf is offline  
Old 20 September 2016, 13:52   #382
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,854
Quote:
Originally Posted by meynaf View Post
Yeah. Actually, Atari monitor
Do you hear it when you turn the volume up?

Quote:
Originally Posted by meynaf View Post
And you hear noise ? I wonder what kind of sample you tried
A piece of music from CD. Quite clean. Doesn't sound noisy at all. Sox down samples great, as usual. Extremely little quantization noise, but averaging produces quite a lot. How audible it is will vary based on the kind of music, and the passage, of course.

Quote:
Originally Posted by meynaf View Post
Mine is close to fitting. A few words less and we're ok. But i couldn't get them
Mine is 266 bytes with loop handling added.

Quote:
Originally Posted by meynaf View Post
The format ? It can just be anything. I currently have code for aiff, wave, flac, mp3, ogg.
Then the solution seems simple: just write two mono tracks. Now the code for 8:5 is just this:
Code:
.loop
; 00000111
    movem.w (a0)+,a3-a6 ; samples 0, 1, 2 and 3
    move.l  a3,d0
    add.l   d0,d0
    add.l   a4,d0
    add.l   d0,d0
    add.l   a3,d0
    add.l   a4,d0
    asr.l   #3,d0

; write
    move.l  d6,a3
    add.l   d0,a3
    add.l   d0,a3
    move.b  (a3)+,(a1)+ ; high
    move.b  (a3)+,(a2)+ ; low

; 11222223
    move.l  a5,d0
    add.l   d0,d0
    add.l   a4,d0
    add.l   d0,d0
    add.l   a5,d0
    add.l   a6,d0
    asr.l   #3,d0

; write
    move.l  d6,a3
    add.l   d0,a3
    add.l   d0,a3
    move.b  (a3)+,(a1)+ ; high
    move.b  (a3)+,(a2)+ ; low

; 33334444
    move.l  a6,d0
    movem.w (a0)+,a3-a6 ; samples 4, 5, 6 and 7
    add.l   a3,d0
    asr.l   #1,d0
    move.l  a3,d1

; write
    move.l  d6,a3
    add.l   d0,a3
    add.l   d0,a3
    move.b  (a3)+,(a1)+ ; high
    move.b  (a3)+,(a2)+ ; low

; 45555566
    move.l  a4,d0
    add.l   d0,d0
    add.l   a5,d0
    add.l   d0,d0
    add.l   a4,d0
    add.l   d1,d0
    asr.l   #3,d0

; write
    move.l  d6,a3
    add.l   d0,a3
    add.l   d0,a3
    move.b  (a3)+,(a1)+ ; high
    move.b  (a3)+,(a2)+ ; low

; 66677777
    move.l  a6,d0
    add.l   d0,d0
    add.l   d5,d0
    add.l   d0,d0
    add.l   a5,d0
    add.l   a6,d0
    asr.l   #3,d0

; write
    move.l  d6,a3
    add.l   d0,a3
    add.l   d0,a3
    move.b  (a3)+,(a1)+ ; high
    move.b  (a3)+,(a2)+ ; low

; next
    subq.l  #1,d7
    bne .loop
Quote:
Originally Posted by meynaf View Post
Yeah, the only method is to actually do it.
It's those chipmem timings. Fastmem pipelining is seems easier.
Thorham is offline  
Old 20 September 2016, 14:20   #383
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,356
Quote:
Originally Posted by Thorham View Post
Do you hear it when you turn the volume up?
I don't turn the volume up too much. If you tested monitors sound this way, not surprising you got bad results - they're simply not meant for this use.
Only thing i can say is that i don't hear it for normal volume levels - by the way, do you hear it when you don't turn the volume up ?


Quote:
Originally Posted by Thorham View Post
A piece of music from CD. Quite clean. Doesn't sound noisy at all. Sox down samples great, as usual. Extremely little quantization noise, but averaging produces quite a lot. How audible it is will vary based on the kind of music, and the passage, of course.
Down sampling shouldn't do that much damage
Do you still have the code or some (badly) downsampled piece of music, so that i can hear the damage too ?


Quote:
Originally Posted by Thorham View Post
Then the solution seems simple: just write two mono tracks. Now the code for 8:5 is just this:
This requires changing all the code writing these. Might involve some slow down (like in the case of aiff, for which the data is used directly). Also makes my "write to file" option more complicated because it needs to use the left/right interleave format.


Quote:
Originally Posted by Thorham View Post
It's those chipmem timings. Fastmem pipelining is seems easier.
Just put as many instructions not accessing memory after every write.
meynaf is offline  
Old 20 September 2016, 15:37   #384
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,854
Quote:
Originally Posted by meynaf View Post
If you tested monitors sound this way, not surprising you got bad results - they're simply not meant for this use.
Yeah, I know that. It's one of the reasons I don't like using internal speakers.

Quote:
Originally Posted by meynaf View Post
Only thing i can say is that i don't hear it for normal volume levels - by the way, do you hear it when you don't turn the volume up ?
I didn't turn it up all that much, but it's somewhat soft when I can't hear it.

Quote:
Originally Posted by meynaf View Post
Down sampling shouldn't do that much damage
It causes quantization noise. When you just calculate the average, there's nothing you can do about it.

Quote:
Originally Posted by meynaf View Post
Do you still have the code or some (badly) downsampled piece of music, so that i can hear the damage too ?
Sure. It's written for AsmPro (or AsmOne, didn't test) use. It's a bit crappy, of course

It wants 16 bit signed little endian interleaved raw data, and outputs 16 bit big endian interleaved raw data at half the frequency. Play16 pars: signed paula14c freq=22050 tracks=2 bits=16.
Code:
    incdir  "680x0:"
a
    lea wav,a0
    lea b,a1

    move.l  #2^20>>2,d7

    clr.l   d0
    clr.l   d1
    clr.l   d2
    clr.l   d3

.loop

; read samples
    movem.w (a0)+,d0-d3

    rol.w   #8,d0
    rol.w   #8,d1
    rol.w   #8,d2
    rol.w   #8,d3

    ext.l   d0
    ext.l   d1
    ext.l   d2
    ext.l   d3

    add.l   d2,d0
    add.l   d3,d1
    asr.l   #1,d0
    asr.l   #1,d1

    move.w  d0,(a1)+
    move.w  d1,(a1)+

    subq.l  #1,d7
    bne     .loop

    rts

    section data,data_f
wav
    incbin  "test.raw"

    section data2,bss_f
b
    ds.b    512*1024
Quote:
Originally Posted by meynaf View Post
This requires changing all the code writing these. Might involve some slow down (like in the case of aiff, for which the data is used directly). Also makes my "write to file" option more complicated because it needs to use the left/right interleave format.
Well, it's change the code and get a speedup, or leave it the way it is and be stuck with divs.

Quote:
Originally Posted by meynaf View Post
Just put as many instructions not accessing memory after every write.
Wouldn't it be better to try and spread them as evenly as possible?
Thorham is offline  
Old 20 September 2016, 16:52   #385
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,356
Quote:
Originally Posted by Thorham View Post
It causes quantization noise. When you just calculate the average, there's nothing you can do about it.
Certainly, but we shouldn't get much more noise than with sampling to that freq directly, should we ?


Quote:
Originally Posted by Thorham View Post
Sure. It's written for AsmPro (or AsmOne, didn't test) use. It's a bit crappy, of course
Well, perhaps it's just that's 22khz which is too low. I did several 26.46 downsamples and didn't get any noise in the process.


Quote:
Originally Posted by Thorham View Post
Well, it's change the code and get a speedup, or leave it the way it is and be stuck with divs.
Perhaps divs can be turned into muls, i don't know.


Quote:
Originally Posted by Thorham View Post
Wouldn't it be better to try and spread them as evenly as possible?
There are a number of clocks to fulfill after each write. As long as it's not full, where the instructions are doesn't matter. The trick is to have as few register-only instructions as possible out of these areas.
meynaf is offline  
Old 21 September 2016, 09:36   #386
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,854
Quote:
Originally Posted by meynaf View Post
Certainly, but we shouldn't get much more noise than with sampling to that freq directly, should we ?
Actually, you should. If it's sampled very cleanly there will hardly be any. Down sampling will produce noise, unless you use all kinds of filters and stuff I know nothing about (what Sox does).

Averaging is a cheap method that gives mediocre results. It works much better for image down sampling, where the only real problem is that you can get Moire effects, and you often don't get those.

Quote:
Originally Posted by meynaf View Post
Well, perhaps it's just that's 22khz which is too low. I did several 26.46 downsamples and didn't get any noise in the process.
It's not too low. Sox does a decent job at that.

Quote:
Originally Posted by meynaf View Post
Perhaps divs can be turned into muls, i don't know.
You probably can, yes, but it still won't be optimal. This thing sure is a pain

Quote:
Originally Posted by meynaf View Post
There are a number of clocks to fulfill after each write. As long as it's not full, where the instructions are doesn't matter. The trick is to have as few register-only instructions as possible out of these areas.
Okay, that's pretty clear.
Thorham is offline  
Old 21 September 2016, 12:57   #387
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,356
Quote:
Originally Posted by Thorham View Post
Actually, you should. If it's sampled very cleanly there will hardly be any. Down sampling will produce noise, unless you use all kinds of filters and stuff I know nothing about (what Sox does).

Averaging is a cheap method that gives mediocre results. It works much better for image down sampling, where the only real problem is that you can get Moire effects, and you often don't get those.
Averaging should get exactly the same result as sampling half the rate. Don't A/D converters take the average of the input level during their time slice ?


Quote:
Originally Posted by Thorham View Post
It's not too low. Sox does a decent job at that.
The lower it is, the better the job you have to do to get a decent result. So 22.05 is too low. I don't think you're gonna get much noise in down sampling 88khz to 44...


Quote:
Originally Posted by Thorham View Post
You probably can, yes, but it still won't be optimal. This thing sure is a pain
Anyway here is the code, should someone find a way to make it significantly faster :
Code:
.loop
 movem.w (a0)+,d0-d1/d3/d6    ; l0, r0, l1, r1
 move.l d0,d4
 add.l d0,d4
 add.l d0,d4
 add.l d3,d4
 add.l d3,d4
 divs #5,d4
 move.w (a3,d4.w*2),d4       ; 00011
 move.b d4,(a2)+
 lsr.w #8,d4
 move.l d1,d7
 add.l d1,d7
 add.l d1,d7
 move.b d4,(a1)+
 add.l d6,d7
 add.l d6,d7
 movem.w (a0)+,d0-d1/d4-d5    ; l2, r2, l3, r3
 divs #5,d7
 move.w (a3,d7.w*2),d7
 move.b d7,(a6)+
 add.l d4,d3
 add.l d0,d3
 add.l d0,d3
 add.l d0,d3
 lsr.w #8,d7
 divs #5,d3
 move.b d7,(a4)+
 add.l d5,d6
 add.l d1,d6
 add.l d1,d6
 add.l d1,d6
 divs #5,d6
 move.w (a3,d3.w*2),d3       ; 12223
 move.w (a3,d6.w*2),d6
 movem.w (a0)+,d0-d1
 move.b d3,(a2)+
 lsr.w #8,d3
 add.l d4,d4
 add.l d0,d4
 add.l d0,d4
 add.l d0,d4
 divs #5,d4
 move.b d3,(a1)+
 add.l d5,d5
 add.l d1,d5
 add.l d1,d5
 add.l d1,d5
 divs #5,d5
 move.w (a3,d4.w*2),d4       ; 33444
 move.w (a3,d5.w*2),d5
 move.b d6,(a6)+
 lsr.w #8,d6
 move.b d6,(a4)+
 move.b d4,(a2)+
 lsr.w #8,d4
 move.b d4,(a1)+
 move.b d5,(a6)+
 lsr.w #8,d5
 move.b d5,(a4)+
 subq.l #1,d2
 bgt.s .loop
meynaf is offline  
Old 21 September 2016, 13:12   #388
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
Quote:
Originally Posted by meynaf View Post
Averaging should get exactly the same result as sampling half the rate. Don't A/D converters take the average of the input level during their time slice ?
they might, then again maybe Amiga samplers don't produce such good quality samples, either...

What they could do instead is do A/D to a higher bit width, say 12 bit, and then use error diffusion when dropping down to their 8 bit output.

I have been pondering writing a sample converter myself, using this sort of technique. When averaging to do 2:1 downsampling, the result is really 9 bit, so you have 1 bit of error you need to diffuse, which shouldn't be too difficult. Just keep the bit shifted out and add it onto the next 9-bit total.
Mrs Beanbag is offline  
Old 21 September 2016, 13:22   #389
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,356
Quote:
Originally Posted by Mrs Beanbag View Post
I have been pondering writing a sample converter myself, using this sort of technique. When averaging to do 2:1 downsampling, the result is really 9 bit, so you have 1 bit of error you need to diffuse, which shouldn't be too difficult. Just keep the bit shifted out and add it onto the next 9-bit total.
Ok for 8 bit samples, but for 16 bit downsampling the lowest bit is pretty much unimportant, isn't it ?
meynaf is offline  
Old 21 September 2016, 13:29   #390
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
Quote:
Originally Posted by meynaf View Post
Ok for 8 bit samples, but for 16 bit downsampling the lowest bit is pretty much unimportant, isn't it ?
i would have thought you would need very good speakers to hear that kind of noise, but you know audiophiles... professional software does to this sort of thing, often working from a 32 bit master, so presumably someone can hear the difference (even floating point is used, for some reason, well we can ponder the wisdom of that...)
Mrs Beanbag is offline  
Old 21 September 2016, 14:07   #391
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,854
Quote:
Originally Posted by meynaf View Post
Don't A/D converters take the average of the input level during their time slice ?
No idea, actually

Quote:
Originally Posted by meynaf View Post
The lower it is, the better the job you have to do to get a decent result. So 22.05 is too low.
That's certainly true.

Quote:
Originally Posted by meynaf View Post
Anyway here is the code, should someone find a way to make it significantly faster :
Depending on the chipmem buffer size for each channel, I might be able to fit my 8:5 routine. Each buffer can't be larger than 32k, however.

Quote:
Originally Posted by Mrs Beanbag View Post
i would have thought you would need very good speakers to hear that kind of noise
You can hear quantization noise with 45 euro headphones from a good brand, and 150 euro stereo amp.
Thorham is offline  
Old 21 September 2016, 14:53   #392
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,356
Quote:
Originally Posted by Thorham View Post
Depending on the chipmem buffer size for each channel, I might be able to fit my 8:5 routine. Each buffer can't be larger than 32k, however.
My current implementation has 80k samples in its buffers
meynaf is offline  
Old 22 September 2016, 01:21   #393
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,854
Quote:
Originally Posted by meynaf View Post
My current implementation has 80k samples in its buffers
Yeah, I figured something like that

Probably can't be done without refactoring, then. You can either write the data non-interleaved, or sign extend to 32bit and write that to the intermediate buffers. Last one is probably the easiest, but I don't know how much of a difference it will make. Either way, it won't happen without some changes, as much of a pain it might be.
Thorham is offline  
Old 22 September 2016, 10:03   #394
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,356
Quote:
Originally Posted by Thorham View Post
Yeah, I figured something like that

Probably can't be done without refactoring, then.
The code could be changed to support different buffer sizes and it wouldn't be very hard, but the main problem is the big latency file i/o involves -- the smallest the buffers, the more it can be seen.
The best way is probably giving the user the option to change the buffer size, but then any size must be supported.


Quote:
Originally Posted by Thorham View Post
You can either write the data non-interleaved, or sign extend to 32bit and write that to the intermediate buffers. Last one is probably the easiest, but I don't know how much of a difference it will make. Either way, it won't happen without some changes, as much of a pain it might be.
Writing the data non-interleaved is possible. That would, however, require many changes in the codecs and end up eating more cpu for a format such as aiff (which i can read but also write), where the data is used directly. At the end i have mixed feelings about this.

Sign extend to 32 bit probably wouldn't help much. I read data with movem.w, which does that sign extend on the fly.
meynaf is offline  
Old 22 September 2016, 11:52   #395
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,854
Quote:
Originally Posted by meynaf View Post
Sign extend to 32 bit probably wouldn't help much. I read data with movem.w, which does that sign extend on the fly.
I thought only address registers were sign extended and didn't know movem does that for data registers as well That changes everything. The code now fits in 210 bytes All that needs to be done now is move some code around for pipelining (and maybe fix a bug or two ).

Code:
.loop

;00000111 d0/d1 = 0 d2/d3 = 1

    movem.w (a0)+,d0-d3

    move.l  d0,d6
    lsl.l   #2,d0
    add.l   d0,d6
    add.l   d2,d6
    add.l   d2,d2
    add.l   d2,d6
    asr.l   #3,d6

    lea     (a5,d6.w*2),a6
    move.b  (a6)+,(a1)+
    move.b  (a6)+,(a2)+

    move.l  d1,d6
    lsl.l   #2,d1
    add.l   d1,d6
    add.l   d3,d6
    add.l   d3,d3
    add.l   d3,d6
    asr.l   #3,d6

    lea     (a5,d6.w*2),a6
    move.b  (a6)+,(a3)+
    move.b  (a6)+,(a4)+

;11222223 d2/d3 = 2 * 1 d0/d1 = 2 d4/d5 = 3

    movem.w (a0)+,d0-d1/d4-d5

    add.l   d0,d2
    lsl.l   #2,d0
    add.l   d0,d2
    add.l   d4,d2
    asr.l   #3,d2

    lea     (a5,d2.w*2),a6
    move.b  (a6)+,(a1)+
    move.b  (a6)+,(a2)+

    add.l   d1,d3
    lsl.l   #2,d1
    add.l   d1,d3
    add.l   d5,d3
    asr.l   #3,d3

    lea     (a5,d3.w*2),a6
    move.b  (a6)+,(a3)+
    move.b  (a6)+,(a4)+

;33334444 d4/d5 = 3 d0/d1 = 4 d2/d3 = 5

    movem.w (a0)+,d0-d3

    add.l   d0,d4
    asr.l   #1,d4

    lea     (a5,d4.w*2),a6
    move.b  (a6)+,(a1)+
    move.b  (a6)+,(a2)+

    add.l   d1,d5
    asr.l   #1,d5

    lea     (a5,d5.w*2),a6
    move.b  (a6)+,(a3)+
    move.b  (a6)+,(a4)+

;45555566 d0/d1 = 4 d2/d3 = 5

    add.l   d2,d0
    lsl.l   #2,d0
    add.l   d2,d0

    add.l   d3,d1
    lsl.l   #2,d1
    add.l   d3,d1

    movem.w (a0)+,d2-d5 ; d2/d3 = 6 d4/d5 = 7

    add.l   d2,d0
    add.l   d2,d0
    asr.l   #3,d0

    lea     (a5,d0.w*2),a6
    move.b  (a6)+,(a1)+
    move.b  (a6)+,(a2)+

    add.l   d3,d1
    add.l   d3,d1
    asr.l   #3,d1

    lea     (a5,d1.w*2),a6
    move.b  (a6)+,(a3)+
    move.b  (a6)+,(a4)+

;66677777 d2/d3 = 6 d4/d5 = 7
    move.l  d4,d0
    add.l   d0,d0
    add.l   d2,d0
    add.l   d0,d0
    add.l   d2,d0
    add.l   d4,d0
    asr.l   #3,d0

    lea     (a5,d0.w*2),a6
    move.b  (a6)+,(a1)+
    move.b  (a6)+,(a2)+

    move.l  d5,d1
    add.l   d1,d1
    add.l   d3,d1
    add.l   d1,d1
    add.l   d3,d1
    add.l   d5,d1
    asr.l   #3,d1

    lea     (a5,d1.w*2),a6
    move.b  (a6)+,(a3)+
    move.b  (a6)+,(a4)+

    subq.l  #1,d7
    bne     .loop
Thorham is offline  
Old 22 September 2016, 13:49   #396
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,356
Quote:
Originally Posted by Thorham View Post
I thought only address registers were sign extended and didn't know movem does that for data registers as well That changes everything. The code now fits in 210 bytes All that needs to be done now is move some code around for pipelining (and maybe fix a bug or two ).
Good job, the best i could do is 242 bytes
meynaf is offline  
Old 22 September 2016, 18:07   #397
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,356
I did the "move some code around" and made the code a little shorter as well.
Normally it should work
Code:
.loop
 movem.w (a0)+,d0-d1/d3-d6	; d0=0l, d1=0r, d3=1l, d4=1r, d5=2l, d6=2r
 move.l d3,d7			; d0=0, d7=1
 add.l d0,d7			; d7=01
 add.l d7,d0			; d0=001
 add.l d0,d0			; d0=000011
 add.l d7,d0			; d0=00000111
 lsr.l #3,d0
 lea (a3,d0.w*2),a5
 move.b (a5)+,(a1)+		; l hi
 move.b (a5)+,(a2)+		; l lo
 move.l d4,d7
 add.l d1,d7
 add.l d7,d1
 add.l d1,d1
 add.l d7,d1
 lsr.l #3,d1
 lea (a3,d1.w*2),a5
 move.b (a5)+,(a4)+		; r hi
 add.l d3,d3			; d3=11
 add.l d5,d3			; d3=112
 lsl.l #2,d5			; d5=2222
 add.l d5,d3			; d3=1122222
 add.l d4,d4
 add.l d6,d4
 lsl.l #2,d6
 add.l d6,d4
 movem.w (a0)+,d0-d1/d5-d7	; d0=3l, d1=3r, d5=4l, d6=4r, d7=5l
 move.b (a5)+,(a6)+		; r lo
 add.l d0,d3			; d3=11222223
 add.l d1,d4
 lsr.l #3,d3
 lsr.l #3,d4
 lea (a3,d3.w*2),a5
 move.b (a5)+,(a1)+
 move.b (a5)+,(a2)+
 lea (a3,d4.w*2),a5
 move.b (a5)+,(a4)+
 move.b (a5)+,(a6)+
 add.l d5,d0			; d0=34
 lsr.l #1,d0			; d0=33334444 (34 <<2 >>3)
 lea (a3,d0.w*2),a5
 move.b (a5)+,(a1)+
 move.b (a5)+,(a2)+
 add.l d6,d1
 lsr.l #1,d1
 lea (a3,d1.w*2),a5
 move.b (a5)+,(a4)+
 add.l d7,d5			; d5=45
 lsl.l #2,d7			; d7=5555
 add.l d7,d5			; d5=455555 (l)
 movem.w (a0)+,d0-d1/d3-d4/d7	; d0=5r, d1=6l, d3=6r, d4=7l, d7=7r
 move.b (a5)+,(a6)+
 add.l d1,d5			; 4555556
 add.l d1,d5			; 45555566
 lsr.l #3,d5
 lea (a3,d5.w*2),a5
 move.b (a5)+,(a1)+
 move.b (a5)+,(a2)+
 add.l d0,d6			; d6=45
 add.l d0,d0			; d0=55
 add.l d3,d0			; d0=556
 add.l d0,d0			; d0=555566
 add.l d6,d0			; d0=45555566
 lsr.l #3,d0
 lea (a3,d0.w*2),a5
 move.b (a5)+,(a4)+
 move.b (a5)+,(a6)+
 add.l d4,d1			; d1=67, d4=7
 add.l d1,d4			; d1=67, d4=677
 add.l d4,d4			; d1=67, d4=667777
 add.l d4,d1			; d1=66677777
 lsr.l #3,d1
 lea (a3,d1.w*2),a5
 move.b (a5)+,(a1)+
 move.b (a5)+,(a2)+
 add.l d7,d3
 add.l d3,d7
 add.l d7,d7
 add.l d7,d3
 lsr.l #3,d3
 lea (a3,d3.w*2),a5
 move.b (a5)+,(a4)+
 move.b (a5)+,(a6)+
 subq.l #1,d2
 bgt .loop
meynaf is offline  
Old 22 September 2016, 20:02   #398
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,854
Quote:
Originally Posted by meynaf View Post
made the code a little shorter as well.


Quote:
Originally Posted by meynaf View Post
Normally it should work
So, how does it sound?
Thorham is offline  
Old 22 September 2016, 22:26   #399
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,356
Quote:
Originally Posted by Thorham View Post
So, how does it sound?
Good enough, apparently. How it compares to other methods is another thing and for this, i've zoned something for you. You will find several versions of my (command-line only) sound player in the archive. Feed them with some 44100 16bit stereo wave or aiff and enjoy the result (or not ).
These versions differ by something. I'm not telling who's who for not introducing psychologic bias in the test
meynaf is offline  
Old 22 September 2016, 22:56   #400
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,854
Quote:
Originally Posted by meynaf View Post
These versions differ by something. I'm not telling who's who for not introducing psychologic bias in the test
That's exactly how it should be. These kinds of tests always have to be blind or they're completely invalid.

I'm willing to bet that:

spl-a = 8:5
spl-b = not down sampled
spl-c = 5:3
spl-d = 2:1

Note: Your player doesn't handle the WAV I tried and had to convert it to AIFF. The WAV plays fine in HippoPlayer.
Thorham is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Starting ASM coding on A1200. Which Assembler? Nosferax Coders. Asm / Hardware 68 27 November 2015 16:14
4th tutorial on ASM- and HW-coding Vikke Coders. Asm / Hardware 11 10 April 2013 20:32
3rd tutorial on ASM- and HW-coding Vikke Coders. Asm / Hardware 6 26 March 2013 15:57
First tutorial on ASM- and HW-coding Vikke Coders. Asm / Hardware 46 18 March 2013 12:33
2nd tutorial on ASM- and HW-coding Vikke Coders. Asm / Hardware 10 17 March 2013 11:49

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 +2. The time now is 16:06.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13282 seconds with 14 queries