[FFmpeg-devel] [PATCH v2] avfilter: compress CUDA PTX code if possible

Philip Langdale philipl at overt.org
Sat Jun 19 21:55:01 EEST 2021


On Fri, 18 Jun 2021 23:07:58 +0200
Timo Rothenpieler <timo at rothenpieler.org> wrote:

> >> +
> >> +    if (inflateInit2(&stream, 32 + 15) != Z_OK) {  
> > 
> > Can you add a comment explaining the magic numbers?  
> 
> I have no idea what those numbers do, I copied them from http.c and
> they work.

Heh.

So, I read this: https://www.zlib.net/manual.html

> windowBits can also be greater than 15 for optional gzip decoding.
> Add 32 to windowBits to enable zlib and gzip decoding with automatic
> header detection, or add 16 to decode only the gzip format (the zlib
> format will return a Z_DATA_ERROR). If a gzip stream is being
> decoded, strm->adler is a CRC-32 instead of an Adler-32. Unlike the
> gunzip utility and gzread() (see below), inflate() will not
> automatically decode concatenated gzip streams. inflate() will return
> Z_STREAM_END at the end of the gzip stream. The state would need to
> be reset to continue decoding a subsequent gzip stream.
 
I think that means it is necessary to pass '32 + 15' although you might
do '32 + 16' because you know that the files were really gzipped.

--phil


More information about the ffmpeg-devel mailing list