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 B898A40E5E for ; Fri, 11 Mar 2022 13:37:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F16AA68B178; Fri, 11 Mar 2022 15:37:26 +0200 (EET) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3B31C68A8CD for ; Fri, 11 Mar 2022 15:37:21 +0200 (EET) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id D778049658 for ; Fri, 11 Mar 2022 14:37:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1647005840; bh=CtCYsqcs1xS4iKI8UbrLSecpq8Mw2IUj6T3FlL5CbaY=; h=Date:From:To:Subject:In-Reply-To:References:From; b=eD7OqT1L96Ifli9YeZdp7gzEBjOMDGHrIS203M1rP4d+fwzUBdhP6NsOQ8QbTXJPp e7t4ucNtRfxW0VzO5rHHCnsIUG6ujBgDWl8gzUhoIwiNE7pMWsvdSefl2jBz2LN0Sd t4ei3uAUQPJzPnpOlcxWfdwxPYCZeSuJVExFKpKY= Date: Fri, 11 Mar 2022 14:37:20 +0100 Message-ID: <20220311143720.GC98298@haasn.xyz> From: Niklas Haas To: ffmpeg-devel@ffmpeg.org In-Reply-To: References: <20220311101413.92878-1-ffmpeg@haasn.xyz> <20220311101741.104545-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Content-Disposition: inline Subject: Re: [FFmpeg-devel] [PATCH v2] avcodec/pngenc: support writing iCCP chunks 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Fri, 11 Mar 2022 12:18:13 +0100 Andreas Rheinhardt wrote: > 1. This is not how should work with an AVBPrint -- you are throwing the > small-string optimization away here. Noted, though consider: many ICC profiles used in practice are small enough to fit inside the 1000 byte buffer. Especially the (absurdly common) case of an embedded sRGB profile. As an example, exporting a blank image in GIMP to PNG using the default settings produces a file with a 388-byte deflate compressed iCCP chunk. But I don't think this is performance critical enough to warrant skipping the `malloc` call, and it's definitely to allocate once than re-allocate in a loop. > 2. Using an AVBPrint with its dynamic reallocations is probably not good > here at all: It is easy to get a good upper bound via deflateBound() > which allows to omit the reallocations/the loop. (I should probably have > applied This is a good idea. I didn't realize this existed. I'll switch to using this function. _______________________________________________ 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".