History

add new c and assembly functions to optimize downsampler when downscale equal 1:3/1:4

Guangwei Wang committed 11 years ago

Commit 64657d31 parent 69a62ea9 files · +1125 −8Browse files

Showing the changes to codec/processing/src/arm (1 of 9 files). Show all

Unified · Split

codec/processing/src/arm/down_sample_neon.S+117−0
@@ -338,4 +338,121 @@ _LAST_ROW_WIDTH: · 337 unmodified lines
338 ldmia sp!, {r4-r12, lr}338 ldmia sp!, {r4-r12, lr}
339WELS_ASM_FUNC_END339WELS_ASM_FUNC_END
340 340
341WELS_ASM_FUNC_BEGIN DyadicBilinearOneThirdDownsampler_neon
342 stmdb sp!, {r4-r8, lr}
343
344 //Get the width and height
345 ldr r4, [sp, #24] //src_width
346 ldr r5, [sp, #28] //src_height
347
348 //Initialize the register
349 mov r6, r2
350 mov r8, r0
351 mov lr, #0
352
353 //Save the tailer for the un-aligned size
354 mla r7, r1, r5, r0
355 vld1.32 {q15}, [r7]
356
357 add r7, r2, r3
358 //processing a colume data
359comp_ds_bilinear_onethird_loop0:
360
361 vld3.8 {d0, d1, d2}, [r2]!
362 vld3.8 {d3, d4, d5}, [r2]!
363 vld3.8 {d16, d17, d18}, [r7]!
364 vld3.8 {d19, d20, d21}, [r7]!
365
366 vaddl.u8 q11, d0, d1
367 vaddl.u8 q12, d3, d4
368 vaddl.u8 q13, d16, d17
369 vaddl.u8 q14, d19, d20
370 vrshr.u16 q11, #1
371 vrshr.u16 q12, #1
372 vrshr.u16 q13, #1
373 vrshr.u16 q14, #1
374
375 vrhadd.u16 q11, q13
376 vrhadd.u16 q12, q14
377
378 vmovn.u16 d0, q11
379 vmovn.u16 d1, q12
380 vst1.8 {q0}, [r0]!
381
382 add lr, #48
383 cmp lr, r4
384 movcs lr, #0
385 addcs r6, r3, lsl #1
386 addcs r6, r6, r3
387 movcs r2, r6
388 addcs r7, r2, r3
389 addcs r8, r1
390 movcs r0, r8
391 subscs r5, #1
392 bne comp_ds_bilinear_onethird_loop0
393
394 //restore the tailer for the un-aligned size
395 vst1.32 {q15}, [r0]
396
397 ldmia sp!, {r4-r8,lr}
398WELS_ASM_FUNC_END
399
400WELS_ASM_FUNC_BEGIN DyadicBilinearQuarterDownsampler_neon
401 stmdb sp!, {r4-r8, lr}
402
403 //Get the width and height
404 ldr r4, [sp, #24] //src_width
405 ldr r5, [sp, #28] //src_height
406
407 //Initialize the register
408 mov r6, r2
409 mov r8, r0
410 mov lr, #0
411 lsr r5, #2
412
413 //Save the tailer for the un-aligned size
414 mla r7, r1, r5, r0
415 vld1.32 {q15}, [r7]
416
417 add r7, r2, r3
418 //processing a colume data
419comp_ds_bilinear_quarter_loop0:
420
421 vld2.16 {q0, q1}, [r2]!
422 vld2.16 {q2, q3}, [r2]!
423 vld2.16 {q8, q9}, [r7]!
424 vld2.16 {q10, q11}, [r7]!
425
426 vpaddl.u8 q0, q0
427 vpaddl.u8 q2, q2
428 vpaddl.u8 q8, q8
429 vpaddl.u8 q10, q10
430 vrshr.u16 q0, #1
431 vrshr.u16 q2, #1
432 vrshr.u16 q8, #1
433 vrshr.u16 q10, #1
434
435 vrhadd.u16 q0, q8
436 vrhadd.u16 q2, q10
437 vmovn.u16 d0, q0
438 vmovn.u16 d1, q2
439 vst1.8 {q0}, [r0]!
440
441 add lr, #64
442 cmp lr, r4
443 movcs lr, #0
444 addcs r6, r3, lsl #2
445 movcs r2, r6
446 addcs r7, r2, r3
447 addcs r8, r1
448 movcs r0, r8
449 subscs r5, #1
450 bne comp_ds_bilinear_quarter_loop0
451
452 //restore the tailer for the un-aligned size
453 vst1.32 {q15}, [r0]
454
455 ldmia sp!, {r4-r8,lr}
456WELS_ASM_FUNC_END
457
341#endif458#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t