mirror of
				https://git.code.sf.net/p/libpng/code.git
				synced 2025-07-10 18:04:09 +02:00 
			
		
		
		
	[libpng15] Removed WEIGHTED_FILTER paragraph from the man page.
This commit is contained in:
		
							parent
							
								
									91c2de79b9
								
							
						
					
					
						commit
						4dc8ea0929
					
				@ -3754,41 +3754,6 @@ is called for the first time.)
 | 
				
			|||||||
              same as the value of filter_method used
 | 
					              same as the value of filter_method used
 | 
				
			||||||
              in png_set_IHDR().
 | 
					              in png_set_IHDR().
 | 
				
			||||||
 | 
					
 | 
				
			||||||
It is also possible to influence how libpng chooses from among the
 | 
					 | 
				
			||||||
available filters.  This is done in one or both of two ways - by
 | 
					 | 
				
			||||||
telling it how important it is to keep the same filter for successive
 | 
					 | 
				
			||||||
rows, and by telling it the relative computational costs of the filters.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    double weights[3] = {1.5, 1.3, 1.1},
 | 
					 | 
				
			||||||
       costs[PNG_FILTER_VALUE_LAST] =
 | 
					 | 
				
			||||||
       {1.0, 1.3, 1.3, 1.5, 1.7};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    png_set_filter_heuristics(png_ptr,
 | 
					 | 
				
			||||||
       PNG_FILTER_HEURISTIC_WEIGHTED, 3,
 | 
					 | 
				
			||||||
       weights, costs);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
The weights are multiplying factors that indicate to libpng that the
 | 
					 | 
				
			||||||
row filter should be the same for successive rows unless another row filter
 | 
					 | 
				
			||||||
is that many times better than the previous filter.  In the above example,
 | 
					 | 
				
			||||||
if the previous 3 filters were SUB, SUB, NONE, the SUB filter could have a
 | 
					 | 
				
			||||||
"sum of absolute differences" 1.5 x 1.3 times higher than other filters
 | 
					 | 
				
			||||||
and still be chosen, while the NONE filter could have a sum 1.1 times
 | 
					 | 
				
			||||||
higher than other filters and still be chosen.  Unspecified weights are
 | 
					 | 
				
			||||||
taken to be 1.0, and the specified weights should probably be declining
 | 
					 | 
				
			||||||
like those above in order to emphasize recent filters over older filters.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
The filter costs specify for each filter type a relative decoding cost
 | 
					 | 
				
			||||||
to be considered when selecting row filters.  This means that filters
 | 
					 | 
				
			||||||
with higher costs are less likely to be chosen over filters with lower
 | 
					 | 
				
			||||||
costs, unless their "sum of absolute differences" is that much smaller.
 | 
					 | 
				
			||||||
The costs do not necessarily reflect the exact computational speeds of
 | 
					 | 
				
			||||||
the various filters, since this would unduly influence the final image
 | 
					 | 
				
			||||||
size.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Note that the numbers above were invented purely for this example and
 | 
					 | 
				
			||||||
are given only to help explain the function usage.  Little testing has
 | 
					 | 
				
			||||||
been done to find optimum values for either the costs or the weights.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Requesting debug printout
 | 
					Requesting debug printout
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The macro definition PNG_DEBUG can be used to request debugging
 | 
					The macro definition PNG_DEBUG can be used to request debugging
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										35
									
								
								libpng.3
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								libpng.3
									
									
									
									
									
								
							@ -4246,41 +4246,6 @@ is called for the first time.)
 | 
				
			|||||||
              same as the value of filter_method used
 | 
					              same as the value of filter_method used
 | 
				
			||||||
              in png_set_IHDR().
 | 
					              in png_set_IHDR().
 | 
				
			||||||
 | 
					
 | 
				
			||||||
It is also possible to influence how libpng chooses from among the
 | 
					 | 
				
			||||||
available filters.  This is done in one or both of two ways - by
 | 
					 | 
				
			||||||
telling it how important it is to keep the same filter for successive
 | 
					 | 
				
			||||||
rows, and by telling it the relative computational costs of the filters.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    double weights[3] = {1.5, 1.3, 1.1},
 | 
					 | 
				
			||||||
       costs[PNG_FILTER_VALUE_LAST] =
 | 
					 | 
				
			||||||
       {1.0, 1.3, 1.3, 1.5, 1.7};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    png_set_filter_heuristics(png_ptr,
 | 
					 | 
				
			||||||
       PNG_FILTER_HEURISTIC_WEIGHTED, 3,
 | 
					 | 
				
			||||||
       weights, costs);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
The weights are multiplying factors that indicate to libpng that the
 | 
					 | 
				
			||||||
row filter should be the same for successive rows unless another row filter
 | 
					 | 
				
			||||||
is that many times better than the previous filter.  In the above example,
 | 
					 | 
				
			||||||
if the previous 3 filters were SUB, SUB, NONE, the SUB filter could have a
 | 
					 | 
				
			||||||
"sum of absolute differences" 1.5 x 1.3 times higher than other filters
 | 
					 | 
				
			||||||
and still be chosen, while the NONE filter could have a sum 1.1 times
 | 
					 | 
				
			||||||
higher than other filters and still be chosen.  Unspecified weights are
 | 
					 | 
				
			||||||
taken to be 1.0, and the specified weights should probably be declining
 | 
					 | 
				
			||||||
like those above in order to emphasize recent filters over older filters.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
The filter costs specify for each filter type a relative decoding cost
 | 
					 | 
				
			||||||
to be considered when selecting row filters.  This means that filters
 | 
					 | 
				
			||||||
with higher costs are less likely to be chosen over filters with lower
 | 
					 | 
				
			||||||
costs, unless their "sum of absolute differences" is that much smaller.
 | 
					 | 
				
			||||||
The costs do not necessarily reflect the exact computational speeds of
 | 
					 | 
				
			||||||
the various filters, since this would unduly influence the final image
 | 
					 | 
				
			||||||
size.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Note that the numbers above were invented purely for this example and
 | 
					 | 
				
			||||||
are given only to help explain the function usage.  Little testing has
 | 
					 | 
				
			||||||
been done to find optimum values for either the costs or the weights.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
.SS Requesting debug printout
 | 
					.SS Requesting debug printout
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The macro definition PNG_DEBUG can be used to request debugging
 | 
					The macro definition PNG_DEBUG can be used to request debugging
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user