GD uses libpng.
The libpng manpage says essentially what the pngimage description said. If that's "far from a confirmation" then you'll need to read the libpng source for confirmation. In libpng's png.h, the macros are defined:
/* Flags for png_set_filter() to say which filters to use. */
#define PNG_NO_FILTERS 0x00
#define PNG_FILTER_NONE 0x08
#define PNG_FILTER_SUB 0x10
#define PNG_FILTER_UP 0x20
#define PNG_FILTER_AVG 0x40
#define PNG_FILTER_PAETH 0x80
#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \
PNG_FILTER_AVG | PNG_FILTER_PAETH)
The macros are used in png_write_find_filter(), which contains code like this:
if (filter_to_do & PNG_FILTER_SUB)
[calculate figure of merit for the SUB filter]
else if (filter_to_do & PNG_FILTER_UP)
[calculate figure of merit for the UP filter]
...
else if (filter_to_do & PNG_FILTER_PAETH)
[calculate figure of merit for the PAETH filter]
Then select the filter with the lowest figure of merit for the scanline being written. The PNG_ALL_FILTERS macro simply provides a short way of enabling all filters for testing.