summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2017-01-31 00:11:49 +0200
committerOleg Oshmyan <chortos@inbox.lv>2017-01-31 02:13:30 +0200
commitcb985b51683dcbff5671cf9abc65b1b0825b2e75 (patch)
treeb230f7b01929fb42354e56078289e0c3521f8165 /libass
parentd4bd51a0b1e7192773af328213b51b19931602db (diff)
downloadlibass-cb985b51683dcbff5671cf9abc65b1b0825b2e75.tar.bz2
libass-cb985b51683dcbff5671cf9abc65b1b0825b2e75.tar.xz
Reduce precision of border width in outline cache keys
The value used to generate outline cache values is 26.6, so there is no point in storing the more precise 16.16 in the cache key. Indeed, this can only reduce the efficiency of the cache and provide an extra opportunity for overflow.
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_cache_template.h2
-rw-r--r--libass/ass_render.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/libass/ass_cache_template.h b/libass/ass_cache_template.h
index 834dafe..9d81231 100644
--- a/libass/ass_cache_template.h
+++ b/libass/ass_cache_template.h
@@ -90,7 +90,7 @@ START(glyph, glyph_hash_key)
GENERIC(int, italic)
GENERIC(unsigned, scale_x) // 16.16
GENERIC(unsigned, scale_y) // 16.16
- FTVECTOR(outline) // border width, 16.16
+ FTVECTOR(outline) // border width, 26.6
GENERIC(unsigned, flags) // glyph decoration flags
GENERIC(unsigned, border_style)
GENERIC(int, hspacing) // 16.16
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 558f504..046ab57 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -1084,8 +1084,8 @@ fill_glyph_hash(ASS_Renderer *priv, OutlineHashKey *outline_key,
outline_key->type = OUTLINE_DRAWING;
key->scale_x = double_to_d16(info->scale_x);
key->scale_y = double_to_d16(info->scale_y);
- key->outline.x = double_to_d16(info->border_x * priv->border_scale);
- key->outline.y = double_to_d16(info->border_y * priv->border_scale);
+ key->outline.x = double_to_d6(info->border_x * priv->border_scale);
+ key->outline.y = double_to_d6(info->border_y * priv->border_scale);
key->border_style = info->border_style;
// hpacing only matters for opaque box borders (see draw_opaque_box),
// so for normal borders, maximize cache utility by ignoring it
@@ -1106,8 +1106,8 @@ fill_glyph_hash(ASS_Renderer *priv, OutlineHashKey *outline_key,
key->italic = info->italic;
key->scale_x = double_to_d16(info->scale_x);
key->scale_y = double_to_d16(info->scale_y);
- key->outline.x = double_to_d16(info->border_x * priv->border_scale);
- key->outline.y = double_to_d16(info->border_y * priv->border_scale);
+ key->outline.x = double_to_d6(info->border_x * priv->border_scale);
+ key->outline.y = double_to_d6(info->border_y * priv->border_scale);
key->flags = info->flags;
key->border_style = info->border_style;
key->hspacing =