[FFmpeg-devel] [PATCH 2/3] lavfi: add a generic API for buffer queues.
nicolas.george at normalesup.org
Sun May 20 21:23:55 CEST 2012
Le nonidi 9 floréal, an CCXX, Michael Niedermayer a écrit :
> i suggest & (FF_BUFQUEUE_SIZE-1) and only allowing powers of 2
> the & should be much faster than a %
I made sure that the arguments are unsigned, so any half-decent compiler can
optimize the % to a & if the base is a power of 2. I checked that at least
gcc is a half-decent compiler. And I added a comment that powers of 2 are to
> a av_assert() could be used here to detect tries to take out of an
> empty queue
> otherwise LGTM as long as theres no plan to use this between 2 threads
Added a comment about that, along with some doxy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the ffmpeg-devel