bootanimation: add multithreaded decode
Some devices can't keep up on a single thread trying to decode & display the frames at a high frame rate. This is observed if the sleep delay between frames is negative: 01-02 04:29:25.114 530 542 D BootAnimation: 63, -22 01-02 04:29:25.176 530 542 D BootAnimation: 61, -20 01-02 04:29:25.248 530 542 D BootAnimation: 72, -30 01-02 04:29:25.315 530 542 D BootAnimation: 66, -24 01-02 04:29:25.381 530 542 D BootAnimation: 66, -24 To mitigate this, take advantage of multiple cores by decoding on n cores and caching up to m images. This keeps the memory footprint small(ish) while still giving the best chance to maintain a constant frame rate. I measured boot time and fps for each animation part before and after the change on an msm8909 with 1.5 GB RAM: single thread: 01-02 04:40:45.826 540 556 I BootAnimation: fps = 22.40 01-02 04:40:49.457 540 556 I BootAnimation: fps = 13.22 01-02 04:40:51.464 540 556 I BootAnimation: fps = 23.92 01-02 04:41:19.375 540 556 I BootAnimation: fps = 22.89 01-02 04:41:23.942 540 556 I BootAnimation: fps = 15.55 boot time: 51.05s multi thread: 01-02 04:38:55.148 526 551 I BootAnimation: fps = 22.56 01-02 04:38:57.205 526 551 I BootAnimation: fps = 23.39 01-02 04:38:59.249 526 551 I BootAnimation: fps = 23.92 01-02 04:39:29.196 526 551 I BootAnimation: fps = 23.16 01-02 04:39:32.186 526 551 I BootAnimation: fps = 23.79 boot time: 50.50s Need to test the affect on boot time with an animation that doesn't cache the textures as much as this to see the real effect. RM-290 Change-Id: If7464dc063b08a0bc33ee3f094028247b39650c1 (cherry picked from commit 66af012f)
Loading
Please register or sign in to comment