Update default glyph size to be 10,000.#62
Update default glyph size to be 10,000.#62j3553a wants to merge 1 commit intopeerless2012:masterfrom
Conversation
|
Is 10000 is too big for mobile devices, some tv memory is very small. Maybe 4096 is enough? |
|
I would actually anticipate a larger glyph size of 10k will help weaker hardware process the subtitles easier. My understanding is a larger glyph size will help prevent as much "churn" as it tries to purge older glyphs. We still have the 128 MB cache and the 10k limit isn't preallocated. More glyphs might hang around for longer taking a little bit more memory but preventing the constant purging of glyphs should help with performance. |
|
I worried about more glyph size, the more memory usage, and for a movie, 4096 glyph is enough I think. |
|
The memory cache is still capped at 128 MB and shouldn't use more than that. The glyph size of 10k will actually just leverage more of that cache. A 1080p glyph would be something like a 60x60 pixel 8 bit alpha bitmap and might use around 4KB of memory per glyph whereas a 4k glyph would be something like 120x120 pixels and might use around 14KB of memory per glyph. That means at 1024 glyphs it was only using a maximum of 4MB at 1080p and 14MB at 4K. This meant the system only used between 4 and 14 MB of the total 128 MB cache. A glyph size of 10,000 would give us a range of 40 MB and 140 MB which fits a lot nicer in the 128 MB cache limit and doesn't leave idle preallocated cache memory. A 10k glyph size will allow for stronger hardware to utilize the cache more efficiently and it shouldn't necessarily affect clients with weaker hardware. This change would just utilize the cache it is preallocating in a more affective means. Not to mention that less glyph churn will help prevent glyphs from being deallocated and cause memory gaps making it harder to fit glyphs into the cache. We should see more contiguous blocks of memory. |
|
It seems glyph and bitmap share the cache size, and more glyph will keep more memory and make bitmap cache space be small. And on 4k video, the cache is too small. And you can make a test for 128M and 4096 glyph for a while, let's to see the difference. |
|
I'll do some testing on 4096 and report back. |
|
My understanding is that the glyph limit and bitmap cache aren't two separate pools competing for space. The glyphs are the bitmaps. By raising the limit to 10,000, we aren't shrinking the bitmap space. We are just allowing the 128MB cache to actually fill up. |
This change improves stability and matches the upstream libass repo's default glyph size.