Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Decoder and External MemoryAllocator

selea
Beginner
232 Views
Good morning, I found a problem when you try to use an External MemoryAllocator with a IPP decoder: for example MPEG4VideoDecoder.
I'm using latest IPP 6.1.5.054 library and IPP sample 6.1.5.060
The problem is that if you create the external Memory Allocator and pass it to the Init of the decoder, when you decoder make the line:

status = BaseCodec::Init(lpInit);

decoder check if you pass an allocator or have to create new one, but this condition:

if (init->lpMemoryAllocator) {
if (m_bOwnAllocator || m_pMemoryAllocator != init->lpMemoryAllocator) {
vm_debug_trace(VM_DEBUG_ERROR, VM_STRING("can't replace external allocator\\n"));
return UMC_ERR_INIT;
}

you get always UMC_ERR_INIT because the m_pMemoryAllocator is NULL. I have changed the line in this mode

if (init->lpMemoryAllocator) {
if (m_bOwnAllocator || (m_pMemoryAllocator != init->lpMemoryAllocator)&&(m_pMemoryAllocator!=NULL)) {
vm_debug_trace(VM_DEBUG_ERROR, VM_STRING("can't replace external allocator\\n"));
return UMC_ERR_INIT;
}

I get it works.
It's useful to take the MemoryAllocator extern from the decoder, so if you have to destroy and recreate the decoder you do not need to free all the memory allocated.
regards
0 Kudos
2 Replies
PaulF_IntelCorp
Employee
232 Views
Thank you for providing that useful bit of information regarding the UMC sample code!
0 Kudos
Chao_Y_Intel
Moderator
232 Views


Hi,

The engineer suggested that:

Thesamples has the wrong condition:
(m_bOwnAllocator || m_pMemoryAllocator != init->lpMemoryAllocator)


this shouldbe replaced with:

(m_bOwnAllocator && m_pMemoryAllocator != init->lpMemoryAllocator)

The fix will be included in the future version.

Thanks,
Chao

0 Kudos
Reply