techyian
Posts: 15
Joined: Mon Jan 22, 2018 11:40 am

PPM/TGA support in MMAL image encoder

Fri May 18, 2018 8:36 am

Hi,

Regression tests for MMALSharp have picked up an issue with the image encoder component throwing ENOSPC errors for PPM/TGA encodings. I was just wondering if anyone could confirm these encoding types work ok in MMAL natively so I know if it's an issue on my end?

Buffer num and buffer size for output port seems to be getting set at the values for buffernummin and buffersizemin.

Thanks,
Ian

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5064
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: PPM/TGA support in MMAL image encoder

Fri May 18, 2018 9:31 am

techyian wrote:
Fri May 18, 2018 8:36 am
Regression tests for MMALSharp have picked up an issue with the image encoder component throwing ENOSPC errors for PPM/TGA encodings. I was just wondering if anyone could confirm these encoding types work ok in MMAL natively so I know if it's an issue on my end?

Buffer num and buffer size for output port seems to be getting set at the values for buffernummin and buffersizemin.
image_encode and image_decode use libraries to implement the codec functions and advertise the list of all libraries that it knows how to address. The TGA and PPM libraries are not built into the Pi firmware.
I have just been through improving the supported formats listing in video_encode and video_decode, but haven't touched image_encode/decode as yet. Is it a big deal to you? Are you actually reading back MMAL_PARAMETER_SUPPORTED_ENCODINGS or just hard coding a table of supported formats?
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

techyian
Posts: 15
Joined: Mon Jan 22, 2018 11:40 am

Re: PPM/TGA support in MMAL image encoder

Fri May 18, 2018 10:21 am

Thanks for the heads up on that. Yes, currently using the MMAL_PARAMETER_SUPPORTED_ENCODINGS call to check supported encoding types. Are you planning any changes to the MMAL_PARAMETER_ENCODING_T struct at all to signify whether support is built in?

Am I right in thinking libnetpbm and libtga are suitable libraries to use or does MMAL call specific libs? I'll have a try later and report back.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5064
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: PPM/TGA support in MMAL image encoder

Fri May 18, 2018 11:58 am

techyian wrote:
Fri May 18, 2018 10:21 am
Thanks for the heads up on that. Yes, currently using the MMAL_PARAMETER_SUPPORTED_ENCODINGS call to check supported encoding types. Are you planning any changes to the MMAL_PARAMETER_ENCODING_T struct at all to signify whether support is built in?
I can look into it, but hadn't been planing on doing so until now. TBH I'll probably do a simple #ifdef to cull them as the Pi firmware branch doesn't need to support them at all.
techyian wrote: Am I right in thinking libnetpbm and libtga are suitable libraries to use or does MMAL call specific libs? I'll have a try later and report back.
No, these are all libraries built into the GPU firmware rather than ARM side libraries.

Having looked at the implementations of the codecs in the firmware tree there's no vector acceleration. They both appear to be simple bit manipulations of the RGB values. The ARM core(s) are clocked faster than the VPU on all the Pi SoCs, so an ARM library is likely to be comparable in speed.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5064
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: PPM/TGA support in MMAL image encoder

Fri May 18, 2018 4:08 pm

OK, so this has started debate on whether we actually add support so you can throw almost anything and everything at image_decode / encode. There's no licencing issue, but it's unknown if it actually works.
I'll have a play to see what happens.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

techyian
Posts: 15
Joined: Mon Jan 22, 2018 11:40 am

Re: PPM/TGA support in MMAL image encoder

Fri May 18, 2018 9:08 pm

Great, let me know if there's anything I can do to help.

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 6 guests