[FFmpeg-devel] [PATCH v4 2/3] lavc/libaribcaption.c: add MSZ characters related options

Jan Ekström jeebjp at gmail.com
Sun Oct 29 10:51:43 EET 2023


On Tue, Oct 17, 2023 at 4:14 PM TADANO Tokumei <aimingoff at pc.nifty.jp> wrote:
>
> This patch add MSZ (Middle Size; half width) characters related
> options.
>
> * add `-replace_msz_japanese` option introduced in version 1.0.1
>   of libaribcaption.
> * add `-replace_msz_glyph` option introduced in version 1.1.0
>   of libaribcaption.
>
> If specified fonts contain half-width glyphs (e.g., BIZ UDGothic),
> it make better rendering with `-replace_msz_ascii false` and
> `-replace_msz_japanese false` option for bitmap sub_type.
>
> Signed-off-by: TADANO Tokumei <aimingoff at pc.nifty.jp>

Change-wise LGTM. I reworked the commit message (starting with the
removal of ".c" at the end), and hopefully I understood correctly what
you were trying to mean with what I expect you were meaning with
regards to the latter option. The adjusted commits are visible in
https://github.com/jeeb/ffmpeg/commits/aribcaption_msz_patches_v3 .

Otherwise the only thing I adjusted was

diff --git a/libavcodec/libaribcaption.c b/libavcodec/libaribcaption.c
index 2a058a4992..e87f303aa8 100644
--- a/libavcodec/libaribcaption.c
+++ b/libavcodec/libaribcaption.c
@@ -1008,7 +1008,7 @@ static int aribcaption_init(AVCodecContext *avctx)
     aribcc_decoder_set_replace_msz_fullwidth_ascii(ctx->decoder,
                                                    ctx->replace_msz_ascii);
     aribcc_decoder_set_replace_msz_fullwidth_japanese(ctx->decoder,
-                                                   ctx->replace_msz_japanese);
+
ctx->replace_msz_japanese);

     /* Similar behavior as ffmpeg tool to set canvas size */
     if (ctx->canvas_width > 0 && ctx->canvas_height > 0 &&

as there was a mismatching offset. If this is fine by you, I'll pull this in.

Jan


More information about the ffmpeg-devel mailing list