| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
That's complete version with SSE2/AVX2 assembly.
Should be much faster than old algorithm even in pure C.
Algorithm description can be found in this article (PDF):
https://github.com/MrSmile/CascadeBlur/releases
Close #9
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Use one pointer to table of functions instead of scattered
bunch of function pointers. Different versions of these tables
can be constructed in compile time.
Also, bitmap memory alignment now depends only on SSE2/AVX2 support
and is constant for every width. That simplifies code without
noticeable performance penalty.
|
|\
| |
| | |
\be fixes including clipping and value range
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Also fix a related sort-of-bug: a multiple of sizeof(uint16_t)
was being added to a pointer that already pointed to uint16_t.
This was not causing any harm given enough space in the buffer.
Fixing the above also lets us combine the two memsets.
|
| |
| |
| |
| |
| | |
To avoid making bitmaps unnecessarily large, use just
the necessary amount of padding for the given \be value.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
To avoid banding in the output, the full [0..255] value range
is restored before the last \be pass, which then uses the full
range and hides the bands by virtue of being a blur.
With this, our \be finally closely matches VSFilter's.
The only visible difference (other than the lack of banding) is
in clipping: we add proper padding and output the whole blurred
image, while VSFilter does not add any padding and hence clips
the blurred image too early.
|
| | |
|
| |
| |
| |
| |
| | |
The implementation of \be was changed to xy-VSFilter's, which (like
VSFilter's) reads but does not write out the first/last row/column.
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Much of outline_to_bitmap() is duplicated. What?
Add the overflow check to duplicated code too.
|
|
|
|
|
|
| |
Seriously...
Checking for negative values might not be needed, but do it anyway.
|
|
|
|
|
|
|
|
| |
This actually fixes #146.
The overflow check itself is obvious. Also, make ass_align() return an
unaligned value if aligning it would overflow. This is probably better,
as it for example makes the overflow check in the caller simpler.
|
| |
|
|
|
|
|
|
| |
Commit 8536eaa was slightly broken: for some incomprehensible reason,
(w + 1) memory instead of w is needed. The missing space could lead to
memory corruption and crashes.
|
|
|
|
| |
Also fix that ass_synth_init() could deref NULL.
|
| |
|
|
|
|
| |
Put all code into one place, which makes it easier to follow.
|
|
|
|
| |
This still doesn't catch all cases.
|
|
|
|
| |
This is just a start and gets most easy ones.
|
|
|
|
| |
Part of #146
|
| |
|
| |
|
|
|
|
| |
It turns out we don't need this.
|
| |
|
|
|
|
| |
Signed-off-by: Rodger Combs <rodger.combs@gmail.com>
|
|
|
|
| |
Regression in commit 98707694.
|
|
|
|
|
|
|
|
|
| |
5dd56af2 replaced our implementation of \be with xy-VSFilter's.
This error is not present in the xy-VSFilter code; it was introduced
by accident in a merge that was later squashed as part of 5dd56af2.
Note: the new \be reads in but does not write out
the first and last row and column of pixels.
|
|
|
|
|
|
| |
Signed-off-by: wm4 <wm4@nowhere>
Commit 04b51c2d broke BorderStyle=3 with text that had spaces.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Freetype can return a bounding box with all fields set to INT_MIN if an
outline with all points set to 0 is used. This can happen e.g. with
\fscx0, but also in more complicated cases. (In the original crashing
sample, this was probably caused in combination with an embedded font.)
Such a bounding box causes libass to crash, because it will enlarge the
combined bitmap bounding box to a ridiculous size.
Just skip outlines that have en empty bounding box. This is probably
the correct thing to do, and won't pass INT_MAX down to other parts
of libass.
|
| |
|
|
|
|
| |
...instead of doing this manually.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Based on xy-VSFilter commit 54391d3a.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Even if the border size is zero, the shadow is supposed to be
a copy of a hypothetical border: when border_style is 1, this
coincides with the borderless glyph, but when border_style is 3,
the shadow must be an opaque box.
Opaque box borders are now generated regardless of border size
being non-zero, and outline_to_bitmap3 gets a new flag indicating
whether it should discard the border (after generating a shadow
from it).
|
| |
|
|
|
|
|
|
| |
This horrible bug was introduced by commit c13cb2.
Pointed out by uau.
|
| |
|
|
|
|
|
| |
Add stride support to the basic bitmap type used for low-level
rasterization.
|
| |
|
|
|
|
|
| |
This covers rasterization, filtering and blending for one
render item.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libass can render both regular glyphs (extracted from a font) and
drawings, which are inserted into an existing glyph so far. This is a
rather crude hack. However, it is necessary, as the renderer only works
with FT_Glyphs. The obvious solution is to work on the underlying
outlines directly instead.
This is the first step to make this possible: change the basic
rasterizer to use the outline-specific rasterization functions. There
are more advantages:
- It's more efficient. The bitmap can be directly rendered into the
bordered target bitmap.
- This should make it easier to adapt the renderer to run-based
rendering later on (the pixels are ORed into the target)
The higher-level rendering code still needs to be adjusted.
|
|
|
|
|
|
| |
In hope to make libass as useful as possible, relicense libass to ISC, a
simplified 2-clause BSD license. All contributors who provided
non-trivial changes have granted their permission for this.
|
|
|
|
|
| |
The useless "if (foo) free(foo)" idiom is all over the place, just
get rid of it finally...
|
|
|
|
|
|
| |
Similar to regular glyphs, check the bounding box of the clip mask and
refrain from rendering humongous masks, which can take up considerably
memory.
|
| |
|
|
|
|
|
| |
It's not necessary to create the shadow bitmap by adding the glyph
bitmap to the outline bitmap; the outline is a superset of the glyph.
|
|
|
|
|
| |
Similar to VSFilter, do not subtract the glyph bitmap from the border
bitmap when BorderStyle 3 is used.
|
|
|
|
|
|
| |
This reverts commit d3cd5b0148d64ae0f6e288e69b09acfe639fdcce.
This hack improved blending in few situations, but at the same time
broke it in lots o others; get rid of it.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
In case rasterizing a glyph is successful, but rasterizing its outline
is not, do not free the glyph bitmap. It will be freed in cache cleanup
later. Freeing it earlier leads to a double free.
|
|
|
|
|
|
|
|
| |
Use a different threshold for merging the outline and glyph and also
adjust the merge amount. This fails to give complete transparency (and
thus will yield slightly darker looking glyphs, usually), but avoids
very ugly looking artefacts at the edge between border and glyph that
were still prevalent.
|
|
|
|
|
|
|
|
|
|
| |
The last commit related to this overdid it a bit -- in some cases,
with \be5, for example, edges were visible on the outlines. Instead of
using a linear function to map \be applications to border enlargement
value, use a nonlinear function, a simple square root. This seems to
work a lot better, while keeping the enlargement small.
In addition, make it possible to use \be and \blur at the same time. \be
is applied first.
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce functionality for providing a message callback that is used
for passing messages to the controlling application instead of simply
printing them to standard output. The function pointer to the callback
is stored in the ass_library_t instance. ass_msg needs access to it, so
in many places the library instance needs to be passed around now.
The default behavior is the old one: messages of MSGL_INFO or lower
are printed to the standard output, prefixed with "[ass]".
|
|
|
|
|
|
| |
Instead of referencing string defines from help_mp.h, use the strings
directly in ass_msg. Consequently, help_mp.h is useless and can
be deleted.
|
| |
|
|
|
|
|
|
|
| |
Enlarge bitmap glyphs less for \be, this is especially effective for
lots of \be applications.
Also make sure that the gaussian blur buffers are only updated if
gaussian blur is actually used for a particular glyph.
|
|
|
|
| |
Do not rely on the compiler for optimizing a division into a shift.
|
|
|
|
|
|
|
|
|
| |
Shadows are handled different from glyph and outline. A shadow
is the sum of glyph and outline bitmap; therefore shifting to the
correct subpixel amount before rasterization is out of the question.
Instead, the bitmap is shifted by its subpixel amount after being
built from shadow and glyph.
The bitmap cache was extended for this.
|
| |
|
|
|
|
|
| |
Rename a few functions to avoid symbol clashes.
Clean up mputils.h.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reindent complete source code (*.c, *.h) with indent, the exact command
line being:
indent -kr -i4 -bap -nut -l76 *.c *.h
From now on, new code should use (more or less) K&R style,
only spaces and no tabs, 4 spaces indent width. Avoid long lines.
Fix function declaration pointer spacing.
Remove spaces that were added to many function declarations by indent,
like some_func(foo_t * bar).
Fix indenting of macros in ass.c
|
| |
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28837 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|