mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	audioconvert: add dither passthrough flag
This commit is contained in:
		
							parent
							
								
									b5e0151cc0
								
							
						
					
					
						commit
						a84bf672e8
					
				
					 3 changed files with 8 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -1409,9 +1409,10 @@ static int setup_dither(struct impl *this)
 | 
			
		|||
	if ((res = dither_init(&this->dither)) < 0)
 | 
			
		||||
		return res;
 | 
			
		||||
 | 
			
		||||
	spa_log_info(this->log, "%p:got dither %08x:%08x noise:%d quantize:%d", this,
 | 
			
		||||
	spa_log_info(this->log, "%p: got dither %08x:%08x quantize:%d:%d passthrough:%d", this,
 | 
			
		||||
			this->cpu_flags, this->dither.cpu_flags,
 | 
			
		||||
			this->dither.noise, this->dither.quantize);
 | 
			
		||||
			this->dither.quantize, this->dither.noise,
 | 
			
		||||
			this->dither.is_passthrough);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -2485,7 +2486,7 @@ static int impl_node_process(void *object)
 | 
			
		|||
	}
 | 
			
		||||
	this->out_offset += n_samples;
 | 
			
		||||
 | 
			
		||||
	if (this->dither.process != NULL) {
 | 
			
		||||
	if (!this->dither.is_passthrough) {
 | 
			
		||||
		in_datas = (const void**)out_datas;
 | 
			
		||||
		if (out_passthrough)
 | 
			
		||||
			out_datas = dst_datas;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -98,5 +98,8 @@ int dither_init(struct dither *d)
 | 
			
		|||
 | 
			
		||||
	d->free = impl_dither_free;
 | 
			
		||||
	d->process = info->process;
 | 
			
		||||
 | 
			
		||||
	d->is_passthrough = d->noise == 0 && d->method == DITHER_METHOD_NONE;
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,6 +42,7 @@ struct dither {
 | 
			
		|||
	uint32_t method;
 | 
			
		||||
	uint32_t n_channels;
 | 
			
		||||
	uint32_t cpu_flags;
 | 
			
		||||
	unsigned int is_passthrough:1;
 | 
			
		||||
 | 
			
		||||
	struct spa_log *log;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue