Как мы можем сделать метод saveFrame () в ExtractMpegFramesTest более эффективным?

[править] Переформатирование в формат вопросов и ответов по предложению fadden @.

ВExtractMpegFramesTest_egl14.java.txt, метод saveFrame (), есть цикл для переупорядочения RGBA в ARGB для сжатия растровых изображений png (см. цитаты из этого файла ниже), как это можно оптимизировать?

// glReadPixels gives us a ByteBuffer filled with what is essentially big-endian RGBA
// data (i.e. a byte of red, followed by a byte of green...).  We need an int[] filled
// with little-endian ARGB data to feed to Bitmap.
//

...

// So... we set the ByteBuffer to little-endian, which should turn the bulk IntBuffer
// get() into a straight memcpy on most Android devices.  Our ints will hold ABGR data.
// Swapping B and R gives us ARGB.  We need about 30ms for the bulk get(), and another
// 270ms for the color swap.

...

for (int i = 0; i < pixelCount; i++) {
    int c = colors[i];
    colors[i] = (c & 0xff00ff00) | ((c & 0x00ff0000) >> 16) | ((c & 0x000000ff) << 16);
}

Ответы на вопрос(2)

Ваш ответ на вопрос