-->

Performance variation of encoder using MediaCodec

2019-03-31 08:45发布

问题:

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?