On Fri, 11 Mar 2022 12:18:13 +0100 Andreas Rheinhardt <andreas.rheinha...@outlook.com> 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-requ...@ffmpeg.org with subject "unsubscribe".