From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id E22B6430C9 for ; Fri, 20 May 2022 16:06:57 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AF0C568B498; Fri, 20 May 2022 19:06:55 +0300 (EEST) Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7C82A68AEFF for ; Fri, 20 May 2022 19:06:49 +0300 (EEST) Received: by mail-qk1-f180.google.com with SMTP id c1so7202679qkf.13 for ; Fri, 20 May 2022 09:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=4IEglPUtXNuXag0vJCdEFDAYZKu8shWgnVlWu5uwjNM=; b=mIq2mNg4i1YGOmYRyaGxk2rH291/UH+Af7cKhnmWDhFlUl52b5x0Ebb2ofKmT8XklW casp8bezY5sY/krmLmCkHPzsXe3FOpRyvbQTtb+qkCFv6RxrUdjw9plyOGu9VRi9rym+ mAHQ7NVZ8RGR0FQQwqDpjOZBKqFqK0f+Uf7qx1OCslg6QltGvDosLiGraz5Z8eWp5ph5 1xpNsU8QWVtYysmsPzeL5rrlyKewl2haTkKNGu8wMbbDOVUNicn4u8rVnGp7tas78NCj 7sOLQ7ettyy2ygZfG6mqhDV/Fr2UmjSeI/n47+moKYcRXFaV5c731kx/W99VBCdYv8aO lo+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=4IEglPUtXNuXag0vJCdEFDAYZKu8shWgnVlWu5uwjNM=; b=ijXB3pz8QXqRQmNorxyJ/EVAti5+XCoDdcDUjiKO0VIWCdTWCXpiesMQehCeP9bXUH 6WEnPJE1f6HfsF6m46I2wECcnZh7+aQZ+v1L8vw7jaCxuySWXXqrVJKX1XfU2TGq5mAv jM7mZzP1xavyQ/u0cnua1iKbftzMdW5X6K25ism8HIr+d7u1kwQ5v1BVvNFxVPLwReob JnEojj4JT3xED3iQpRZOFqXzT9DYObHbayDNdfrpyj9e3j+K4l1uGyfHqvEP+xM5CB3a 3WoADxuT+moeVyE8bFhX/wId7gROBQXCrTrYbuF91sUiOhn8weFnrggYcugVwIDUHqnv hGnw== X-Gm-Message-State: AOAM532Vbq9BdGk2290FSrAXPZ5gFDe+IQivV0zGqYvODwzJLoJdIOyz OJl6wce/tVES9KaH3sAP4cCWHb/N8Kc= X-Google-Smtp-Source: ABdhPJxpQ0bz9x/3X1/HT8fbJVuosUP/HdRXfYStCtAZrkpNd6QOJAyCA1+nqCg/xBgMH/thc+7QTw== X-Received: by 2002:a05:620a:2992:b0:6a0:94d2:2e5c with SMTP id r18-20020a05620a299200b006a094d22e5cmr6528890qkp.62.1653062808279; Fri, 20 May 2022 09:06:48 -0700 (PDT) Received: from [192.168.1.35] (c-68-41-54-207.hsd1.mi.comcast.net. [68.41.54.207]) by smtp.gmail.com with ESMTPSA id 70-20020a370849000000b006a03cbb1323sm1198622qki.65.2022.05.20.09.06.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 May 2022 09:06:48 -0700 (PDT) Message-ID: <9f9b07f4-9ea6-2bbb-ea90-0c3cb6c1eda8@gmail.com> Date: Fri, 20 May 2022 12:06:47 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Content-Language: en-US-large To: ffmpeg-devel@ffmpeg.org References: <20220520155313.171100-1-leo.izen@gmail.com> <20220520155313.171100-2-leo.izen@gmail.com> From: Leo Izen In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 1/1] avutil/csp: create public API for colorspace structs 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 5/20/22 12:01, Andreas Rheinhardt wrote: > Leo Izen: >> This commit moves some of the functionality from avfilter/colorspace >> into avutil/csp and exposes it as a public API so it can be used by >> libavcodec and/or libavformat. It also converts those structs from >> double values to AVRational to make regression testing easier and >> more consistent. >> --- >> + >> +#include >> + >> +#include "attributes.h" >> +#include "csp.h" >> +#include "pixfmt.h" >> +#include "rational.h" >> + >> +#define AVR(d) { (int)(d * 30000), 30000 } > > Does this really lead to the intended values? After all, the cast does > not round to nearest, instead it just discards the fractional part (i.e. > rounds towards zero). You should probably use (int)(d * 30000 + 0.5) to > compensate for that. > I could change it to do that. That said, I modeled this after the FIX macro in libavcodec/mpegaudio.h on line 60, which doesn't do that. Is that macro also incorrect, or is there a caveat here that makes these scenarios different? - Leo Izen (thebombzen) _______________________________________________ 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".