4

I render a texture to both display and a codec input surface (from where an encoder uses it). There is a large performance variation when the texture is rendered to the display surface, and when it is rendered to the input surface of the encoder, but only on some devices, like S3 Galaxy (~10 times slower to render to encoder surface). On other devices, the speed is similar (S4, Nexus4, etc).

A similar scenario can be demonstrated with Grafika and Record GL app activity. (FBO blit x2) The fps drops from ~60 to 6 only for the mentioned device, while for the other devices there is a constant rate of 60 for both recording+display and displaying alone. To be really similar, recording+display can be reduced to just recording, keeping the same performance.

Is there any good reason for this performance drop while using the encoder surface? Is it a bug in Mali400 or S3 drivers?

user1592546
  • 1,480
  • 1
  • 14
  • 30
  • Is the performance drop proportional to the video dimensions? My guess would be that the RGB-to-YUV conversion is to blame. The colorspace conversion can be done by the GPU, the video encoder, by a dedicated piece of hardware, or in software. For separate hardware blocks there can be a limit on the number of simultaneous uses, so even if it exists it might be tied up by something else (like converting the camera YUV to RGB) and unavailable to your app. If the conversion is happening in software I would expect the frame rate to be poor. – fadden Nov 06 '14 at 17:26
  • I'll check it, but I know that a program converting rgb->yuv on the same gpu runs much faster. Only glReadPixels was this slow, but I thought they had some magic to get the data directly from ram. Or maybe they are doing the conversion on cpu. I am not using the camera. I decode video, apply effect, and re-encode for 720p. – user1592546 Nov 06 '14 at 20:04
  • @fadden: At 720p, 7Mbps, Grafika encodes at ~4fps, and at 360p, 4Mbps, it encodes at 20fps. I removed the render to texture and render texture to display. It renders directly to Codec input surface. The glReadPixels speed test results: 360p: 16ms/iteration, 720p: 70ms/iteration. It could be a reason, but there are other bottleneck too. – user1592546 Dec 03 '14 at 14:16

0 Answers0