Hi,

Am 15.02.2011 02:39, schrieb Romain Beauxis:
> Le lundi 14 février 2011 15:34:55, Burkhard Plaum a écrit :
>> - When using application supplied memory, make sure that all scanlines are
>>    aligned at 16 byte boundaries. If this isn't possible, use a temporary
>>    frame and gavl_video_frame_copy(). gavl_video_frame_copy() is quite
>>    well optimized and doesn't require alignment (better to fix the
>>    application though)
>
> Thanks for the detailed explanation, I confirm your analysis.
>
> This is a bit of a bummer for our case, though, because we are passing frames
> back and forth between OCaml and gavl. We have little control over OCaml's
> memory representation and we initially wanted the binding for gavl to not copy
> data..

Yea, I always have the same problem when using memory from other libraries.

> I will see what can be done about it.. Last question though: is there any
> function in Gavl's API that allows to test if memory allignment is not
> correct?

Not yet, but a function gavl_video_frame_is_aligned() would be easy to write.
Just cast all plane pointers to long and check if they are multiples of 16,
then check if all strides are multiples of 16.

In videoframe.c there is a macro ALIGNMENT_BYTES which should be used for the
case the alignment is changed in a future version.

You can do that if you want.

Burkhard

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Gmerlin-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gmerlin-general

Reply via email to