mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	resampler: avoid some multiplies when we can
This commit is contained in:
		
							parent
							
								
									aeae567f88
								
							
						
					
					
						commit
						3cc1278dcf
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		| 
						 | 
					@ -1122,8 +1122,13 @@ static void remap_channels_matrix (pa_resampler *r, void *dst, const void *src,
 | 
				
			||||||
                    d = (float *)dst + oc;
 | 
					                    d = (float *)dst + oc;
 | 
				
			||||||
                    s = (float *)src + ic;
 | 
					                    s = (float *)src + ic;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    for (i = n; i > 0; i--, s += n_ic, d += n_oc)
 | 
							    if (vol >= 1.0) {
 | 
				
			||||||
                        *d += *s * vol;
 | 
					                        for (i = n; i > 0; i--, s += n_ic, d += n_oc)
 | 
				
			||||||
 | 
					                            *d += *s;
 | 
				
			||||||
 | 
							    } else { 
 | 
				
			||||||
 | 
					                        for (i = n; i > 0; i--, s += n_ic, d += n_oc)
 | 
				
			||||||
 | 
					                            *d += *s * vol;
 | 
				
			||||||
 | 
							    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue