1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 09:32:40 +00:00

sd_ass: scale blur by original video size if requested

This commit is contained in:
wm4 2013-06-30 18:46:29 +02:00
parent af55db654b
commit 169b3abd78
4 changed files with 22 additions and 1 deletions

View File

@ -157,7 +157,7 @@
Enables placing toptitles and subtitles in black borders when they are
available.
``--ass-vsfilter-aspect-compat``
``--ass-vsfilter-aspect-compat=<yes|no>``
Stretch SSA/ASS subtitles when playing anamorphic videos for compatibility
with traditional VSFilter behavior. This switch has no effect when the
video is stored with square pixels.
@ -174,6 +174,15 @@
Enabled by default.
``--ass-vsfilter-blur-compat=<yes|no>``
Scale ``\blur`` tags by video resolution instead of script resolution
(enabled by default). This is bug in VSFilter, which according to some,
can't be fixed anymore in the name of compatibility.
Note that this uses the actual video resolution for calculating the
offset scale factor, not what the video filter chain or the video output
use.
``--ass-vsfilter-color-compat=<basic|full|force-601|no``
Mangle colors like (xy-)vsfilter do (default: basic). Historically, VSFilter
was not colorspace aware. This was no problem as long as the colorspace

View File

@ -502,6 +502,7 @@ const m_option_t mp_opts[] = {
OPT_FLAG("ass-vsfilter-aspect-compat", ass_vsfilter_aspect_compat, 0),
OPT_CHOICE("ass-vsfilter-color-compat", ass_vsfilter_color_compat, 0,
({"no", 0}, {"basic", 1}, {"full", 2}, {"force-601", 3})),
OPT_FLAG("ass-vsfilter-blur-compat", ass_vsfilter_blur_compat, 0),
OPT_FLAG("embeddedfonts", use_embedded_fonts, 0),
OPT_STRINGLIST("ass-force-style", ass_force_style_list, 0),
OPT_STRING("ass-styles", ass_styles_file, 0),
@ -794,6 +795,7 @@ const struct MPOpts mp_default_opts = {
.sub_scale = 1,
.ass_vsfilter_aspect_compat = 1,
.ass_vsfilter_color_compat = 1,
.ass_vsfilter_blur_compat = 1,
.ass_style_override = 1,
.use_embedded_fonts = 1,
.suboverlap_enabled = 0,

View File

@ -191,6 +191,7 @@ typedef struct MPOpts {
int ass_use_margins;
int ass_vsfilter_aspect_compat;
int ass_vsfilter_color_compat;
int ass_vsfilter_blur_compat;
int use_embedded_fonts;
char **ass_force_style_list;
char *ass_styles_file;

View File

@ -196,6 +196,15 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res dim, double pts,
scale = scale * dim.video_par;
mp_ass_configure(renderer, opts, &dim);
ass_set_aspect_ratio(renderer, scale, 1);
#if LIBASS_VERSION >= 0x01020000
if (!ctx->is_converted && (!opts->ass_style_override ||
opts->ass_vsfilter_blur_compat))
{
ass_set_storage_size(renderer, ctx->video_params.w, ctx->video_params.h);
} else {
ass_set_storage_size(renderer, 0, 0);
}
#endif
mp_ass_render_frame(renderer, ctx->ass_track, pts * 1000 + .5,
&ctx->parts, res);
talloc_steal(ctx, ctx->parts);