| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This is *VSFilter compatible and fixes #287.
|
|
|
|
|
|
|
| |
ffmpeg/libav did rely on *VSFilter incompatible libass defaults for years.
Avoid breaking them when changing libass' default to match *VSFilter.
To this end detection of the generated by ffmpeg signature is added.
|
|
|
|
|
|
|
|
| |
Keeps backwards compatibility as libass is currently the only renderer accepting
custom format lines and is currently defaulting SBAS to 'yes' (VSF incompatible)
This commit also changes the default/fallback ASS Event format to use 'Name'
instead of 'Actor'.
|
|
|
|
| |
And warn about duplicate headers
|
|
|
|
|
|
|
|
| |
closes #304
With this commit the padding of the BorderStyle=4 box, given by \shad, is no
longer measured from the text without borders, but from the border of the text.
(Alternative description: padding changed from \shad to \shad+\bord)
|
| |
|
|
|
|
|
|
| |
closes #143
As libass doesn't support the 'Collsions' header, we are only concerned with the
default stacking direction of *VSF here
|
| |
|
|
|
|
|
|
|
|
|
|
| |
[
Oneric <oneric@oneric.de>:
This commit was already present in the pr adding profile.c
(#11, 31 Dec 2013, by rcombs <rcombs@rcombs.me>)
but seems to have been forgotten.
Adjusted to apply on current version.
]
|
|
|
|
| |
closes #383
|
|
|
|
|
|
|
| |
- Convert tabs to spaces
- Ensure one space between keywords and parenthesis
- Ensure space between ')' and '{'
- Trim trailing whitespace
|
| |
|
| |
|
|
|
|
|
| |
We used to do a lot of work to get freetype to imitate VSFilter's font-metrics
handling. Instead, we now just duplicate its behavior directly early on.
|
|
|
|
| |
device_x is in anamorphic coordinates, the product of x2scr (not x2scr_scaled).
|
|
|
|
|
|
| |
The ratio was accidentally flipped.
Use the actual video size, not the screen size that includes margins.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Based on a commit by wm4.
Nowadays, margins are used by players such as mpv to implement
video zoom & pan, although this was not expected when margins
were first implemented in libass. This results in unpleasant
rendering when panning too far, and it is argued that subtitles
should not change size or move when panning and zooming at all.
libass also makes an attempt to keep subtitles on screen even when
the use of margins is disabled. This is unintuitive and prone to break.
Fix this by strictly separating events which render as if they were
part of the video, and events which should use margins. The latter
will now use the entire screen as canvas, rather than using the video
frame. This actually simplifies the various y2scr functions.
To preserve scaling (mainly for styled subtitles where line breaks are
carefully chosen based on font/video size ratio) and to avoid badly
stretching out things like ASS Margins due to aspect ratio differences
between video and screen, estimate the unpanned & unzoomed video size
from the video aspect ratio and the screen size, and base all scaling
on that. This means that if the user plays a video in letterboxed mode
without extra margins, they get the same scaling as if they were playing
the same video with the same video rectangle size without any margins
at all (with some elements merely spaced out to make use of the black
bars); and when they zoom & pan afterwards, the subtitles don't move
or change size.
This changes behavior even with ass_set_use_margins(_, 0). Before this,
normal dialogue was forced into the visible video area (if negative
margins were set); now it renders it as if it were part of the video.
This also changes the behavior of left and right margins even with
ass_set_use_margins(_, 1). Before this, normal dialogue was forced
into the visible video width (with both positive and negative margins);
now it renders across the entire width of the screen/window.
For 4:3 video letterboxed on 16:9 screen, this means text will cross
the edges of the video, which may look worse than before.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Normal subtitles in use_margins mode, which do not have \clip tags or
similar, were clipped in a nonsensical way. It was especially visible
when moving subtitles up with ass_set_line_position().
This happened because state.clip_* is initialized with a clipping
rectangle for the video area. Later it tries to translate the clipping
rect accordingly, but this does not make much sense if you account for
the margins.
Just reset the clipping rect to the screen in these cases. explicit=0 is
enough to know that the clipping rect was never explicitly set.
|
| |
|
|
|
|
|
|
| |
`brew install` fails with an error when an older version is already
installed. With the homebrew addon `brew install` or `brew upgrade`
will be called as required
|
|
|
|
|
| |
Padding should be 3 digits not 4, otherwise 2252ms are displayed as
'0:00:02.0252' instead of '0:00:02.252'.
|
| |
|
|
|
|
| |
Closes #397
|
|
|
|
|
|
|
|
| |
The while() checked the pointer for nullness, so the analyzer assumed it could
potentially be null, and thus warned on the reference to it later.
Using a do/while instead means we're only checking for subsequent linked-list
entries, which was the intent here anyway, and avoids the warning.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
`test` subdirectory contains complete test example.
|
| |
|
|
|
|
|
|
|
|
| |
Since C does not allow empty enums, there is an "example", which doesn't
do anything. I think we might be able to make this change the default
bidi direction or so. As if this commit, the flag set by it is also not
available outside of ass.c, which should be solved by moving parser_priv
to an internal header.
|
|
|
|
|
|
|
|
| |
This just gives a minor hint that all fields are frozen, but that the
size of the structs are not part of the ABI.
Most importantly, ASS_Style and ASS_Event are completely ABI-frozen,
because ASS_Track has the "styles" and "events" arrays.
|
|
|
|
|
|
|
|
|
| |
Check for overflows that could happen with alignment and the
multiplication. The INT_MAX / 4 is somewhat approximate and assumes that
degenerate alignment values won't happen.
This still assumes that a possibly overflowing end_w/end_h calculation
doesn't make the compiler's optimizer destroy the overflow checks.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This makes it a bit clearer that the struct's contents won't be reused
across multiple iterations
|
|
|
|
| |
This fixes a double-free in be0d1613f79a95073d18d96a60e1394abf9316a2
|
|
|
|
|
| |
This previously gave the pre-transition value; VSFilter's behavior is to give
the post-transition value.
|
|
|
|
|
|
|
|
| |
Fixes a crash in case a font does not has kCTFontURLAttribute,
which is the case for example on macOS 10.15.1 for the
".AppleSymbolsFB" font.
Fix #358
|
|
|
|
|
| |
This makes results much more consistent with other platforms,
particularly around cases where fonts have multiple conflicting names.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Use FcWeightToOpenType when available; otherwise, use an if/elseif ladder
implementing the inverse of fontconfig's behavior.
|
| |
|
|
|
|
|
|
| |
And conversely, do faux-bold fonts that are too thin
The offset of 150 matches VSFilter's behavior
|
| |
|
|
|
|
|
|
|
| |
Some fonts have weights that can be expressed more precisely as doubles than
as floats. In these cases, when writing to a float, CFNumberGetValue will set
the value to the closest approximation, but return false (so we'd just clobber
whatever it set with 0). Easy fix: just store to a double instead.
|
|
|
|
|
|
|
|
|
| |
shift_event() can change "bitmap" field of ASS_Image struct
so direct deallocation is no longer possible.
This commit introduces additional field "buffer"
into ASS_ImagePriv for that purpose.
Fixes https://github.com/libass/libass/issues/310.
|
|
|
|
| |
This allows making use of the updated UBA in Unicode 6.3 and up.
|
|
|
|
| |
Fix documentation misspellings/texts.
As reported by Clang.
|
|
|
|
| |
Found by Coverity Scan and -fsanitize=undefined
|
|
|
|
|
|
|
|
|
|
|
|
| |
Slow movement of one glyph looks like periodic jumps by quantization step.
In case of multiple glyphs at different subpixel shifts
jumps of individual glyphs occur at different frames.
That leads to performance penalty due to composite image
regeneration at every such jump.
This commit aligns glyphs in such a way that all jumps coincide
at the same frames, greatly improving performance of \move commands.
That optimization also helps in case of fast motion.
|
|
|
|
| |
Fixes https://github.com/libass/libass/pull/321.
|
| |
|
|
|
|
|
|
|
|
|
| |
This also potentially improves performance by copying
and transforming in a single operation rather than
copying first and then transforming the result.
Also transformation function is specialized for case
where expensive perspective division is not necessary.
|
| |
|
|
|
|
|
|
| |
Render logic should depend only on input subs
and not on some internal state such as bitmap pointers.
That can prevent incorrect behavior in case of allocation failure.
|
|
|
|
| |
Fixes https://github.com/libass/libass/pull/309.
|
|
|
|
| |
Compatibility flag FILTER_DRAW_SHADOW has removed completely.
|
|
|
|
|
|
| |
Now ass_synth_blur() blurs one bitmap only.
Higher level decisions (to blur or not to blur)
have moved outside of that function.
|
|
|
|
|
| |
This allows to use Bitmap struct directly as cache value
and to remove bunch of unnecessary allocations.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Accuracy of border outline calculation should depend on subsequent
transformation.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|