From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 157BC4C7F9 for ; Sun, 8 Jun 2025 21:23:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id DDF6968C621; Mon, 9 Jun 2025 00:23:54 +0300 (EEST) To: ffmpeg-devel@ffmpeg.org Date: Sun, 8 Jun 2025 14:23:40 -0700 MIME-Version: 1.0 Message-ID: List-Id: FFmpeg development discussions and patches List-Post: From: rcombs via ffmpeg-devel Precedence: list Cc: rcombs X-Mailman-Version: 2.1.29 X-BeenThere: ffmpeg-devel@ffmpeg.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: FFmpeg development discussions and patches List-Help: Subject: [FFmpeg-devel] [PATCH] swscale/options: use accurate rounding and full chroma by default Content-Type: multipart/mixed; boundary="===============1480094483945095020==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============1480094483945095020== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 88C5168B61D for ; Mon, 9 Jun 2025 00:23:48 +0300 (EEST) Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-b2f0faeb994so3664207a12.0 for ; Sun, 08 Jun 2025 14:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rcombs.me; s=google; t=1749417826; x=1750022626; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=4trOA1jnVG05Ej42lA27QyU4+yBWx9psTfffOO7dqcY=; b=Kzjb4YiCYXRUb6yOe+5AhbvtHoTEkQ57Fp1PdG6d5CudN9qQhH2gQA1agdv2Doo0BR xfmsFAim3oZObiMvG0X6sv7pwG8hN0McThULOb9D+IWYlWDuSjrBsNCt3m2apQUZQMki z8EZdnCAX3VDtr/FZDgBB13i9Vg3b7anygMiHC3Zk9vje/Azs0zdojESo/DXkwSezjli t9KDD6vmkStGnsJyPtWFmcMRISWJ3FLlpMC3tjOA+vrTilUTQlati7uZv/TenvKIZ1t9 nYm1us8JYQ/PUTUjUvzihHW2uoKjX0qEC/DSWKBTMqrtCL+sMEJ/pUnPwzE/Up+fe8j+ M7Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749417826; x=1750022626; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4trOA1jnVG05Ej42lA27QyU4+yBWx9psTfffOO7dqcY=; b=fd7a/TgApt6DkaWAmqO8CHmbOf4TJGGmwTeQDe1C2cRujUAppzvpGjIFrNwO4dsyJE mUDKv+D06uMXSQqtFoVAQmQeUjUaubK8U+aGM3fJgVt4Pxw0DDuIVhlCYXJLzA9Wc9tq 07V+0rHI2NtN7A3AvCHDiOaUGopDgPsC4aOhjYwhuxhaRm0lzFmkMOtQ5XXORI9LcSEf ZHLa2kMUW6zynsvOR8NDhPuFVLWCEbABl9FaO+ls7R9prHxS8GpvSFqHO903M7HfVDgQ 0MaLH3vxJfjqjqbogZGvlyNRlHYCeQSuf5ghzPu+Js7Of+0t6c885QcEWmTCLcoWa+fP TnXw== X-Gm-Message-State: AOJu0Yw4ovjqD0UU5Vu7o8z9X3L6c6JNR9k+cPgPjCX5/X3YjibWGJbm LoiJbzhnovrGylrwS6A4GHvr9B18/gcnx8yaiLDw0BA1ZWzgJ/k2eij6oOZ0hFT0uJNekrrFh7A pwaw= X-Gm-Gg: ASbGncuZoL5jGPsTaSi0x1WInBGFL77ov9g2ziOPAcVVKQmraSrqiooJrnoXs7L/i0u gsfC0yNqsBB6ZQnj+yEqjQEAxr62Kb2d6uHt9sdzucBa/OmMZoI+NMdicsiFAP1I7XKMtei1ug/ icdOWxMfxClPH9KKvj2VUHyZ3jD3SnEeeHq3/LJL+Ho7rwoeNuPuda6ng5eRKyaXBflaDrSQQKC pn1piJAd/GW+rb/uvUwWBb67yVkIKdI5qLIXSZouL1EdCoTlnrFo7QFPlFv5B6wVvYC8cmy35ti XZQNeZa8ZCVA0THTdgE2MmceyY/s2oDnFolA+7ie5vwPvfhMQ2XTOsRUujt/yx+vUoZs2BXhzLz yFQ== X-Google-Smtp-Source: AGHT+IF3dpzGlkERrplnPuOhFpwfc1FiBAlP4wojhSmhPZK3PfVMEW7GENRCfzeduKP8ObOfIFQCBw== X-Received: by 2002:a17:902:dace:b0:234:8ec1:4aea with SMTP id d9443c01a7336-23601deb4bemr150842495ad.52.1749417826164; Sun, 08 Jun 2025 14:23:46 -0700 (PDT) Received: from localhost.localdomain ([24.35.87.147]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-31349f44c33sm4450794a91.21.2025.06.08.14.23.45 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 08 Jun 2025 14:23:45 -0700 (PDT) From: rcombs To: ffmpeg-devel@ffmpeg.org Subject: [PATCH] swscale/options: use accurate rounding and full chroma by default Date: Sun, 8 Jun 2025 14:23:40 -0700 Message-ID: <20250608212340.37328-1-rcombs@rcombs.me> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This has been causing quality degradation for people since the dawn of sws, and the performance concerns that originally led to this default have been soundly defeated by the march of time. --- doc/APIchanges | 3 +++ libswscale/options.c | 4 +++- libswscale/version.h | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 91710bb27d..6d81048e48 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28 API changes, most recent first: +2024-12-xx - xxxxxxxxxx - lsws 9.0.101 - swscale.h + Use accurate rounding and full chroma by default. + 2025-05-21 - xxxxxxxxxx - lavu 60.3.100 - avassert.h Add av_unreachable() and av_assume() macros. diff --git a/libswscale/options.c b/libswscale/options.c index feecae8c89..7d29a416cb 100644 --- a/libswscale/options.c +++ b/libswscale/options.c @@ -31,8 +31,10 @@ static const char *sws_context_to_name(void *ptr) #define DEFAULT 0 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM +#define DEFAULT_FLAGS SWS_BICUBIC | SWS_ACCURATE_RND | SWS_FULL_CHR_H_INT | SWS_FULL_CHR_H_INP + static const AVOption swscale_options[] = { - { "sws_flags", "swscale flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, { .i64 = SWS_BICUBIC }, .flags = VE, .unit = "sws_flags", .max = UINT_MAX }, + { "sws_flags", "swscale flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, { .i64 = DEFAULT_FLAGS }, .flags = VE, .unit = "sws_flags", .max = UINT_MAX }, { "fast_bilinear", "fast bilinear", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_FAST_BILINEAR }, .flags = VE, .unit = "sws_flags" }, { "bilinear", "bilinear", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_BILINEAR }, .flags = VE, .unit = "sws_flags" }, { "bicubic", "bicubic", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_BICUBIC }, .flags = VE, .unit = "sws_flags" }, diff --git a/libswscale/version.h b/libswscale/version.h index 148efd83eb..02baedad5b 100644 --- a/libswscale/version.h +++ b/libswscale/version.h @@ -29,7 +29,7 @@ #include "version_major.h" #define LIBSWSCALE_VERSION_MINOR 0 -#define LIBSWSCALE_VERSION_MICRO 100 +#define LIBSWSCALE_VERSION_MICRO 101 #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ LIBSWSCALE_VERSION_MINOR, \ -- 2.45.1 --===============1480094483945095020== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============1480094483945095020==--