Le quartidi 4 brumaire, an CCXXIV, Gwenole Beauchesne a écrit : > Allow for av_malloc() to allocate memory that could be mapped into > the GPU address space. This requires allocations on page boundaries. > On the video memory buffers side, this requires minimal alignment of > strides to 64 bytes. > > Option 1: use heuristics in av_malloc() > - break down into mem, frame, and avcodec changes.
Heuristics are fragile, and the result would probably be many false positive, wasting quite a lot of memory. > Option 2: use a finer decision model > - mem: add av_malloc_aligned() > - buffer: add av_buffer_alloc2() with align and/or flags > - frame/avcodec: use new APIs I would go for flags all the way: with an explicit align value, people will hardcode a random value based on whichever example they looked at, and it will break when CPUs are upgraded to a larger value. The API should probably include some kind of "av_foobar_get_align_flags()" for each foobar domain where alignment can become visible to the application. Regards, -- Nicolas George
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel