From patchwork Tue Oct 17 13:13:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: TADANO Tokumei X-Patchwork-Id: 44281 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3e0b:b0:15d:8365:d4b8 with SMTP id bk11csp354882pzc; Tue, 17 Oct 2023 06:14:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/SkxfM3hJDgLMAaQ3R5zgQ3eOc0ndw5qXsh/Q22brF3Tq0EHP+5tgT6LnnHTT8bpEscxq X-Received: by 2002:a17:907:36c1:b0:9c3:730e:6947 with SMTP id bj1-20020a17090736c100b009c3730e6947mr1644342ejc.41.1697548458191; Tue, 17 Oct 2023 06:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697548458; cv=none; d=google.com; s=arc-20160816; b=N5GYVme5pVXUMfh9ti/DkPwbyyAbidXiMu2NmL4TXCZ83HLimTvQ2moLHV+rhfjLfr qcFafB2JyH09EDjzjifvHQGo03aJgMOSt02+SNvvESwNxruiH1Dd1ZmdXjI+ZIFoAtfx 1NHBXHSrZtTC1cwG3n/Oj0j4t6npcn5dF0asC08T+2yMH83WAfnLbisj0grJy7sWco3h 0mWtDnWyWFsm3/yUUTfVLLGB7tymX3zVXMKUWhK2kHD0zzD6C9Gyfh4Xkn3ZRL8ZCAHK u5tVfferiLeckjpNV2yugl3tLDJePCmAWnXwDBpyQ/GQQSqPclS57ULy094RsxqCZr91 TNJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:delivered-to; bh=oxWQnDVpGbEdaPb+WMwIT4JFPR2XKP+32iqehOWtxPU=; fh=ssXC39eKeah6YcPRlt8jBK+nQIpHohGaLsoJm2kZFpQ=; b=eUCAGR5Mu5Maxc7WoYCHRD3pmAxjQHgQL3Jwh1t0LNiNBjhVM6du/Rgait7/h5PSiK enEHoAdyXLmzeh3h6Vn/g0RvXsBxyFcdYFCXUX+d3xQoXiyKoKYBN76lrIMdXRRi0jwd ZdjBSeFVetIz0HvJi/ul5Gh/4hCdOMOzSr+D2hjbXeYlOQXoVPweL7xFyIcJABo9ruNT 7AS6P55PpI/HhiBYw2Oh4Ck1lFfOjTl0sDBurdqR2mIRTAGzF41FoxtO423p+9zpV4iz zRO5boK7HV7L2D5CXDMIhuiFqC55JBQyGCw3OKgzUuJ7cuKKZJ3vEg/2toXw4Q0GPlr5 ccGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id sa40-20020a1709076d2800b009a5f7fb51cdsi747470ejc.873.2023.10.17.06.14.07; Tue, 17 Oct 2023 06:14:18 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E704A68C9F9; Tue, 17 Oct 2023 16:14:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from dmta1020.nifty.com (mta-snd01004.nifty.com [106.153.227.36]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9F38068C9D3 for ; Tue, 17 Oct 2023 16:13:54 +0300 (EEST) Received: from osamu-pc.kimura.local by dmta1020.nifty.com with ESMTP id <20231017131350568.UOUO.131070.osamu-pc.kimura.local@nifty.com>; Tue, 17 Oct 2023 22:13:50 +0900 From: TADANO Tokumei To: ffmpeg-devel@ffmpeg.org Date: Tue, 17 Oct 2023 22:13:33 +0900 Message-Id: <20231017131335.201277-2-aimingoff@pc.nifty.jp> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231017131335.201277-1-aimingoff@pc.nifty.jp> References: <20231017131335.201277-1-aimingoff@pc.nifty.jp> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 1/3] lavc/libaribcaption.c: FIX: change all `boot` option var to `int` X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: TADANO Tokumei Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: tKDOQ1mTPzcq This patch fixes a bug in curret version. On some environments, a `bool` variable is small space than `int`. If a `bool` option was specified by command line, following variables would be filled and may be destroyed by av_opt_copy(). This patch change all the `bool` option variables in `ARIBCaptionContext` to `int`. Signed-off-by: TADANO Tokumei --- libavcodec/libaribcaption.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/libaribcaption.c b/libavcodec/libaribcaption.c index 8a8c8f8cfd..be3328c5c9 100644 --- a/libavcodec/libaribcaption.c +++ b/libavcodec/libaribcaption.c @@ -68,14 +68,14 @@ typedef struct ARIBCaptionContext { int subtitle_type; int encoding_scheme; - bool ass_single_rect; + int ass_single_rect; char *font; - bool replace_fullwidth_ascii; - bool force_stroke_text; - bool ignore_background; - bool ignore_ruby; + int replace_fullwidth_ascii; + int force_stroke_text; + int ignore_background; + int ignore_ruby; float stroke_width; - bool replace_drcs; + int replace_drcs; int64_t pts; AVRational time_base; From patchwork Tue Oct 17 13:13:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: TADANO Tokumei X-Patchwork-Id: 44282 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3e0b:b0:15d:8365:d4b8 with SMTP id bk11csp355043pzc; Tue, 17 Oct 2023 06:14:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+yKBuRDWq6GSppkuGYrEJiCDHFUWrLJ5NIW3yHAQdBml79dTPSq0owlt69nHtIJqayu2V X-Received: by 2002:a50:d797:0:b0:53e:ecd6:7ee1 with SMTP id w23-20020a50d797000000b0053eecd67ee1mr1847255edi.18.1697548472174; Tue, 17 Oct 2023 06:14:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697548472; cv=none; d=google.com; s=arc-20160816; b=f0B99qFYBXHxqFENrtKhBHx6GsWCRbLCkSeFp6H/j0Hat+qsgGZlFohyZNIvbrf2zu AWQVe/IeT72ipCEHDyYUNl4HQAVNrMFdthvBAvMn1TOLw+/t8zVwWuACKYbYRxKFuDyR 7eo7gtEpPMI+cjxB2NrqLn3lS88oqc38z09+Z5RRE161n74kQno4uPD2nX9uiWaI4rTe YEc+6vEceV6iAgdu/nYiqEBwYlDdqGX+kUft3m3c2zHa+HRFQa5TqnD4HkBbGBZddoCk /LfIT1t00ODHC2JLgtPuamxMffU9aqhhvltimEl81Nx4Y7jPWcTWf4HKzE0T5zmYi2dU 75rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:delivered-to; bh=b9ZvH74fB4i8uTckNK9VXMPqYBeOzgF5Vd9tZmE21VA=; fh=ssXC39eKeah6YcPRlt8jBK+nQIpHohGaLsoJm2kZFpQ=; b=iSz6BAdvlR1X9fTWOIBn+hO31+gJS/ukJcoI2pqNtWsrGFdDZpBTrK1mPa9OyvwrQ4 yfJxkTuNF5C8sda5B2SUkvfs0N1jXbOYZ4OBFsV9dniHoHdVoBNIzBNmYhP7mV6GOqhD oRUayJcKR5qVwPRkVKOfkjEr2oftfbLqkewbTn1ZozL4SCWY4179Q2BEFMF2hiiwcZZx v0nli7RXWtMlHwAntGOWM67JOBt+P2kRoIHTidCQFSwD/kiCom+TNsvD6SaCFroAKLi7 wVyGVwgShMBeU9epXckVoCZtFft0Ak6Wcp3zeQModib5VTQk9Ye6fPFhkWUmco6DcYqN xg/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i17-20020a508711000000b00537705d2093si702846edb.63.2023.10.17.06.14.17; Tue, 17 Oct 2023 06:14:32 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0BE2F68C9F8; Tue, 17 Oct 2023 16:14:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from dmta1020.nifty.com (mta-snd01003.nifty.com [106.153.227.35]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 96C4868C9F7 for ; Tue, 17 Oct 2023 16:14:04 +0300 (EEST) Received: from osamu-pc.kimura.local by dmta1020.nifty.com with ESMTP id <20231017131401110.UOUV.131070.osamu-pc.kimura.local@nifty.com>; Tue, 17 Oct 2023 22:14:01 +0900 From: TADANO Tokumei To: ffmpeg-devel@ffmpeg.org Date: Tue, 17 Oct 2023 22:13:34 +0900 Message-Id: <20231017131335.201277-3-aimingoff@pc.nifty.jp> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231017131335.201277-1-aimingoff@pc.nifty.jp> References: <20231017131335.201277-1-aimingoff@pc.nifty.jp> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 2/3] lavc/libaribcaption.c: add MSZ characters related options X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: TADANO Tokumei Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 0YDXS0r7vxAU 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 --- configure | 2 +- doc/decoders.texi | 16 ++++++++++++++++ libavcodec/libaribcaption.c | 10 ++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/configure b/configure index d203177a74..2fb827e1fb 100755 --- a/configure +++ b/configure @@ -6679,7 +6679,7 @@ enabled libaom && require_pkg_config libaom "aom >= 1.0.0" aom/aom_co enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new || { enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } || die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; } -enabled libaribcaption && require_pkg_config libaribcaption "libaribcaption >= 0.1.0" "aribcaption/aribcaption.h" aribcc_context_alloc +enabled libaribcaption && require_pkg_config libaribcaption "libaribcaption >= 1.1.1" "aribcaption/aribcaption.h" aribcc_context_alloc enabled lv2 && require_pkg_config lv2 lilv-0 "lilv/lilv.h" lilv_world_new enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883 enabled libass && require_pkg_config libass "libass >= 0.11.0" ass/ass.h ass_library_init diff --git a/doc/decoders.texi b/doc/decoders.texi index 09b8314dd2..36c3404475 100644 --- a/doc/decoders.texi +++ b/doc/decoders.texi @@ -459,6 +459,22 @@ Specify whether to render replaced DRCS characters as Unicode characters. The default is @var{true}. +@item -replace_msz_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 -replace_msz_glyph @var{boolean} +Specify whether to replace MSZ (Middle Size; half width) characters +with halfwidth glyphs if the fonts supports it. +This option works under FreeType or DirectWrite renderer +with Adobe-Japan1 compliant fonts. +e.g., IBM Plex Sans JP, Morisawa BIZ UDGothic, Morisawa BIZ UDMincho, +Yu Gothic, Yu Mincho, and Meiryo. + +The default is @var{true}. + @item -canvas_size @var{image_size} Specify the resolution of the canvas to render subtitles to; usually, this should be frame size of input video. diff --git a/libavcodec/libaribcaption.c b/libavcodec/libaribcaption.c index be3328c5c9..74822586dc 100644 --- a/libavcodec/libaribcaption.c +++ b/libavcodec/libaribcaption.c @@ -76,6 +76,8 @@ typedef struct ARIBCaptionContext { int ignore_ruby; float stroke_width; int replace_drcs; + int replace_msz_japanese; + int replace_msz_glyph; int64_t pts; AVRational time_base; @@ -1005,6 +1007,8 @@ static int aribcaption_init(AVCodecContext *avctx) } aribcc_decoder_set_replace_msz_fullwidth_ascii(ctx->decoder, ctx->replace_fullwidth_ascii); + aribcc_decoder_set_replace_msz_fullwidth_japanese(ctx->decoder, + ctx->replace_msz_japanese); /* Similar behavior as ffmpeg tool to set canvas size */ if (ctx->canvas_width > 0 && ctx->canvas_height > 0 && @@ -1057,6 +1061,8 @@ static int aribcaption_init(AVCodecContext *avctx) aribcc_renderer_set_force_no_background(ctx->renderer, ctx->ignore_background); aribcc_renderer_set_force_no_ruby(ctx->renderer, ctx->ignore_ruby); aribcc_renderer_set_stroke_width(ctx->renderer, ctx->stroke_width); + aribcc_renderer_set_replace_msz_halfwidth_glyph(ctx->renderer, + ctx->replace_msz_glyph); if (ctx->font) { int is_nomem = 0; size_t count = 0; @@ -1144,6 +1150,10 @@ static const AVOption options[] = { OFFSET(stroke_width), AV_OPT_TYPE_FLOAT, { .dbl = 1.5 }, 0.0, 3.0, SD }, { "replace_drcs", "replace known DRCS [bitmap]", OFFSET(replace_drcs), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD }, + { "replace_msz_japanese", "replace MSZ fullwidth Japanese with halfwidth [ass, bitmap]", + OFFSET(replace_msz_japanese), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD }, + { "replace_msz_glyph", "replace MSZ characters with halfwidth glyphs [bitmap]", + OFFSET(replace_msz_glyph), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD }, {"canvas_size", "set input video size (WxH or abbreviation) [bitmap]", OFFSET(canvas_width), AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, INT_MAX, SD }, { NULL } From patchwork Tue Oct 17 13:13:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: TADANO Tokumei X-Patchwork-Id: 44283 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3e0b:b0:15d:8365:d4b8 with SMTP id bk11csp355154pzc; Tue, 17 Oct 2023 06:14:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFtYFDl+vXyFiayyDcppYL7unP/eZNb0hyFRrrs1o+9wJXC7JZq7C9lNBGc1eS/vYjE6y8D X-Received: by 2002:a05:6402:4405:b0:53e:343a:76c4 with SMTP id y5-20020a056402440500b0053e343a76c4mr2586539eda.30.1697548483509; Tue, 17 Oct 2023 06:14:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697548483; cv=none; d=google.com; s=arc-20160816; b=jKy2e6a1LXwNn1BgthWCFMbfXnKV2kiIjJuk/h9nO1p1wCZCkQrh71q/47/zJqNJkw nAZ3CjddBG/54cPMGRwzqTaBlMC01+FDp2TYiOs2dds1ttQGpU23nIJCAp86vSinBZdU gpGCupTcTN5E+CYbWoQ0omfQpvg/MU7n0aU68uRnYySX+Bh9Ki/45hI3edl2K+38B9HF 7a3GS6WrB6RVhlFoJDUWwzdVeMAkhClcsSD81Y5pnTAkukB3McHEYPvLClUtzycbTO2c rDF17sjkH8lR3HgFgZiqRik2UfrKX8/lyu4LxEbjAt9qv2bDPnkPdvz0FrWFP7viV+De 4ILQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:delivered-to; bh=YeCTOOEH4k65minozCgBbMRe5nyR1Hp1L+eFT1asdyU=; fh=ssXC39eKeah6YcPRlt8jBK+nQIpHohGaLsoJm2kZFpQ=; b=FTMJ+VV11G5X2kqOABzU+zlX1AAF468m6+cyA/WjNU0e018SLA5Bs1jqmHpxYFxIRl VoF9ft3nWoiidJJEgqPOSxCZmHLcMUcZvLiyD3XsEu920S/pDM9PAyPq+f3lPqcPpgv0 Mok4y2cHo/eswMBlOY/TuVyAUp4zyhV5j8+5TrKN/ZOd7zZoi26T84ix8dMAdyZG4WoC b+2fLmT1MxN38Meav51pe6XDBT90Ytnu92THbE/a+VnyB5/oQFuEYIscNbhNCYKNrAxP ZYSUu5rjDeAPh9mXRAU3wn0HJryJToe3k4RYZgTQPPRQT8p9Pvzeq8z3qmVYpHUjJ2vr oyhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z66-20020a509e48000000b0053ebbd59684si700167ede.461.2023.10.17.06.14.28; Tue, 17 Oct 2023 06:14:43 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2F12868CA16; Tue, 17 Oct 2023 16:14:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from dmta1020.nifty.com (mta-snd01012.nifty.com [106.153.227.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 135E368CA0A for ; Tue, 17 Oct 2023 16:14:09 +0300 (EEST) Received: from osamu-pc.kimura.local by dmta1020.nifty.com with ESMTP id <20231017131406384.UOUW.131070.osamu-pc.kimura.local@nifty.com>; Tue, 17 Oct 2023 22:14:06 +0900 From: TADANO Tokumei To: ffmpeg-devel@ffmpeg.org Date: Tue, 17 Oct 2023 22:13:35 +0900 Message-Id: <20231017131335.201277-4-aimingoff@pc.nifty.jp> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231017131335.201277-1-aimingoff@pc.nifty.jp> References: <20231017131335.201277-1-aimingoff@pc.nifty.jp> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 3/3] lavc/libaribcaption.c: rename `-replace_fullwidth_ascii` option X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: TADANO Tokumei Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Uv1R+jcm2rhs This patch renames `-replace_fullwidth_ascii` option to `-replace_msz_ascii` to clarify option meaning. Signed-off-by: TADANO Tokumei --- doc/decoders.texi | 12 ++++++------ libavcodec/libaribcaption.c | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/decoders.texi b/doc/decoders.texi index 36c3404475..eb00e2a9e9 100644 --- a/doc/decoders.texi +++ b/doc/decoders.texi @@ -427,12 +427,6 @@ If your player cannot handle AVSubtitles with multiple ASS rectangles properly, set this option to @var{true} or define @env{ASS_SINGLE_RECT=1} to change default behavior at compilation. -@item -replace_fullwidth_ascii @var{boolean} -Specify whether to replace MSZ (Middle Size, half width) fullwidth -alphanumerics with halfwidth alphanumerics. - -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. @@ -459,6 +453,12 @@ Specify whether to render replaced DRCS characters as Unicode characters. The default is @var{true}. +@item -replace_msz_ascii @var{boolean} +Specify whether to replace MSZ (Middle Size; half width) fullwidth +alphanumerics with halfwidth alphanumerics. + +The default is @var{true}. + @item -replace_msz_japanese @var{boolean} Specify whether to replace some MSZ (Middle Size; half width) fullwidth japanese special characters with halfwidth ones. diff --git a/libavcodec/libaribcaption.c b/libavcodec/libaribcaption.c index 74822586dc..2a058a4992 100644 --- a/libavcodec/libaribcaption.c +++ b/libavcodec/libaribcaption.c @@ -70,12 +70,12 @@ typedef struct ARIBCaptionContext { int encoding_scheme; int ass_single_rect; char *font; - int replace_fullwidth_ascii; int force_stroke_text; int ignore_background; int ignore_ruby; float stroke_width; int replace_drcs; + int replace_msz_ascii; int replace_msz_japanese; int replace_msz_glyph; @@ -1006,7 +1006,7 @@ static int aribcaption_init(AVCodecContext *avctx) return AVERROR_EXTERNAL; } aribcc_decoder_set_replace_msz_fullwidth_ascii(ctx->decoder, - ctx->replace_fullwidth_ascii); + ctx->replace_msz_ascii); aribcc_decoder_set_replace_msz_fullwidth_japanese(ctx->decoder, ctx->replace_msz_japanese); @@ -1138,8 +1138,6 @@ static const AVOption options[] = { OFFSET(ass_single_rect), AV_OPT_TYPE_BOOL, { .i64 = ASS_SINGLE_RECT }, 0, 1, SD }, { "font", "comma-separated font family [ass, bitmap]", 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 }, { "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]", @@ -1150,6 +1148,8 @@ static const AVOption options[] = { OFFSET(stroke_width), AV_OPT_TYPE_FLOAT, { .dbl = 1.5 }, 0.0, 3.0, SD }, { "replace_drcs", "replace known DRCS [bitmap]", OFFSET(replace_drcs), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD }, + { "replace_msz_ascii", "replace MSZ fullwidth alphanumerics with halfwidth alphanumerics [ass, bitmap]", + OFFSET(replace_msz_ascii), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD }, { "replace_msz_japanese", "replace MSZ fullwidth Japanese with halfwidth [ass, bitmap]", OFFSET(replace_msz_japanese), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD }, { "replace_msz_glyph", "replace MSZ characters with halfwidth glyphs [bitmap]",