summaryrefslogtreecommitdiffstats
path: root/libass/ass_render.h
diff options
context:
space:
mode:
authorDr.Smile <vabnick@gmail.com>2019-05-20 00:48:26 +0300
committerDr.Smile <vabnick@gmail.com>2019-05-20 00:48:26 +0300
commitc80f332798238731e1ddf1b541748f3d5c8030f3 (patch)
tree15e6abced78c7bb18c496a9f8eb9d4d3f6613b95 /libass/ass_render.h
parent13f5a18f2b6b7c384d2801beecd6d5c29c164ef1 (diff)
downloadlibass-c80f332798238731e1ddf1b541748f3d5c8030f3.tar.bz2
libass-c80f332798238731e1ddf1b541748f3d5c8030f3.tar.xz
Consolidate and quantize all transformations
This commit defers all outline transformations until rasterization stage. Combined transformation is then quantized and used as bitmap key. That should improve performance of slow animations. Also caching of initial and stroked outlines and bitmaps is now separate in preparation to proper error estimation for stroker stage. Note that Z-clipping for perspective transformations is now done differently compared to VSFilter. That clipping is mostly safety feature to protect from overflows and divisions by zero and is almost never triggered in real-world subtitles.
Diffstat (limited to 'libass/ass_render.h')
-rw-r--r--libass/ass_render.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/libass/ass_render.h b/libass/ass_render.h
index 539d619..f8d84f9 100644
--- a/libass/ass_render.h
+++ b/libass/ass_render.h
@@ -113,6 +113,10 @@ typedef struct {
CompositeHashValue *image;
} CombinedBitmapInfo;
+typedef struct {
+ ASS_DVector scale, offset;
+} ASS_Transform;
+
// describes a glyph
// GlyphInfo and TextInfo are used for text centering and word-wrapping operations
typedef struct glyph_info {
@@ -130,8 +134,9 @@ typedef struct glyph_info {
char *drawing_text;
int drawing_scale;
int drawing_pbo;
- ASS_Outline *outline;
- ASS_Outline *border[2];
+ OutlineHashValue *outline, *border;
+ ASS_Transform outline_transform;
+ ASS_Transform border_transform;
ASS_Rect bbox;
ASS_Vector pos;
ASS_Vector offset;
@@ -166,8 +171,9 @@ typedef struct glyph_info {
int shape_run_id;
- BitmapHashKey hash_key;
- BitmapHashValue *image;
+ ASS_Vector shift;
+ ASS_Vector bitmap_advance;
+ BitmapHashValue *image, *image_o;
// next glyph in this cluster
struct glyph_info *next;