Rasterizer: Remove an unused function.
Subtitle rendering cache: Optimize the removal of old cached value.

Also make sure that Clear correctly release all memory immediately.
Subtitle renderer: Optimize the outline cache.

Use smart pointers to avoid copy.
Subtitle renderer: Optimize the overlay cache.

Use smart pointers to avoid copy.
Subtitle renderer: Optimize polygon parsing.
Subtitle renderer: Add a cache for polygons.

This helps a lot for subtitles which use drawing heavily.
Subtitle renderer: Avoid creating some temporary strings.
Subtitle renderer: Optimize slightly GetStyle and GetCharSet functions.
Rasterizer: Factorize some code.

Note that I had to template the new function and forcingly inline it to reduce the performance impact.
Subtitle renderer: Fix the overlap algorithm used to create the outlines.

As far as I can tell the visual impact was minor or even non-existent.
Text subtitles: Faster algorithm for the outline creation.

It can be around twice faster than the old algorithm when creating heavy outline. Overall the total rendering time can be reduced by nearly a quarter.

Thanks a lot to Silk for his input on the mathematical side of this commit.
Subtitle renderer: Move all cache instances in a structure for easier use.
Subtitle renderer: Add a cache for the ellipses used to render the outlines.
Subtitle input pin: Add a worker thread to buffer the input samples.

Try to mitigate the fact embedded ASS/SSA subtitles tend to generate plenty of small samples.