What happened?
Description
When playing a 70 GB Blu-ray MKV file, enabling PGS subtitles causes significantly higher CPU usage.
CPU Usage
| PGS Subtitles |
CPU Usage |
| Disabled |
Peak: ~65%, Average: ~35% |
| Enabled |
100%+ |
Environment
- Source: Blu-ray MKV
- File size: ~70 GB
- Subtitle format: PGS
- Measurement: Xcode Instruments – Time Profiler
Profiling
With PGS subtitles enabled, imageForSubtitleRect in EmbeddedSubtitleDecoder.swift is the top CPU-consuming function on the Main Thread.
Call stack:
imageForSubtitleRect
└── decodeStoredSubtitlePacket
└── subtitleDrainTick
└── startSubtitleDrainer
The CPU usage drops significantly when PGS subtitles are disabled.
Expected Behavior
PGS subtitle rendering should not cause excessive CPU usage during playback, especially when the subtitle content is not changing frequently.
Additional Information
The issue appears to be related to PGS subtitle bitmap processing in imageForSubtitleRect.
Steps to reproduce
none
AetherEngine version or commit SHA
4ef5ef9
Host app
Custom / my own integration
Platform
iOS
OS version
iOS26
Device / chip
iPhone16
Playback path
Native AVPlayer
Source media (for playback bugs)
No response
Error codes / log lines
Anything else
No response
What happened?
Description
When playing a 70 GB Blu-ray MKV file, enabling PGS subtitles causes significantly higher CPU usage.
CPU Usage
Environment
Profiling
With PGS subtitles enabled,
imageForSubtitleRectinEmbeddedSubtitleDecoder.swiftis the top CPU-consuming function on the Main Thread.Call stack:
The CPU usage drops significantly when PGS subtitles are disabled.
Expected Behavior
PGS subtitle rendering should not cause excessive CPU usage during playback, especially when the subtitle content is not changing frequently.
Additional Information
The issue appears to be related to PGS subtitle bitmap processing in
imageForSubtitleRect.Steps to reproduce
none
AetherEngine version or commit SHA
4ef5ef9
Host app
Custom / my own integration
Platform
iOS
OS version
iOS26
Device / chip
iPhone16
Playback path
Native AVPlayer
Source media (for playback bugs)
No response
Error codes / log lines
Anything else
No response