From patchwork Mon Feb 11 01:06:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 12036 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 9456E449037 for ; Mon, 11 Feb 2019 03:07:07 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7B34C68A806; Mon, 11 Feb 2019 03:07:07 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0F4A268A7B0 for ; Mon, 11 Feb 2019 03:07:00 +0200 (EET) Received: by mail-lf1-f48.google.com with SMTP id b20so6408811lfa.12 for ; Sun, 10 Feb 2019 17:07:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=RQEnMrnKP0kzzdQjgiAE9JXnwGbRTAaEDQ5/ESY6mNQ=; b=s0b0tTVrk8uRYBkokoFC45pr58ilRLR19sRO8YJ0oCIxogqlCuKj491WNHO7upvFm1 6mMeFQEYC33AQD0QztYJQ6kMcUwB0hitCfZq5nu2VXYF3nVZ8bb6OlqHVcRyN2CRsstr ZQkyvDbU/8VF3M4ai6OTFbKyR3u83ivVfa8gW/20TUOETMsRnqg7pIgSjmm8STur8XN/ ocAoBDXBqYOMbYDAiZfyo0bwIU1+/iwPd+e/l+wxAM5/j5994VntI74VemLIyVQyDoVs UBGm/pM/XBZmv4ycS9EZh97KAkArTcwf+tr34beJ1cM0EDAZ+AJU/Xe6z6AJK/5Wq5YZ oLDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RQEnMrnKP0kzzdQjgiAE9JXnwGbRTAaEDQ5/ESY6mNQ=; b=n8U/lMMICUrgeNqrOFJoxhFGhxO4dMw/UYnodd6r0T4JHByZ7zhZ5zzIvK/I/e0jx4 GOQFRIXk4Axv7pWajfMNOBYSvh2e9MEAIffqfAkMg+vL6Ja8G2rV7/Jo/rX25Io/IyQW UfjIpAulKJ94tE8yyJ6FJMPJAmZOjAV5gbgGD8zv4rCLB7qUZG1X0OnXbXokRofEiB4a KVUR2xi2sMPd2HONt5I7LhVEB+/TVlVllzitXS1bf/Anh3VOJ23ap8aD8wgTz8ArJO97 Rlv3xlCO3eUeMfWZI3WNpJcDyacfiSi2C281wLrdYz2Vs2V31bA26HJhZRbaVHsMKGIy fDcQ== X-Gm-Message-State: AHQUAuafErhh0OKsaGk7UhSS42u068JTXXc72YdfFJYT3aBV5ZCKBBor 45RWtV4VG1BHz0Szfj3ngPwiw06P X-Google-Smtp-Source: AHgI3Ia7sG6g3wCjGqC0BYlA9fl3hhxUZz2aOWJj0g5AQhOKfemA2ZhSlTzOY51IoHuudbKaYtkY5A== X-Received: by 2002:a19:41ca:: with SMTP id o193mr4846730lfa.121.1549847219063; Sun, 10 Feb 2019 17:06:59 -0800 (PST) Received: from localhost.localdomain (91-159-194-103.elisa-laajakaista.fi. [91.159.194.103]) by smtp.gmail.com with ESMTPSA id e132sm1970363lfg.22.2019.02.10.17.06.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Feb 2019 17:06:58 -0800 (PST) From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Feb 2019 03:06:54 +0200 Message-Id: <20190211010654.24762-4-jeebjp@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211010654.24762-1-jeebjp@gmail.com> References: <20190211010654.24762-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] lavc/libaribb24: use integer math to calculate font scaling X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavcodec/libaribb24.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/libaribb24.c b/libavcodec/libaribb24.c index 28f20ca767..3a59938451 100644 --- a/libavcodec/libaribb24.c +++ b/libavcodec/libaribb24.c @@ -249,11 +249,11 @@ static int libaribb24_handle_regions(AVCodecContext *avctx, AVSubtitle *sub) // font size if (region->i_fontwidth != profile_font_size || region->i_fontheight != profile_font_size) { - av_bprintf(&buf, "{\\fscx%d\\fscy%d}", - (int)round(((double)region->i_fontwidth / - (double)profile_font_size) * 100), - (int)round(((double)region->i_fontheight / - (double)profile_font_size) * 100)); + av_bprintf(&buf, "{\\fscx%"PRId64"\\fscy%"PRId64"}", + av_rescale(region->i_fontwidth, 100, + profile_font_size), + av_rescale(region->i_fontheight, 100, + profile_font_size)); } // TODO: positioning