Renderscript in Nougat can include reduction kernels, which will be more efficient for the RAW histogram and L2 processing. The Allocation.createAllocations() function can also be used to generate input buffers which share a bufferQueue, which may also improve performance for YUV (i.e. by passing the buffers directly through the Surface rather than through the grayscale() Renderscript kernel).
This has been tried before (see, for instance, this past snapshot) but in this implementation, different memory for the two Allocation usages caused inconsistent trigger results. For example, calling Allocation.copy2DRangeTo() immediately before and after Allocation.ioReceive() will typically yield different results for the old and new buffers, but occasionally the buffer values will not be changed; however, invoking a kernel on the Allocation will reflect the new buffer values.
Renderscript in Nougat can include reduction kernels, which will be more efficient for the RAW histogram and L2 processing. The
Allocation.createAllocations()function can also be used to generate input buffers which share a bufferQueue, which may also improve performance for YUV (i.e. by passing the buffers directly through theSurfacerather than through thegrayscale()Renderscript kernel).This has been tried before (see, for instance, this past snapshot) but in this implementation, different memory for the two
Allocationusages caused inconsistent trigger results. For example, callingAllocation.copy2DRangeTo()immediately before and afterAllocation.ioReceive()will typically yield different results for the old and new buffers, but occasionally the buffer values will not be changed; however, invoking a kernel on theAllocationwill reflect the new buffer values.