summaryrefslogtreecommitdiffstats
path: root/libass/ass_cache_template.h
Commit message (Collapse)AuthorAgeFilesLines
* renderer: quantize blur radius and shadow offsetDr.Smile2019-05-201-1/+1
|
* bitmap: remove level of indirection in bitmap functionsDr.Smile2019-05-201-2/+2
| | | | | This allows to use Bitmap struct directly as cache value and to remove bunch of unnecessary allocations.
* renderer: improve handling of subpixel shiftDr.Smile2019-05-201-0/+8
| | | | | | | Integral pixel shift is extracted in quantization function now, taking account of full glyph transformation and not only translation part of it. It makes program logic more straight and ensures that subpixel shift from cache key never exceed full pixel.
* Consolidate and quantize all transformationsDr.Smile2019-05-201-45/+17
| | | | | | | | | | | | | | 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.
* cache: cleanupDr.Smile2019-05-191-14/+4
|
* cache: construct cache values only from corresponding keysDr.Smile2019-05-191-18/+31
| | | | | | | | | | | | | | | | | | | | This commit forces construction of cache values using only data available in its companion keys. That ensures logical correctness: keys are guaranteed to have all the necessary data, and prevents accidental collisions. Most fixes of cache logic correspond to minor problem when rendering is done with double parameter but cache key stores its approximate fixed-point representation. The only serious problem is missing scale of clip drawing. Also this commit removes unused scale parameters from glyph metrics cache key. Due to missing scale clip shapes that differed only in scale treated by cache system as identical. That can lead to incorrect reuse of cached bitmap of different scale instead of correct one. The only hack left is in glyph metrics cache with its unicode >= VERTICAL_LOWER_BOUND check.
* drawing: remove unnecessary fields from ASS_Drawing structDr.Smile2019-05-191-1/+0
|
* Replace FreeType types with libass native typesDr.Smile2017-09-171-9/+9
| | | | | | FT_Vector and FT_BBox types are based on FT_Pos, which is alias of long. FreeType treats it as 32-bit integer, but on some platforms long can be 64-bit. That leads to wasted memory and suboptimal performance.
* Reduce precision of border width in outline cache keysOleg Oshmyan2017-01-311-1/+1
| | | | | | | 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.
* cache: remove unused BINSTRING field typewm42015-10-061-9/+0
| | | | Its only use was removed in commit b63d8931.
* Fix degrees/radians cache confusion; avoid a fixed-point overflowRodger Combs2015-03-121-3/+3
| | | | Also fix an incorrect comment
* Clean up bitmap combiningDr.Smile2015-01-281-34/+5
| | | | | | | | | | Now pre- and post-combining operations are clearly separated, many parameters in cache keys are no longer necessary due to that. Also an ambiguous (in case of multiple fonts) text string is replaced with a list of direct bitmap references in composite cache key. Fixes #153. Fixes #82.
* Silence compilation warningwm42014-10-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This fixes the following warnings: In file included from ass_cache.c:34:0: ass_cache_template.h:52:0: warning: "BINSTRING" redefined #define BINSTRING(member) \ ^ In file included from ass_cache.h:59:0, from ass_font.h:58, from ass_cache.c:28: ass_cache_template.h:9:0: note: this is the location of the previous definition #define BINSTRING(member) \ ^ In file included from ass_cache.c:36:0: ass_cache_template.h:30:0: warning: "BINSTRING" redefined #define BINSTRING(member) \ ^ In file included from ass_cache.c:34:0: ass_cache_template.h:52:0: note: this is the location of the previous definition #define BINSTRING(member) \ ^
* Fix caching of combined bitmaps after complex shapingOleg Oshmyan2014-09-051-1/+9
|
* Fix subpixel jumping of rotated glyph runsOleg Oshmyan2014-01-291-0/+2
| | | | | Rotation origin was not taken into account when caching glyph run bitmaps.
* Combine bitmaps before applying blur and shadow11rcombs2014-01-251-13/+28
|
* Distinguish cached glyphs with different hspacing when border_style == 3Oleg Oshmyan2014-01-081-0/+2
| | | | hspacing affects opaque box borders.
* harfbuzz: cache glyph metricsGrigori Goronzy2011-07-291-0/+9
| | | | | | HarfBuzz' FreeType font functions do not cache anything and call FT_Load_Glyph all the time, which can be slow. Add a cache for metrics and use it with custom font functions.
* HarfBuzz shaping supportGrigori Goronzy2011-07-111-1/+2
| | | | | | | | Split up text into runs with the same direction, font face and font size, shape these runs with HarfBuzz and reorder accordingly. This noticeably improves Arabic shaping and should make shaping for many other scripts work. HarfBuzz also does kerning for Latin text.
* Remove unused hash key itemGrigori Goronzy2011-06-281-1/+0
|
* cache: unified bitmap cacheGrigori Goronzy2011-06-271-3/+8
| | | | | | Similarly to the glyph cache, subclass the bitmap cache to allow both outline bitmaps and clipping mask bitmaps to coexist in the same cache in a much cleaner way.
* cache: use outline-bitmap hierarchy to slim down bitmap hash keyGrigori Goronzy2011-06-271-12/+1
| | | | | | | | The bitmap hash key duplicated a lot of information the glyph hash key already saves. The subclassing introduced recently complicates this even more. Modify the hash key to utilize a pointer to the glyph hash value instead, which is faster and more flexible. Make sure to always empty the bitmap cache when the glyph cache is emptied.
* cache: unified outline cache for glyphs/drawingsGrigori Goronzy2011-06-271-0/+19
| | | | | | | | | Glyphs and drawings have wildly different hash keys. Subclass the hash keys of glyphs and drawings in a new, unified outline cache. This also fixes some issues with drawings in the glyph cache. Now, the textual description of the drawing is included in the key (the hash value isn't really good enough, especially not fnv32) and the baseline offset is saved as well.
* Much improved cache/hashmap implementationGrigori Goronzy2011-06-071-1/+1
| | | | | | | | - less code, cleaner - decoupled from ASS_Library - better data encapsulation - simpler interface - avoids a nasty hack
* Fix glyph overlap blendingGrigori Goronzy2009-08-231-2/+4
| | | | | | | | | | Use the bitmap pointer for the cache hash key. This preserves the blending history, which fixes occasional corruptions due to previous replacements not being dealt with correctly. It also simplifies the hash key a lot and thus speeds up cache lookups. Additionally, change the blending equation from max(a, b) to min(a + b, 0xff), i.e. a saturating addition. Usually this looks a lot better.
* Fix caching of underlined/striked out glyphsGrigori Goronzy2009-08-151-1/+2
|
* BorderStyle cache integrationGrigori Goronzy2009-08-121-0/+2
| | | | | Add new fields to the cache hash key for BorderStyle 3 (glyph cache and bitmap cache).
* Rename typedefs (breaks API)Grigori Goronzy2009-08-061-6/+6
| | | | | | Rename all typedefs from the convention foo_bar_t, which can possibly conflict with POSIX types, to FooBar (and ASS_FooBar for public API typedefs). Fix formatting and stray comments while at it.
* Clean up typedefs/structsGrigori Goronzy2009-07-281-3/+3
| | | | | Remove useless _s suffix from struct names and remove struct name where not needed (only the typedef'd struct is used). Clean up API headers.
* Remove shift vector in ass_render_eventGrigori Goronzy2009-07-251-1/+0
| | | | | | | The shift is not calculated when fetching a glyph anymore. Instead, it is calculated right before rasterizing a glyph. Remove the shift vector and make get_outline_glyph, the glyph cache and ass_font_set_transform work without supplying a shift vector.
* Updates for autotools' make distGrigori Goronzy2009-07-121-0/+118
Rename ass_cache_template.c to ass_cache_template.h; add libass.sym to EXTRA_DIST.