diff options
author | Dr.Smile <vabnick@gmail.com> | 2019-05-20 00:48:26 +0300 |
---|---|---|
committer | Dr.Smile <vabnick@gmail.com> | 2019-05-20 00:48:26 +0300 |
commit | c80f332798238731e1ddf1b541748f3d5c8030f3 (patch) | |
tree | 15e6abced78c7bb18c496a9f8eb9d4d3f6613b95 /libass/ass_cache.h | |
parent | 13f5a18f2b6b7c384d2801beecd6d5c29c164ef1 (diff) | |
download | libass-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_cache.h')
-rw-r--r-- | libass/ass_cache.h | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/libass/ass_cache.h b/libass/ass_cache.h index 453cefac..93e5e118 100644 --- a/libass/ass_cache.h +++ b/libass/ass_cache.h @@ -30,9 +30,7 @@ typedef struct cache Cache; // cache values typedef struct { - bool valid; - Bitmap *bm; // the actual bitmaps - Bitmap *bm_o; + Bitmap *bm; // the actual bitmap } BitmapHashValue; typedef struct { @@ -43,11 +41,10 @@ typedef struct { typedef struct { bool valid; - ASS_Outline outline; - ASS_Outline border[2]; - ASS_Rect bbox_scaled; // bbox after scaling, but before rotation - int advance; // 26.6, advance distance to the next outline in line - int asc, desc; // ascender/descender + ASS_Outline outline[2]; + ASS_Rect cbox; // bounding box of all control points + int advance; // 26.6, advance distance to the next outline in line + int asc, desc; // ascender/descender } OutlineHashValue; typedef struct { @@ -71,27 +68,18 @@ typedef struct outline_hash_key { enum { OUTLINE_GLYPH, OUTLINE_DRAWING, + OUTLINE_BORDER, + OUTLINE_BOX, } type; union { GlyphHashKey glyph; DrawingHashKey drawing; - OutlineCommonKey common; + BorderHashKey border; } u; } OutlineHashKey; -typedef struct bitmap_hash_key { - enum { - BITMAP_OUTLINE, - BITMAP_CLIP, - } type; - union { - OutlineBitmapHashKey outline; - ClipMaskHashKey clip; - } u; -} BitmapHashKey; - typedef struct { - BitmapHashValue *image; + BitmapHashValue *image, *image_o; int x, y; } BitmapRef; |