View Single Post
Old 2008-07-22, 17:54   Link #5
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 34
Posting this here because I don't expect everyone to read the Aegisub forums or IRC channel.


I made some more bugfixes to VSFilter and even added 4 new tags and extended an old one

http://www.animereactor.dk/aegisub/v...isub-r2279.rar

It's newer than any version shipped with Aegisub currently, but I expect that the next build of Aegisub we put out will have this version of VSFilter with it.

The two bugfixes added in this version are:
  • Non-zero fill alpha + \bord smaller than 1.5 + \be1 bug
  • Border colour showing through during \fad and \fade
This should account for all known rendering bugs!

The new tags are \xbord \ybord \xshad \yshad, and the \be tag was extended, see the readme file for details.



Code:
VSFilter with Aegisub patches
=============================

This is a distribution of VSFilter with patches by the Aegisub team.

Not all of the patches applied are developed by the Aegisub team, but are
instead collected from various sources on the internet. We don't have
credit, sorry.

The patches include both bugfixes as well as new features, they are all
described below.


Vector clip bug
---------------

When an SSE2 code path was added to the rasterisation code by Gabest, he
unfortunately also introduced a regression in the rendering of lines with
vector \clip() masks. The regression caused the alpha mask of the actual
line to be effectively "thresholded" such that there weren't semi-
transparent pixels, only either on or off.

This has been fixed by going back to an earlier method of rasterising,
which uses two different "pixmix" functions, one for lines with clipping
mask and one for lines without, and adding an SSE2 code path for the one
that didn't have it.


Font name crash
---------------

Some malformed font names could make VSFilter crash, due to a buffer
overflow. This has been fixed by using the "secure" versions of the C
string functions, introduced by Microsoft in Visual C++ 8, instead.

This patch is obtained from the Doom9 forum.


Text shearing tags, \fax \fay
-----------------------------

Two new tags have been introduced to allow "shearing" operations on text,
the \fax and \fay tags. The default value for both are 0.

The parameter to them is a factor used for building a transofmation matrix.

For example, \fax1 means X = X + Y * 1

Similar, \fay-2 means Y = Y + X * -2


Common Subtitle Renderer Interface (CSRI)
-----------------------------------------

In addition to the regular DirectShow, VirtualDub and Avisynth interfaces,
a CSRI interface has been added to VSFilter. This allows Aegisub and other
applications to easily render in-memory subtitles to an arbitrary bitmap
surface. Aegisub uses this for subtitle and style previews.

The presense of CSRI does not affect the function of any of the other
interfaces.


Floating-point positioning
--------------------------

This patch allows using floating-point numbers in the \pos and \move tags
to get sub-pixel positioning without increasing PlayResX and PlayResY to
values higher than the actual video resolution.

For example: \pos(20.4,9.73)


Require [Script Info] line
--------------------------

We have patched VSFilter to only accept SSA and ASS files that include
the [Script Info] section header. A file not including that is considered
too broken to even consider rendering from.

VSFilter is traditionally very forgiving in what it accepts, but scripts
as malformed as this caused problems in Aegisub so we considered it would
be better to reject them at every level.


Avoid "moving \pos"
-------------------

Because the \pos tag is internally treated the same as \move it caused
some problems in rare cases, where the interpolation between times actually
caused a small jitter in the position of text placed with \pos.

The \move handling code has been patched such that text that isn't supposed
to move won't be moved either.


Non-zero fill alpha + \bord smaller than 1.5 + \be1 bug
-------------------------------------------------------

This bug caused "stray dots" to display when the fill alpha (\1a and \2a)
of a line is non-zero, the border is thinner than 1.5 pixels and "blur
edges" is enabled.

The bug was caused by an integer underflow during subtraction.

The fix is checking the integers before subtracting, to make sure the
result would be at most zero. If it would underflow, zero is used instead.


Border colour showing through during \fad and \fade
---------------------------------------------------

When using the \fad or \fade tags on lines with a non-zero border and
where both \1a and \2a are zero, the border colour would show through
in the fill colour during the fade, causing the fade to effectively be
incorrect, and look ugly.

This was caused by a strange/incorrect assumption in the border rendering
code, causing it to render not only border but also fill when \1a and \2a
were zero.

This does not affect the shadow showing through during fades. That is a
very different problem which is not readily fixable.


Different X and Y border size with \xbord and \ybord
----------------------------------------------------

The new tags \xbord and \ybord have been introduced, they allow
controlling the border size in X and Y direction separately. This can
for example be used to do aspect ratio correction, or just for visual
effect.

The \bord tag is still valid, using it sets both X and Y border at the
same time, ie. it overrides both \xbord and \ybord.

Examples:
    {\xbord10\ybord0}Only border in X direction
    {\xbord0\ybord10}Only border in Y direction
    {\xbord3\ybord0\t(\ybord10)}The Y border grows here


Different shadow offset in X and Y direction with \xshad and \yshad
-------------------------------------------------------------------

The new tags \xshad and \yshad allows setting the shadow offset in X
and Y direction separately. They also allow setting negative shadow
offsets in the two directions.

Setting negative shadow offsets is still not supported with the \shad
tag or in Style lines, for compatibility reasons.

Examples:
    {\xshad3\yshad1.5}This line has the shadow more to the right than down
    {\xshad-5\yshad0}A shadow of this line is 5 pixels to the left
    {\xshad-3\yshad3\t(\xshad3)}The shadow moves from left to right here


Variable strength blur with \be
-------------------------------

The \be tag has been extended to allow variable strength blur, and to
allow the blur effect to be animated with \t.

The parameter to \be now specifies how many passes of blur to perform
on the subtitles, a bigger number means a bigger blur.

Examples:
    {\shad0\bord5\be10}This one has a blurry border
    {\shad0\bord5\t(\be15)}The border here grows more blurry over time
(This file is also included in the archive.)
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's

Last edited by jfs; 2008-07-22 at 18:49. Reason: Quick update that adds variable \be effect
jfs is offline   Reply With Quote