English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 04 May 2020, 17:34   #1
stevelord
Registered User

 
Join Date: Apr 2019
Location: UK
Posts: 94
Approaches to MHI

Hi all,


I'm about to start trying to cut my first bit of Amiga C in god knows how long. The itch I want to scratch is to use the ZZ9000's ARM core to decode MPEG frames in the most compatible method possible. On the ZZ9000 side, I think the minimp3 library should be able to take care of business. The Amiga side is a bit of a hodge podge.


I was wondering what might be the most portable (i.e. supporting Paula, AHI and the most applications) way to do the decode? One option would be to bundle the code into an mpega.library. Another would be to create a ZZ9000 MHI device.


My two main source options appear to be mhi_dev.lha and mhimdev.lha on Aminet, both taking subtly different approaches.


I was wondering what the simplest and most portable approach would be (and any source links would be gratefully received). I'm confident once I can pass whatever the Amiga generates onto the ZZ9000 side I can take it from there, but the Amiga side is after I stopped and I can't find much else on MHI in general.


Cheers,
Steve
stevelord is offline  
Old 07 May 2020, 00:21   #2
smack
Registered User
 
Join Date: May 2020
Location: Germany
Posts: 2
MHI is intended to be used with integrated decoder and player hardware, for example external devices like MAS Player or sound boards like Delfina DSP. MHI has functions to send MP3 data to the decoder, but it doesn't have any functions to read the decoded audio data back from the hardware decoder into Amiga memory.

A similar decoder interface is mpeg.device, which was defined by Commodore for the MPEG decoder expansion of the CD32, IIRC. It has similar features and the same restrictions as MHI. In fact, MHI is a more recent copy of the mpeg.device interface, just using library function calls instead of device IO. This is exploited by mhimdev.library, which is a driver for MHI that forwards all function calls and data to a mpeg.device driver.

If you want to support playback through Paula and AHI-compatible devices then you can't use the MHI or mpeg.device interfaces for your decoder software.

IMO, your best option would be an mpega.library clone. Your implementation would write the MP3 data to the hardware decoder, start the MPEG frame decoder, wait for decoding to be finished and read the decoded audio samples back into Amiga memory. Mpega.library is used by many programs, including popular players featuring AHI playback, such as AmigaAMP.
smack is offline  
Old 10 May 2020, 13:41   #3
smack
Registered User
 
Join Date: May 2020
Location: Germany
Posts: 2
In case you're still interested in the topic and need some more info...

MPEGA library, binary and complete source code (most important: interface doc, include files and code of mpega.library framework)
https://aminet.net/package/util/libs/mpega_library
https://aminet.net/package/util/libs/MPEGALibrary_src

MPEGA library clone using libmad decoder (alternative implementation of mpega.library framework)
https://aminet.net/package/util/libs/mpega_libmad

Depending on the capabilities of your MPEG frame decoder running on the fast co-processor, you might have to write some code on the Amiga side that partially parses the MPEG bitstream and splits it into self-contained MPEG frame data packets, handling the "mp3 bit reservoir" feature that spreads frame data across frame boundaries in the bitstream.
You can find such an implementation in the code (Amiga C part) of the MPEG decoder for Delfina DSP which I wrote 20 years ago.
https://aminet.net/package/mus/play/DelfMPEG
https://aminet.net/package/mus/play/dmdev
smack is offline  
Old 10 May 2020, 19:41   #4
stevelord
Registered User

 
Join Date: Apr 2019
Location: UK
Posts: 94
Thanks for the heads up. I'm definitely interested. I spoke to Lukas about the ZZ9000 side, and he informed me that FW 2.0 is going to be completely different. I think it won't be compatible. This gives me some time to read, thanks!
stevelord 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
[blitz] gui for MHI - ready to use peceha Coders. Blitz Basic 28 19 April 2020 23:44

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 22:43.


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