From: TADANO Tokumei <aimingoff@pc.nifty.jp> To: ffmpeg-devel@ffmpeg.org Cc: TADANO Tokumei <aimingoff@pc.nifty.jp> Subject: [FFmpeg-devel] [PATCH] lavc/libaribcaption.c: add -replace_fullwidth_japanese option Date: Fri, 8 Sep 2023 22:00:50 +0900 Message-ID: <20230908130050.85688-1-aimingoff@pc.nifty.jp> (raw) This patch add `-replace_fullwidth_japanese` option introduced in latest (1.0.1) libaribcaption. --- doc/decoders.texi | 6 ++++++ libavcodec/libaribcaption.c | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/doc/decoders.texi b/doc/decoders.texi index 09b8314dd2..ee4cc6121e 100644 --- a/doc/decoders.texi +++ b/doc/decoders.texi @@ -433,6 +433,12 @@ alphanumerics with halfwidth alphanumerics. The default is @var{true}. +@item -replace_fullwidth_japanese @var{boolean} +Specify whether to replace some MSZ (Middle Size, half width) fullwidth +japanese special characters with halfwidth ones. + +The default is @var{true}. + @item -force_outline_text @var{boolean} Specify whether always render outline text for all characters regardless of the indication by charactor style. diff --git a/libavcodec/libaribcaption.c b/libavcodec/libaribcaption.c index 8a8c8f8cfd..3ec35b9ba1 100644 --- a/libavcodec/libaribcaption.c +++ b/libavcodec/libaribcaption.c @@ -71,6 +71,9 @@ typedef struct ARIBCaptionContext { bool ass_single_rect; char *font; bool replace_fullwidth_ascii; +#if defined(ARIBCC_VERSION) + bool replace_fullwidth_japanese; +#endif bool force_stroke_text; bool ignore_background; bool ignore_ruby; @@ -1005,6 +1008,10 @@ static int aribcaption_init(AVCodecContext *avctx) } aribcc_decoder_set_replace_msz_fullwidth_ascii(ctx->decoder, ctx->replace_fullwidth_ascii); +#if defined(ARIBCC_VERSION) + aribcc_decoder_set_replace_msz_fullwidth_japanese(ctx->decoder, + ctx->replace_fullwidth_japanese); +#endif /* Similar behavior as ffmpeg tool to set canvas size */ if (ctx->canvas_width > 0 && ctx->canvas_height > 0 && @@ -1134,6 +1141,10 @@ static const AVOption options[] = { OFFSET(font), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, SD }, { "replace_fullwidth_ascii", "replace MSZ fullwidth alphanumerics with halfwidth alphanumerics [ass, bitmap]", OFFSET(replace_fullwidth_ascii), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD }, +#if defined(ARIBCC_VERSION) + { "replace_fullwidth_japanese", "replace MSZ fullwidth Japanese with halfwidth [ass, bitmap]", + OFFSET(replace_fullwidth_japanese), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD }, +#endif { "force_outline_text", "always render characters with outline [(ass), bitmap]", OFFSET(force_stroke_text), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, SD }, { "ignore_background", "ignore rendering caption background [(ass), bitmap]", -- 2.39.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
reply other threads:[~2023-09-08 13:02 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230908130050.85688-1-aimingoff@pc.nifty.jp \ --to=aimingoff@pc.nifty.jp \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git