forked from Grouper-AOSP/platform_manifest
-
Notifications
You must be signed in to change notification settings - Fork 13
/
external_libhevc.patch
4864 lines (4065 loc) · 184 KB
/
external_libhevc.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff --git a/common/arm/ihevc_deblk_chroma_horz.s b/common/arm/ihevc_deblk_chroma_horz.s
index 34422ff..b0a79eb 100644
--- a/common/arm/ihevc_deblk_chroma_horz.s
+++ b/common/arm/ihevc_deblk_chroma_horz.s
@@ -36,6 +36,12 @@
@*
@*******************************************************************************/
+.equ qp_offset_u_offset, 40
+.equ qp_offset_v_offset, 44
+.equ tc_offset_div2_offset, 48
+.equ filter_p_offset, 52
+.equ filter_q_offset, 56
+
.text
.align 4
@@ -62,17 +68,17 @@ ihevc_deblk_chroma_horz_a9q:
add r6,r0,r1
add r1,r2,r3
vmovl.u8 q0,d0
- ldr r10,[sp,#0x28]
+ ldr r10,[sp,#qp_offset_u_offset]
vld1.8 {d2},[r12]
add r2,r1,#1
- ldr r4,[sp,#0x30]
+ ldr r4,[sp,#tc_offset_div2_offset]
vld1.8 {d4},[r5]
- ldr r8,[sp,#0x34]
+ ldr r8,[sp,#filter_p_offset]
vld1.8 {d16},[r6]
- ldr r9,[sp,#0x38]
+ ldr r9,[sp,#filter_q_offset]
adds r1,r10,r2,asr #1
vmovl.u8 q1,d2
- ldr r7,[sp,#0x2c]
+ ldr r7,[sp,#qp_offset_v_offset]
ldr r3,gai4_ihevc_qp_table_addr
ulbl1:
add r3, r3, pc
diff --git a/common/arm/ihevc_deblk_chroma_vert.s b/common/arm/ihevc_deblk_chroma_vert.s
index 4cb305f..3962b28 100644
--- a/common/arm/ihevc_deblk_chroma_vert.s
+++ b/common/arm/ihevc_deblk_chroma_vert.s
@@ -37,6 +37,12 @@
@*
@*******************************************************************************/
+.equ qp_offset_u_offset, 40
+.equ qp_offset_v_offset, 44
+.equ tc_offset_div2_offset, 48
+.equ filter_p_offset, 52
+.equ filter_q_offset, 56
+
.text
.align 4
@@ -63,19 +69,19 @@ ihevc_deblk_chroma_vert_a9q:
vld1.8 {d5},[r8],r1
add r2,r2,#1
vld1.8 {d17},[r8],r1
- ldr r7,[sp,#0x28]
+ ldr r7,[sp,#qp_offset_u_offset]
vld1.8 {d16},[r8],r1
- ldr r4,[sp,#0x38]
+ ldr r4,[sp,#filter_q_offset]
vld1.8 {d4},[r8]
- ldr r5,[sp,#0x30]
+ ldr r5,[sp,#tc_offset_div2_offset]
vtrn.8 d5,d17
adds r3,r7,r2,asr #1
vtrn.8 d16,d4
ldr r7,gai4_ihevc_qp_table_addr
ulbl1:
add r7,r7,pc
- ldr r12,[sp,#0x34]
- ldr r6,[sp,#0x2c]
+ ldr r12,[sp,#filter_p_offset]
+ ldr r6,[sp,#qp_offset_v_offset]
bmi l1.2944
cmp r3,#0x39
ldrle r3,[r7,r3,lsl #2]
diff --git a/common/arm/ihevc_deblk_luma_horz.s b/common/arm/ihevc_deblk_luma_horz.s
index b12ceb9..76660b3 100644
--- a/common/arm/ihevc_deblk_luma_horz.s
+++ b/common/arm/ihevc_deblk_luma_horz.s
@@ -36,6 +36,12 @@
@*
@*******************************************************************************/
+.equ qp_q_offset, 108
+.equ beta_offset_div2_offset, 112
+.equ tc_offset_div2_offset, 116
+.equ filter_p_offset, 120
+.equ filter_q_offset, 124
+
.text
.align 4
@@ -57,12 +63,14 @@ gai4_ihevc_beta_table_addr:
ihevc_deblk_luma_horz_a9q:
stmfd sp!, {r3-r12,lr}
- ldr r4,[sp,#0x2c]
- ldr r5,[sp,#0x30]
+ vpush {d8 - d15}
+
+ ldr r4,[sp,#qp_q_offset]
+ ldr r5,[sp,#beta_offset_div2_offset]
add r3,r3,r4
add r3,r3,#1
- ldr r6, [sp,#0x34]
+ ldr r6, [sp,#tc_offset_div2_offset]
asr r3,r3,#1
add r7,r3,r5,lsl #1
add r3,r3,r6,lsl #1
@@ -291,9 +299,9 @@ ulbl1:
vmin.u8 d18,d20,d30
mov r2,#2
vqadd.u8 d30,d23,d1
- ldr r4,[sp,#0x38] @ loading the filter_flag_p
+ ldr r4,[sp,#filter_p_offset] @ loading the filter_flag_p
vmax.u8 d2,d18,d31
- ldr r5,[sp,#0x3c] @ loading the filter_flag_q
+ ldr r5,[sp,#filter_q_offset] @ loading the filter_flag_q
vrshrn.i16 d21,q7,#2
b end_dep_deq_decision_horz
@ r2 has the value of de
@@ -308,8 +316,8 @@ l1.1840:
mov r2,#1
mov r11,r5
- ldr r4,[sp,#0x38] @ loading the filter_flag_p
- ldr r5,[sp,#0x3c] @ loading the filter_flag_q
+ ldr r4,[sp,#filter_p_offset] @ loading the filter_flag_p
+ ldr r5,[sp,#filter_q_offset] @ loading the filter_flag_q
cmp r6,#1
moveq r9,#0
@@ -397,6 +405,7 @@ strong_filtering_p:
vst1.32 d3[0],[r12]
l1.2404:
+ vpop {d8 - d15}
ldmfd sp!, {r3-r12,pc}
@ r4=flag p
@@ -537,6 +546,8 @@ l1.2852:
vbsl d19,d26,d13
vst1.32 {d19[0]},[r12],r1
vst1.32 {d18[0]},[r12]
+
+ vpop {d8 - d15}
ldmfd sp!, {r3-r12,r15}
diff --git a/common/arm/ihevc_deblk_luma_vert.s b/common/arm/ihevc_deblk_luma_vert.s
index ee247cc..91662c9 100644
--- a/common/arm/ihevc_deblk_luma_vert.s
+++ b/common/arm/ihevc_deblk_luma_vert.s
@@ -37,6 +37,12 @@
@*
@*******************************************************************************/
+.equ qp_q_offset, 44
+.equ beta_offset_div2_offset, 48
+.equ tc_offset_div2_offset, 52
+.equ filter_p_offset, 56
+.equ filter_q_offset, 60
+
.text
.align 4
@@ -60,12 +66,12 @@ gai4_ihevc_beta_table_addr:
ihevc_deblk_luma_vert_a9q:
push {r3-r12,lr}
- ldr r4,[sp,#0x2c]
- ldr r5,[sp,#0x30]
+ ldr r4,[sp,#qp_q_offset]
+ ldr r5,[sp,#beta_offset_div2_offset]
add r3,r3,r4
add r3,r3,#1
- ldr r6, [sp,#0x34]
+ ldr r6, [sp,#tc_offset_div2_offset]
asr r3,r3,#1
add r7,r3,r5,lsl #1
add r3,r3,r6,lsl #1
@@ -291,9 +297,9 @@ ulbl1:
vqadd.u8 d30,d6,d19
mov r2,#2
- ldr r4,[sp,#0x38] @ loading the filter_flag_p
+ ldr r4,[sp,#filter_p_offset] @ loading the filter_flag_p
vqsub.u8 d31,d6,d19
- ldr r5,[sp,#0x3c] @ loading the filter_flag_q
+ ldr r5,[sp,#filter_q_offset] @ loading the filter_flag_q
b end_dep_deq_decision
@ r2 has the value of de
@ r6 has teh value of tc
@@ -307,8 +313,8 @@ l1.336:
mov r2,#1
l1.424:
mov r11,r5
- ldr r4,[sp,#0x38] @ loading the filter_flag_p
- ldr r5,[sp,#0x3c] @ loading the filter_flag_q
+ ldr r4,[sp,#filter_p_offset] @ loading the filter_flag_p
+ ldr r5,[sp,#filter_q_offset] @ loading the filter_flag_q
cmp r6,#1
moveq r9,#0
@@ -532,7 +538,6 @@ l1.1212:
vst1.16 {d3[1]},[r12]
vst1.8 {d16[3]},[r3]
l1.1272:
- @ ldr r3,[sp,#0x38]
cmp r5,#0
beq l1.964
@ checks for the flag q
diff --git a/common/arm/ihevc_inter_pred_chroma_copy.s b/common/arm/ihevc_inter_pred_chroma_copy.s
index 0da34cc..1b38dbb 100644
--- a/common/arm/ihevc_inter_pred_chroma_copy.s
+++ b/common/arm/ihevc_inter_pred_chroma_copy.s
@@ -92,6 +92,9 @@
@ r5 => ht
@ r6 => wd
+.equ ht_offset, 44
+.equ wd_offset, 48
+
.text
.align 4
@@ -104,9 +107,9 @@
ihevc_inter_pred_chroma_copy_a9q:
stmfd sp!, {r4-r12, r14} @stack stores the values of the arguments
- ldr r12,[sp,#48] @loads wd
+ ldr r12,[sp,#wd_offset] @loads wd
lsl r12,r12,#1
- ldr r7,[sp,#44] @loads ht
+ ldr r7,[sp,#ht_offset] @loads ht
cmp r7,#0 @checks ht == 0
ble end_loops
and r8,r7,#3 @check ht for mul of 2
diff --git a/common/arm/ihevc_inter_pred_chroma_copy_w16out.s b/common/arm/ihevc_inter_pred_chroma_copy_w16out.s
index a927fa7..4997b84 100644
--- a/common/arm/ihevc_inter_pred_chroma_copy_w16out.s
+++ b/common/arm/ihevc_inter_pred_chroma_copy_w16out.s
@@ -92,6 +92,11 @@
@r5 => ht
@r6 => wd
+.equ coeff_offset, 104
+.equ ht_offset, 108
+.equ wd_offset, 112
+
+
.text
.align 4
@@ -105,9 +110,11 @@
ihevc_inter_pred_chroma_copy_w16out_a9q:
stmfd sp!, {r4-r12, r14} @stack stores the values of the arguments
- ldr r12,[sp,#48] @loads wd
+ vpush {d8 - d15}
+
+ ldr r12,[sp,#wd_offset] @loads wd
lsl r12,r12,#1 @2*wd
- ldr r7,[sp,#44] @loads ht
+ ldr r7,[sp,#ht_offset] @loads ht
cmp r7,#0 @ht condition(ht == 0)
ble end_loops @loop
and r8,r7,#3 @check ht for mul of 2
@@ -162,6 +169,7 @@ end_inner_loop_wd_4:
end_loops:
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
@@ -316,6 +324,7 @@ core_loop_wd_8_ht_2:
vst1.16 {d2,d3},[r10],r5 @vst1q_s16(pi2_dst_tmp, tmp)
bgt core_loop_wd_8_ht_2
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
diff --git a/common/arm/ihevc_inter_pred_chroma_horz.s b/common/arm/ihevc_inter_pred_chroma_horz.s
index 4781d3e..c69b417 100644
--- a/common/arm/ihevc_inter_pred_chroma_horz.s
+++ b/common/arm/ihevc_inter_pred_chroma_horz.s
@@ -93,6 +93,10 @@
@r2 => src_strd
@r3 => dst_strd
+.equ coeff_offset, 104
+.equ ht_offset, 108
+.equ wd_offset, 112
+
.text
.align 4
@@ -106,10 +110,11 @@
ihevc_inter_pred_chroma_horz_a9q:
stmfd sp!, {r4-r12, r14} @stack stores the values of the arguments
+ vpush {d8 - d15}
- ldr r4,[sp,#40] @loads pi1_coeff
- ldr r7,[sp,#44] @loads ht
- ldr r10,[sp,#48] @loads wd
+ ldr r4,[sp,#coeff_offset] @loads pi1_coeff
+ ldr r7,[sp,#ht_offset] @loads ht
+ ldr r10,[sp,#wd_offset] @loads wd
vld1.8 {d0},[r4] @coeff = vld1_s8(pi1_coeff)
subs r14,r7,#0 @checks for ht == 0
@@ -672,6 +677,7 @@ inner_loop_4:
end_loops:
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
diff --git a/common/arm/ihevc_inter_pred_chroma_horz_w16out.s b/common/arm/ihevc_inter_pred_chroma_horz_w16out.s
index f95937c..9c498e8 100644
--- a/common/arm/ihevc_inter_pred_chroma_horz_w16out.s
+++ b/common/arm/ihevc_inter_pred_chroma_horz_w16out.s
@@ -90,6 +90,9 @@
@r2 => src_strd
@r3 => dst_strd
+.equ coeff_offset, 104
+.equ ht_offset, 108
+.equ wd_offset, 112
.text
.align 4
@@ -105,10 +108,11 @@
ihevc_inter_pred_chroma_horz_w16out_a9q:
stmfd sp!, {r4-r12, r14} @stack stores the values of the arguments
+ vpush {d8 - d15}
- ldr r4,[sp,#40] @loads pi1_coeff
- ldr r6,[sp,#44] @loads ht
- ldr r10,[sp,#48] @loads wd
+ ldr r4,[sp,#coeff_offset] @loads pi1_coeff
+ ldr r6,[sp,#ht_offset] @loads ht
+ ldr r10,[sp,#wd_offset] @loads wd
vld1.8 {d0},[r4] @coeff = vld1_s8(pi1_coeff)
subs r14,r6,#0 @checks for ht == 0
@@ -362,7 +366,7 @@ epilog_end:
vst1.16 {q10},[r1],r6 @store the result pu1_dst
- ldr r6,[sp,#44] @loads ht
+ ldr r6,[sp,#ht_offset] @loads ht
and r7,r6,#1
@@ -710,6 +714,7 @@ loop_residue:
end_loops:
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
diff --git a/common/arm/ihevc_inter_pred_chroma_vert.s b/common/arm/ihevc_inter_pred_chroma_vert.s
index e786497..8b4e48b 100644
--- a/common/arm/ihevc_inter_pred_chroma_vert.s
+++ b/common/arm/ihevc_inter_pred_chroma_vert.s
@@ -92,6 +92,11 @@
@r1 => *pi2_dst
@r2 => src_strd
@r3 => dst_strd
+
+.equ coeff_offset, 104
+.equ ht_offset, 108
+.equ wd_offset, 112
+
.text
.align 4
@@ -105,11 +110,12 @@
ihevc_inter_pred_chroma_vert_a9q:
stmfd sp!,{r4-r12,r14} @stack stores the values of the arguments
+ vpush {d8 - d15}
- ldr r4,[sp,#44] @loads ht
- ldr r12,[sp,#40] @loads pi1_coeff
+ ldr r4,[sp,#ht_offset] @loads ht
+ ldr r12,[sp,#coeff_offset] @loads pi1_coeff
cmp r4,#0 @checks ht == 0
- ldr r6,[sp,#48] @loads wd
+ ldr r6,[sp,#wd_offset] @loads wd
sub r0,r0,r2 @pu1_src - src_strd
vld1.8 {d0},[r12] @loads pi1_coeff
@@ -377,6 +383,7 @@ epilog:
vqrshrun.s16 d24,q12,#6
vst1.8 {d24},[r7],r3 @stores the loaded value
end_loops:
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
diff --git a/common/arm/ihevc_inter_pred_chroma_vert_w16inp.s b/common/arm/ihevc_inter_pred_chroma_vert_w16inp.s
index ba2ea8e..f9e513a 100644
--- a/common/arm/ihevc_inter_pred_chroma_vert_w16inp.s
+++ b/common/arm/ihevc_inter_pred_chroma_vert_w16inp.s
@@ -92,6 +92,11 @@
@r2 => src_strd
@r3 => dst_strd
+.equ coeff_offset, 104
+.equ ht_offset, 108
+.equ wd_offset, 112
+
+
.text
.align 4
@@ -105,11 +110,12 @@
ihevc_inter_pred_chroma_vert_w16inp_a9q:
stmfd sp!, {r4-r12, r14} @stack stores the values of the arguments
+ vpush {d8 - d15}
- ldr r4, [sp,#40] @loads pi1_coeff
- ldr r6, [sp,#48] @wd
+ ldr r4, [sp,#coeff_offset] @loads pi1_coeff
+ ldr r6, [sp,#wd_offset] @wd
lsl r2,r2,#1 @src_strd = 2* src_strd
- ldr r5,[sp,#44] @loads ht
+ ldr r5,[sp,#ht_offset] @loads ht
vld1.8 {d0},[r4] @loads pi1_coeff
sub r4,r0,r2 @pu1_src - src_strd
vmovl.s8 q0,d0 @long the value
@@ -335,6 +341,7 @@ epilog:
vst1.32 {d24[0]},[r9] @stores the loaded value
end_loops:
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
diff --git a/common/arm/ihevc_inter_pred_chroma_vert_w16inp_w16out.s b/common/arm/ihevc_inter_pred_chroma_vert_w16inp_w16out.s
index 00b3011..0c2ffbd 100644
--- a/common/arm/ihevc_inter_pred_chroma_vert_w16inp_w16out.s
+++ b/common/arm/ihevc_inter_pred_chroma_vert_w16inp_w16out.s
@@ -92,6 +92,11 @@
@r1 => *pi2_dst
@r2 => src_strd
@r3 => dst_strd
+
+.equ coeff_offset, 104
+.equ ht_offset, 108
+.equ wd_offset, 112
+
.text
.align 4
@@ -105,11 +110,12 @@
ihevc_inter_pred_chroma_vert_w16inp_w16out_a9q:
stmfd sp!, {r4-r12, r14} @stack stores the values of the arguments
+ vpush {d8 - d15}
- ldr r4, [sp,#40] @loads pi1_coeff
- ldr r6, [sp,#48] @wd
+ ldr r4, [sp,#coeff_offset] @loads pi1_coeff
+ ldr r6, [sp,#wd_offset] @wd
lsl r2,r2,#1 @src_strd = 2* src_strd
- ldr r5,[sp,#44] @loads ht
+ ldr r5,[sp,#ht_offset] @loads ht
vld1.8 {d0},[r4] @loads pi1_coeff
sub r4,r0,r2 @pu1_src - src_strd
vmovl.s8 q0,d0 @long the value
@@ -322,6 +328,7 @@ epilog:
vst1.32 {d24},[r9] @stores the loaded value
end_loops:
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
diff --git a/common/arm/ihevc_inter_pred_chroma_vert_w16out.s b/common/arm/ihevc_inter_pred_chroma_vert_w16out.s
index 6e6776c..84b0792 100644
--- a/common/arm/ihevc_inter_pred_chroma_vert_w16out.s
+++ b/common/arm/ihevc_inter_pred_chroma_vert_w16out.s
@@ -93,6 +93,10 @@
@r2 => src_strd
@r3 => dst_strd
+.equ coeff_offset, 104
+.equ ht_offset, 108
+.equ wd_offset, 112
+
.text
.align 4
@@ -106,11 +110,12 @@
ihevc_inter_pred_chroma_vert_w16out_a9q:
stmfd sp!,{r4-r12,r14} @stack stores the values of the arguments
+ vpush {d8 - d15}
- ldr r4,[sp,#44] @loads ht
- ldr r12,[sp,#40] @loads pi1_coeff
+ ldr r4,[sp,#ht_offset] @loads ht
+ ldr r12,[sp,#coeff_offset] @loads pi1_coeff
cmp r4,#0 @checks ht == 0
- ldr r6,[sp,#48] @loads wd
+ ldr r6,[sp,#wd_offset] @loads wd
sub r0,r0,r2 @pu1_src - src_strd
vld1.8 {d0},[r12] @loads pi1_coeff
@@ -361,6 +366,7 @@ epilog:
vst1.8 {q12},[r7],r3 @stores the loaded value
end_loops:
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
diff --git a/common/arm/ihevc_inter_pred_filters_luma_horz.s b/common/arm/ihevc_inter_pred_filters_luma_horz.s
index 215f8fd..5559aa7 100644
--- a/common/arm/ihevc_inter_pred_filters_luma_horz.s
+++ b/common/arm/ihevc_inter_pred_filters_luma_horz.s
@@ -103,6 +103,11 @@
@ r5 => ht
@ r6 => wd
+
+.equ coeff_offset, 104
+.equ ht_offset, 108
+.equ wd_offset, 112
+
.text
.align 4
@@ -116,15 +121,15 @@
ihevc_inter_pred_luma_horz_a9q:
stmfd sp!, {r4-r12, r14} @stack stores the values of the arguments
- @str r1,[sp,#-4]
- @ mov r7,#8192
+ vpush {d8 - d15}
+
+
start_loop_count:
- @ ldr r1,[sp,#-4]
- ldr r4,[sp,#40] @loads pi1_coeff
- ldr r8,[sp,#44] @loads ht
- ldr r10,[sp,#48] @loads wd
+ ldr r4,[sp,#coeff_offset] @loads pi1_coeff
+ ldr r8,[sp,#ht_offset] @loads ht
+ ldr r10,[sp,#wd_offset] @loads wd
vld1.8 {d0},[r4] @coeff = vld1_s8(pi1_coeff)
mov r11,#1
@@ -262,7 +267,8 @@ end_inner_loop_8:
- ldr r10,[sp,#48] @loads wd
+ ldr r10,[sp,#wd_offset] @loads wd
+
cmp r10,#12
beq outer_loop4_residual
@@ -270,6 +276,7 @@ end_inner_loop_8:
end_loops:
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
@@ -417,7 +424,7 @@ epilog_16:
ldr r7, [sp], #4
ldr r0, [sp], #4
- ldr r10,[sp,#48]
+ ldr r10,[sp,#wd_offset]
cmp r10,#24
beq outer_loop8_residual
@@ -426,6 +433,7 @@ epilog_16:
end_loops1:
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
@@ -527,6 +535,7 @@ end_inner_loop_4:
@subs r7,r7,#1
@ bgt start_loop_count
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
diff --git a/common/arm/ihevc_inter_pred_filters_luma_vert.s b/common/arm/ihevc_inter_pred_filters_luma_vert.s
index f51d68c..3d9ab1c 100644
--- a/common/arm/ihevc_inter_pred_filters_luma_vert.s
+++ b/common/arm/ihevc_inter_pred_filters_luma_vert.s
@@ -103,6 +103,11 @@
@ r12 => *pi1_coeff
@ r5 => ht
@ r3 => wd
+
+.equ coeff_offset, 104
+.equ ht_offset, 108
+.equ wd_offset, 112
+
.text
.align 4
.syntax unified
@@ -116,15 +121,16 @@
ihevc_inter_pred_luma_vert_a9q:
stmfd sp!, {r4-r12, r14} @stack stores the values of the arguments
+ vpush {d8 - d15}
- ldr r12,[sp,#40] @load pi1_coeff
+ ldr r12,[sp,#coeff_offset] @load pi1_coeff
mov r6,r3
- ldr r5,[sp,#48] @load wd
+ ldr r5,[sp,#wd_offset] @load wd
vld1.u8 {d0},[r12] @coeff = vld1_s8(pi1_coeff)
sub r12,r2,r2,lsl #2 @src_ctrd & pi1_coeff
vabs.s8 d0,d0 @vabs_s8(coeff)
add r0,r0,r12 @r0->pu1_src r12->pi1_coeff
- ldr r3,[sp,#44] @load ht
+ ldr r3,[sp,#ht_offset] @load ht
subs r7,r3,#0 @r3->ht
@ble end_loops @end loop jump
vdup.u8 d22,d0[0] @coeffabs_0 = vdup_lane_u8(coeffabs, 0)@
@@ -407,7 +413,8 @@ end_loops:
ldr r1, [sp], #4
ldr r0, [sp], #4
- ldmfdeq sp!,{r4-r12,r15} @reload the registers from sp
+ beq end1
+
mov r5, #4
add r0, r0, #8
add r1, r1, #8
@@ -491,6 +498,8 @@ end_inner_loop_wd_4:
add r0,r0,r8
bgt outer_loop_wd_4
+end1:
+ vpop {d8 - d15}
ldmfd sp!, {r4-r12, r15} @reload the registers from sp
@@ -564,15 +573,16 @@ end_inner_loop_wd_4:
ihevc_inter_pred_luma_vert_w16out_a9q:
stmfd sp!, {r4-r12, r14} @stack stores the values of the arguments
+ vpush {d8 - d15}
- ldr r12,[sp,#40] @load pi1_coeff
+ ldr r12,[sp,#coeff_offset] @load pi1_coeff
mov r6,r3
- ldr r5,[sp,#48] @load wd
+ ldr r5,[sp,#wd_offset] @load wd
vld1.u8 {d0},[r12] @coeff = vld1_s8(pi1_coeff)
sub r12,r2,r2,lsl #2 @src_ctrd & pi1_coeff
vabs.s8 d0,d0 @vabs_s8(coeff)
add r0,r0,r12 @r0->pu1_src r12->pi1_coeff
- ldr r3,[sp,#44] @load ht
+ ldr r3,[sp,#ht_offset] @load ht
subs r7,r3,#0 @r3->ht
@ble end_loops_16out @end loop jump
vdup.u8 d22,d0[0] @coeffabs_0 = vdup_lane_u8(coeffabs, 0)@
@@ -848,7 +858,8 @@ end_loops_16out:
ldr r1, [sp], #4
ldr r0, [sp], #4
- ldmfdeq sp!,{r4-r12,r15} @reload the registers from sp
+ beq end2
+
mov r5, #4
add r0, r0, #8
add r1, r1, #16
@@ -934,7 +945,8 @@ end_inner_loop_wd_4_16out:
add r1,r1,r9,lsl #1
add r0,r0,r8
bgt outer_loop_wd_4_16out
-
+end2:
+ vpop {d8 - d15}
ldmfd sp!, {r4-r12, r15} @reload the registers from sp
diff --git a/common/arm/ihevc_inter_pred_filters_luma_vert_w16inp.s b/common/arm/ihevc_inter_pred_filters_luma_vert_w16inp.s
index 4fbc5d1..9726710 100644
--- a/common/arm/ihevc_inter_pred_filters_luma_vert_w16inp.s
+++ b/common/arm/ihevc_inter_pred_filters_luma_vert_w16inp.s
@@ -94,6 +94,10 @@
@ word32 ht,
@ word32 wd )
+.equ coeff_offset, 104
+.equ ht_offset, 108
+.equ wd_offset, 112
+
.text
.align 4
@@ -107,16 +111,17 @@
ihevc_inter_pred_luma_vert_w16inp_a9q:
stmfd sp!, {r4-r12, r14} @stack stores the values of the arguments
+ vpush {d8 - d15}
- ldr r12,[sp,#40] @load pi1_coeff
+ ldr r12,[sp,#coeff_offset] @load pi1_coeff
mov r6,r3
- ldr r5,[sp,#48] @load wd
+ ldr r5,[sp,#wd_offset] @load wd
vld1.8 {d0},[r12] @coeff = vld1_s8(pi1_coeff)
mov r2, r2, lsl #1
sub r12,r2,r2,lsl #2 @src_ctrd & pi1_coeff
@vabs.s8 d0,d0 @vabs_s8(coeff)
add r0,r0,r12 @r0->pu1_src r12->pi1_coeff
- ldr r3,[sp,#44] @load ht
+ ldr r3,[sp,#ht_offset] @load ht
subs r7,r3,#0 @r3->ht
@ble end_loops @end loop jump
vmovl.s8 q0,d0
@@ -370,6 +375,7 @@ epilog_end:
end_loops:
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
diff --git a/common/arm/ihevc_inter_pred_luma_copy.s b/common/arm/ihevc_inter_pred_luma_copy.s
index 8a61369..e4f5573 100644
--- a/common/arm/ihevc_inter_pred_luma_copy.s
+++ b/common/arm/ihevc_inter_pred_luma_copy.s
@@ -71,6 +71,10 @@
@ r7 => ht
@ r12 => wd
+.equ coeff_offset, 104
+.equ ht_offset, 108
+.equ wd_offset, 112
+
.text
.align 4
@@ -83,8 +87,9 @@
ihevc_inter_pred_luma_copy_a9q:
stmfd sp!, {r4-r12, r14} @stack stores the values of the arguments
- ldr r12,[sp,#48] @loads wd
- ldr r7,[sp,#44] @loads ht
+ vpush {d8 - d15}
+ ldr r12,[sp,#wd_offset] @loads wd
+ ldr r7,[sp,#ht_offset] @loads ht
cmp r7,#0 @checks ht == 0
ble end_loops
tst r12,#15 @checks wd for multiples for 4 & 8
@@ -121,6 +126,7 @@ end_inner_loop_wd_4:
bgt outer_loop_wd_4
end_loops:
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
@@ -151,6 +157,7 @@ end_inner_loop_wd_8:
sub r1,r6,r11 @pu1_dst = pu1_dst_tmp
bgt outer_loop_wd_8
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
core_loop_wd_16:
@@ -180,6 +187,7 @@ end_inner_loop_wd_16:
sub r1,r6,r11 @pu1_dst = pu1_dst_tmp
bgt outer_loop_wd_16
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
diff --git a/common/arm/ihevc_inter_pred_luma_copy_w16out.s b/common/arm/ihevc_inter_pred_luma_copy_w16out.s
index 771bcb3..84dbbad 100644
--- a/common/arm/ihevc_inter_pred_luma_copy_w16out.s
+++ b/common/arm/ihevc_inter_pred_luma_copy_w16out.s
@@ -72,6 +72,10 @@
@ r7 => ht
@ r12 => wd
+.equ coeff_offset, 104
+.equ ht_offset, 108
+.equ wd_offset, 112
+
.text
.align 4
@@ -85,8 +89,9 @@
ihevc_inter_pred_luma_copy_w16out_a9q:
stmfd sp!, {r4-r12, r14} @stack stores the values of the arguments
- ldr r12,[sp,#48] @loads wd
- ldr r7,[sp,#44] @loads ht
+ vpush {d8 - d15}
+ ldr r12,[sp,#wd_offset] @loads wd
+ ldr r7,[sp,#ht_offset] @loads ht
cmp r7,#0 @ht condition(ht == 0)
ble end_loops @loop
tst r12,#7 @conditional check for wd (multiples)
@@ -129,6 +134,7 @@ end_inner_loop_wd_4:
bgt outer_loop_wd_4
end_loops:
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
@@ -242,6 +248,7 @@ epilog_end:
vst1.16 {d6,d7},[r10],r5 @vst1q_s16(pi2_dst_tmp, tmp)
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
diff --git a/common/arm/ihevc_inter_pred_luma_horz_w16out.s b/common/arm/ihevc_inter_pred_luma_horz_w16out.s
index e8800e0..a60bb08 100644
--- a/common/arm/ihevc_inter_pred_luma_horz_w16out.s
+++ b/common/arm/ihevc_inter_pred_luma_horz_w16out.s
@@ -107,6 +107,11 @@
@r11 - #1
@r12 - src_ptr1
@r14 - loop_counter
+
+.equ coeff_offset, 104
+.equ ht_offset, 108
+.equ wd_offset, 112
+
.text
.align 4
.syntax unified
@@ -122,16 +127,16 @@ ihevc_inter_pred_luma_horz_w16out_a9q:
bic r14, #1 @ clearing bit[0], so that it goes back to mode
stmfd sp!, {r4-r12, r14} @stack stores the values of the arguments
- ldr r4,[sp,#40] @loads pi1_coeff
- ldr r7,[sp,#44] @loads ht
+ vpush {d8 - d15}
+ ldr r4,[sp,#coeff_offset] @loads pi1_coeff
+ ldr r7,[sp,#ht_offset] @loads ht
vld1.8 {d0},[r4] @coeff = vld1_s8(pi1_coeff)
sub r14,r7,#0 @checks for ht == 0
vabs.s8 d2,d0 @vabs_s8(coeff)
mov r11,#1
- @ble end_loops
- ldr r10,[sp,#48] @loads wd
+ ldr r10,[sp,#wd_offset] @loads wd
vdup.8 d24,d2[0] @coeffabs_0 = vdup_lane_u8(coeffabs, 0)
sub r12,r0,#3 @pu1_src - 3
vdup.8 d25,d2[1] @coeffabs_1 = vdup_lane_u8(coeffabs, 1)
@@ -274,11 +279,10 @@ end_inner_loop_4:
height_residue_4:
- ldr r7,[sp,#44] @loads ht
+ ldr r7,[sp,#ht_offset] @loads ht
and r7,r7,#1 @calculating ht_residue ht_residue = (ht & 1)
cmp r7,#0
- @beq end_loops
- ldmfdeq sp!,{r4-r12,r15} @reload the registers from sp
+ beq end_loops
outer_loop_height_residue_4:
@@ -331,7 +335,7 @@ end_inner_loop_height_residue_4:
add r12,r12,r9 @increment the input pointer src_strd-wd
add r1,r1,r8 @increment the output pointer dst_strd-wd
bgt outer_loop_height_residue_4
-
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
outer_loop8_residual:
@@ -427,18 +431,18 @@ end_inner_loop_8:
- ldr r10,[sp,#48] @loads wd
+ ldr r10,[sp,#wd_offset] @loads wd
cmp r10,#12
beq outer_loop4_residual
- ldr r7,[sp,#44] @loads ht
+ ldr r7,[sp,#ht_offset] @loads ht
and r7,r7,#1
cmp r7,#1
beq height_residue_4
-@end_loops
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
@@ -452,7 +456,6 @@ outer_loop_16:
add r4,r12,r2 @pu1_src + src_strd
and r0, r12, #31
sub r5,r10,#0 @checks wd
- @ble end_loops1
pld [r12, r2, lsl #1]
vld1.u32 {q0},[r12],r11 @vector load pu1_src
pld [r4, r2, lsl #1]
@@ -580,17 +583,17 @@ epilog_16:
ldr r7, [sp], #4
ldr r0, [sp], #4
- ldr r10,[sp,#48]
+ ldr r10,[sp,#wd_offset]
cmp r10,#24
beq outer_loop8_residual
add r1,r6,r8,lsl #1
- ldr r7,[sp,#44] @loads ht
+ ldr r7,[sp,#ht_offset] @loads ht
and r7,r7,#1
cmp r7,#1
beq height_residue_4
-end_loops1:
-
+end_loops:
+ vpop {d8 - d15}
ldmfd sp!,{r4-r12,r15} @reload the registers from sp
diff --git a/common/arm/ihevc_inter_pred_luma_vert_w16inp_w16out.s b/common/arm/ihevc_inter_pred_luma_vert_w16inp_w16out.s
index c6716fe..6e0f1ed 100644
--- a/common/arm/ihevc_inter_pred_luma_vert_w16inp_w16out.s
+++ b/common/arm/ihevc_inter_pred_luma_vert_w16inp_w16out.s
@@ -102,6 +102,10 @@
@ r5 => ht
@ r6 => wd
+.equ coeff_offset, 104
+.equ ht_offset, 108
+.equ wd_offset, 112
+
.text
.align 4
@@ -115,16 +119,17 @@
ihevc_inter_pred_luma_vert_w16inp_w16out_a9q:
stmfd sp!, {r4-r12, r14} @stack stores the values of the arguments
+ vpush {d8 - d15}
- ldr r12,[sp,#40] @load pi1_coeff
+ ldr r12,[sp,#coeff_offset] @load pi1_coeff
mov r6,r3,lsl #1
- ldr r5,[sp,#48] @load wd
+ ldr r5,[sp,#wd_offset] @load wd
vld1.8 {d0},[r12] @coeff = vld1_s8(pi1_coeff)
mov r2, r2, lsl #1
sub r12,r2,r2,lsl #2 @src_ctrd & pi1_coeff
@vabs.s8 d0,d0 @vabs_s8(coeff)
add r0,r0,r12 @r0->pu1_src r12->pi1_coeff
- ldr r3,[sp,#44] @load ht
+ ldr r3,[sp,#ht_offset] @load ht
subs r7,r3,#0 @r3->ht
@ble end_loops @end loop jump
vmovl.s8 q0,d0
@@ -393,6 +398,7 @@ epilog_end: