Previous Page | Next Page

by nifanatic at 7:43 PM EDT on September 12, 2009
In any case, with voice replacements being worked on as well, having something to work with HPS files would be a godsend... Appreciate you taking up making something for it, hcs. :)

edited 10:31 PM EDT September 12, 2009
by god at 11:21 PM EDT on October 11, 2009
Under the "block info" section from an earlier post by hcs, there's this:
0x0C-0x13: left channel decode state
0x14-0x1B: right channel decode state

How are the decode states determined for HPS files given the DSP that it's playing for each block? Not changing them when inserting custom DSPs doesn't seem to affect the performance of the new HPS, but I'd like to be as accurate as possible.
by hcs at 2:21 AM EDT on October 12, 2009
I don't know if those states are actually used by the decoder, but the test program I wrote confirms that those are the accurate values at the start of each block.
The state breaks down as follows:
0-1: initial p/s (this is simply the first byte of the channel)
2-3: initial history 1
4-5: initial history 2
6-7: 0?

The histories are computed by decoding the previous block and seeing what the last two samples were.

Note: I can post what code I have now if you're interested, but note that it's only in the "check existing .hps" stage.

edited 10:44 AM EDT October 12, 2009
by god at 1:17 PM EDT on October 12, 2009
Cool, I was just wondering how it affected the HPS while decoding. I understand the histories, etc.

I wrote a program that runs dspadpcm and inserts the DSPs created into a temp.hps file. I found out at first that I had made an error with those decoder states (I just didn't include them in the block headers), so I wondered what use they had.

I'd be interested in the code. I think I could learn a few things.
by hcs at 3:09 PM EDT on October 12, 2009
Here ya go, heed the readme.
[edit]
Bah, miswrite in said readme, it should say that the history tests should only be skipped on the loop check pass.

edited 3:20 PM EDT October 12, 2009
Updated as a result.

edited 3:22 PM EDT October 12, 2009
by god at 12:34 AM EST on November 17, 2009
Bumping this up.

hcs says:
"The histories are computed by decoding the previous block and seeing what the last two samples were."

Can you clear up how this is done?
I'd like to perfect this HPS substitution program I have, which currently skips over the decoder states without changing them. The audio works, but there are pops and cracks at some points in the music when it's played ingame.

When I read this, I thought you meant that the last 8 bytes from each block were repeated as the decoder states (histories), but when I checked some of the original HPS files from the game, I couldn't find any evidence of that. There seems to be some calculation done to figure these values out.
by hcs at 3:42 AM EST on November 17, 2009
Take a look at the loop at line 459, that's what does the decoding. Then the final values at info[c].state.hist1 and hist2 should be in the header of the next block (though this does not hold for the loop, apparently).

edited 3:44 AM EST November 17, 2009
by god at 10:09 AM EST on November 17, 2009
Thanks.
So the decode_dsp_nowhere() will crank out the hist1 and hist2 for the block. I didn't see that at first. Thank you.
May I use this code (with a few changes) in my program?
by hcs at 11:25 AM EST on November 17, 2009
You're welcome to it. I'd like to see source to the result, but I don't demand it.
by Decipio at 6:09 AM EDT on March 24, 2016
Hey hcs, I know this is an old topic but do you mind if I take hcshps and use it for pretty much the same exact reason that god was using it? If I get it to work I would of course give you credit for the parts that you did and can show you the source.

Previous Page | Next Page
Go to Page 0 1 2

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source