You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	lavc/aacpsdsp: RISC-V V mul_pair_single
This commit is contained in:
		
				
					committed by
					
						 Lynne
						Lynne
					
				
			
			
				
	
			
			
			
						parent
						
							b0cacf4c3f
						
					
				
				
					commit
					e180326a0b
				
			| @@ -25,13 +25,17 @@ | ||||
| #include "libavcodec/aacpsdsp.h" | ||||
|  | ||||
| void ff_ps_add_squares_rvv(float *dst, const float (*src)[2], int n); | ||||
| void ff_ps_mul_pair_single_rvv(float (*dst)[2], float (*src0)[2], float *src1, | ||||
|                                int n); | ||||
|  | ||||
| av_cold void ff_psdsp_init_riscv(PSDSPContext *c) | ||||
| { | ||||
| #if HAVE_RVV | ||||
|     int flags = av_get_cpu_flags(); | ||||
|  | ||||
|     if (flags & AV_CPU_FLAG_RVV_F32) | ||||
|     if (flags & AV_CPU_FLAG_RVV_F32) { | ||||
|         c->add_squares = ff_ps_add_squares_rvv; | ||||
|         c->mul_pair_single = ff_ps_mul_pair_single_rvv; | ||||
|     } | ||||
| #endif | ||||
| } | ||||
|   | ||||
| @@ -35,3 +35,20 @@ func ff_ps_add_squares_rvv, zve32f | ||||
|  | ||||
|         ret | ||||
| endfunc | ||||
|  | ||||
| func ff_ps_mul_pair_single_rvv, zve32f | ||||
| 1: | ||||
|         vsetvli     t0, a3, e32, m1, ta, ma | ||||
|         vlseg2e32.v v24, (a1) | ||||
|         sub         a3, a3, t0 | ||||
|         vle32.v     v16, (a2) | ||||
|         sh3add      a1, t0, a1 | ||||
|         vfmul.vv    v24, v24, v16 | ||||
|         sh2add      a2, t0, a2 | ||||
|         vfmul.vv    v25, v25, v16 | ||||
|         vsseg2e32.v v24, (a0) | ||||
|         sh3add      a0, t0, a0 | ||||
|         bnez        a3, 1b | ||||
|  | ||||
|         ret | ||||
| endfunc | ||||
|   | ||||
		Reference in New Issue
	
	Block a user