mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	smoother: add comments about optimization recommendations from Jason Newton
This commit is contained in:
		
							parent
							
								
									f27a50691c
								
							
						
					
					
						commit
						2edb4df175
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
					@ -196,6 +196,13 @@ static double avg_gradient(pa_smoother *s, pa_usec_t x) {
 | 
				
			||||||
    int64_t ax = 0, ay = 0, k, t;
 | 
					    int64_t ax = 0, ay = 0, k, t;
 | 
				
			||||||
    double r;
 | 
					    double r;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* FIXME: Optimization: Jason Newton suggested that instead of
 | 
				
			||||||
 | 
					     * going through the history on each iteration we could calculated
 | 
				
			||||||
 | 
					     * avg_gradient() as we go.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * Second idea: it might make sense to weight history entries:
 | 
				
			||||||
 | 
					     * more recent entries should matter more than old ones. */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Too few measurements, assume gradient of 1 */
 | 
					    /* Too few measurements, assume gradient of 1 */
 | 
				
			||||||
    if (s->n_history < s->min_history)
 | 
					    if (s->n_history < s->min_history)
 | 
				
			||||||
        return 1;
 | 
					        return 1;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue