-
Notifications
You must be signed in to change notification settings - Fork 252
/
itx16_avx512.asm
6056 lines (5921 loc) · 228 KB
/
itx16_avx512.asm
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
; Copyright © 2022-2023, VideoLAN and dav1d authors
; Copyright © 2022-2023, Two Orioles, LLC
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;
; 1. Redistributions of source code must retain the above copyright notice, this
; list of conditions and the following disclaimer.
;
; 2. Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
; ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%include "config.asm"
%include "ext/x86/x86inc.asm"
%if ARCH_X86_64
SECTION_RODATA 64
idct8x8p: db 0, 1, 4, 5, 2, 3, 6, 7, 16, 17, 20, 21, 18, 19, 22, 23
db 8, 9, 12, 13, 10, 11, 14, 15, 24, 25, 28, 29, 26, 27, 30, 31
db 32, 33, 36, 37, 34, 35, 38, 39, 48, 49, 52, 53, 50, 51, 54, 55
db 40, 41, 44, 45, 42, 43, 46, 47, 56, 57, 60, 61, 58, 59, 62, 63
idtx8x8p: db 0, 1, 32, 33, 2, 3, 34, 35, 4, 5, 36, 37, 6, 7, 38, 39
db 8, 9, 40, 41, 10, 11, 42, 43, 12, 13, 44, 45, 14, 15, 46, 47
db 16, 17, 48, 49, 18, 19, 50, 51, 20, 21, 52, 53, 22, 23, 54, 55
db 24, 25, 56, 57, 26, 27, 58, 59, 28, 29, 60, 61, 30, 31, 62, 63
idct8x16p: db 54, 55, 2, 3, 22, 23, 34, 35, 38, 39, 18, 19, 6, 7, 50, 51
db 62, 63, 10, 11, 30, 31, 42, 43, 46, 47, 26, 27, 14, 15, 58, 59
db 52, 53, 4, 5, 20, 21, 36, 37, 32, 33, 0, 1, 48, 49, 16, 17
db 60, 61, 12, 13, 28, 29, 44, 45, 40, 41, 8, 9, 56, 57, 24, 25
iadst8x16p: db 0, 1, 54, 55, 48, 49, 6, 7, 16, 17, 38, 39, 32, 33, 22, 23
db 8, 9, 62, 63, 56, 57, 14, 15, 24, 25, 46, 47, 40, 41, 30, 31
db 4, 5, 50, 51, 52, 53, 2, 3, 20, 21, 34, 35, 36, 37, 18, 19
db 12, 13, 58, 59, 60, 61, 10, 11, 28, 29, 42, 43, 44, 45, 26, 27
permA: db 0, 1, 0, 8, 4, 5, 1, 9, 8, 9, 4, 12, 12, 13, 5, 13
db 16, 17, 16, 24, 20, 21, 17, 25, 24, 25, 20, 28, 28, 29, 21, 29
db 2, 3, 2, 10, 6, 7, 3, 11, 10, 11, 6, 14, 14, 15, 7, 15
db 18, 19, 18, 26, 22, 23, 19, 27, 26, 27, 22, 30, 30, 31, 23, 31
permB: db 4, 2, 1, 8, 0, 0, 1, 0, 12, 3, 3, 10, 8, 1, 3, 2
db 5, 10, 5, 12, 1, 8, 5, 4, 13, 11, 7, 14, 9, 9, 7, 6
db 6, 6, 13, 4, 2, 4, 4, 5, 14, 7, 15, 6, 10, 5, 6, 7
db 7, 14, 9, 0, 3, 12, 0, 1, 15, 15, 11, 2, 11, 13, 2, 3
permC: db 0, 9, 0, 0, 0, 1, 4, 4, 2, 11, 2, 2, 2, 3, 6, 6
db 1, 8, 1, 8, 4, 5, 5, 12, 3, 10, 3, 10, 6, 7, 7, 14
db 9, 1, 8, 1, 1, 0, 12, 5, 11, 3, 10, 3, 3, 2, 14, 7
db 8, 0, 9, 9, 5, 4, 13, 13, 10, 2, 11, 11, 7, 6, 15, 15
idct8x32p: db 0, 1, 4, 5, 16, 17, 20, 21, 32, 33, 36, 37, 48, 49, 52, 53
db 8, 9, 12, 13, 24, 25, 28, 29, 40, 41, 44, 45, 56, 57, 60, 61
db 2, 3, 6, 7, 18, 19, 22, 23, 34, 35, 38, 39, 50, 51, 54, 55
db 10, 11, 14, 15, 26, 27, 30, 31, 42, 43, 46, 47, 58, 59, 62, 63
idct32x8p: db 2, 18, 0, 16, 3, 19, 1, 17, 10, 26, 8, 24, 11, 27, 9, 25
db 34, 50, 32, 48, 35, 51, 33, 49, 42, 58, 40, 56, 43, 59, 41, 57
db 6, 22, 4, 20, 7, 23, 5, 21, 14, 30, 12, 28, 15, 31, 13, 29
db 38, 54, 36, 52, 39, 55, 37, 53, 46, 62, 44, 60, 47, 63, 45, 61
idtx32x8p: db 0, 8, 16, 24, 4, 12, 20, 28, 2, 10, 18, 26, 6, 14, 22, 30
db 32, 40, 48, 56, 36, 44, 52, 60, 34, 42, 50, 58, 38, 46, 54, 62
db 1, 9, 17, 25, 5, 13, 21, 29, 3, 11, 19, 27, 7, 15, 23, 31
db 33, 41, 49, 57, 37, 45, 53, 61, 35, 43, 51, 59, 39, 47, 55, 63
pw_2048_m2048: times 16 dw 2048
pw_m2048_2048: times 16 dw -2048
pw_2048: times 16 dw 2048
; flags: 0 = ++, 1 = +-, 2 = -+, 3 = ++-, 4=--
%macro COEF_PAIR 2-3 0 ; a, b, flags
%if %3 == 1
pd_%1_m%2: dd %1, %1, -%2, -%2
%define pd_%1 (pd_%1_m%2 + 4*0)
%define pd_m%2 (pd_%1_m%2 + 4*2)
%elif %3 == 2
pd_m%1_%2: dd -%1, -%1, %2, %2
%define pd_m%1 (pd_m%1_%2 + 4*0)
%define pd_%2 (pd_m%1_%2 + 4*2)
%elif %3 == 4
pd_m%1_m%2: dd -%1, -%1, -%2, -%2
%define pd_m%1 (pd_m%1_m%2 + 4*0)
%define pd_m%2 (pd_m%1_m%2 + 4*2)
%else
pd_%1_%2: dd %1, %1, %2, %2
%define pd_%1 (pd_%1_%2 + 4*0)
%define pd_%2 (pd_%1_%2 + 4*2)
%if %3 == 3
%define pd_%2_m%2 pd_%2
dd -%2, -%2
%endif
%endif
%endmacro
COEF_PAIR 101, 501
COEF_PAIR 201, 601, 1
COEF_PAIR 201, 995
COEF_PAIR 401, 1189, 1
COEF_PAIR 401, 1931
COEF_PAIR 401, 3920
COEF_PAIR 401, 4076
COEF_PAIR 700, 301, 4
COEF_PAIR 799, 2276, 1
COEF_PAIR 799, 3406
COEF_PAIR 799, 4017
COEF_PAIR 1380, 601
COEF_PAIR 1751, 2440
COEF_PAIR 2598, 1189
COEF_PAIR 2598, 1931, 2
COEF_PAIR 2598, 3612
COEF_PAIR 2751, 2106
COEF_PAIR 2896, 1567, 3
COEF_PAIR 2896, 3784, 3
COEF_PAIR 3035, 3513
COEF_PAIR 3166, 1931
COEF_PAIR 3166, 3612
COEF_PAIR 3166, 3920
COEF_PAIR 3703, 3290
COEF_PAIR 3857, 4052
COEF_PAIR 4017, 2276
COEF_PAIR 4017, 3406
COEF_PAIR 4036, 4085
COEF_PAIR 4076, 1189
COEF_PAIR 4076, 3612
COEF_PAIR 4076, 3920
COEF_PAIR 4091, 3973
COEF_PAIR 4091, 4052
COEF_PAIR 4095, 4065
pb_32: times 4 db 32
pw_5: times 2 dw 5
pw_4096: times 2 dw 4096
pw_8192: times 2 dw 8192
pw_1697x16: times 2 dw 1697*16
pw_2896x8: times 2 dw 2896*8
pixel_10bpc_max: times 2 dw 0x03ff
dconly_10bpc: times 2 dw 0x7c00
clip_18b_min: dd -0x20000
clip_18b_max: dd 0x1ffff
pd_1: dd 1
pd_2: dd 2
pd_1448: dd 1448
pd_2048: dd 2048
pd_3071: dd 3071 ; 1024 + 2048 - 1
pd_3072: dd 3072 ; 1024 + 2048
pd_5119: dd 5119 ; 1024 + 4096 - 1
pd_5120: dd 5120 ; 1024 + 4096
pd_5793: dd 5793
cextern dup16_perm
cextern int8_permA
cextern idct64_mul_16bpc
cextern idct_8x8_internal_8bpc_avx512icl.main
cextern iadst_8x8_internal_8bpc_avx512icl.main_pass2
cextern idct_8x16_internal_8bpc_avx512icl.main
cextern idct_8x16_internal_8bpc_avx512icl.main2
cextern idct_8x16_internal_8bpc_avx512icl.main_fast
cextern idct_8x16_internal_8bpc_avx512icl.main_fast2
cextern iadst_8x16_internal_8bpc_avx512icl.main2
cextern idct_16x8_internal_8bpc_avx512icl.main
cextern iadst_16x8_internal_8bpc_avx512icl.main_pass2
cextern idct_16x16_internal_8bpc_avx512icl.main
cextern idct_16x16_internal_8bpc_avx512icl.main2
cextern idct_16x16_internal_8bpc_avx512icl.main_fast
cextern idct_16x16_internal_8bpc_avx512icl.main_fast2
cextern iadst_16x16_internal_8bpc_avx512icl.main_pass2b
cextern inv_txfm_add_dct_dct_8x32_8bpc_avx512icl.main
cextern inv_txfm_add_dct_dct_8x32_8bpc_avx512icl.main_fast
cextern inv_txfm_add_dct_dct_8x32_8bpc_avx512icl.main_fast2
cextern inv_txfm_add_dct_dct_8x32_8bpc_avx512icl.main_end
cextern inv_txfm_add_dct_dct_16x32_8bpc_avx512icl.main_oddhalf
cextern inv_txfm_add_dct_dct_16x32_8bpc_avx512icl.main_oddhalf_fast
cextern inv_txfm_add_dct_dct_16x32_8bpc_avx512icl.main_oddhalf_fast2
cextern inv_txfm_add_dct_dct_32x8_8bpc_avx512icl.main
cextern inv_txfm_add_dct_dct_32x16_8bpc_avx512icl.main_oddhalf
cextern inv_txfm_add_dct_dct_32x16_8bpc_avx512icl.main_oddhalf_fast
cextern inv_txfm_add_dct_dct_32x16_8bpc_avx512icl.main_oddhalf_fast2
cextern inv_txfm_add_dct_dct_32x16_8bpc_avx512icl.main_oddhalf_fast3
cextern inv_txfm_add_dct_dct_32x32_8bpc_avx512icl.main_oddhalf
cextern inv_txfm_add_dct_dct_32x32_8bpc_avx512icl.main_oddhalf_fast
cextern inv_txfm_add_dct_dct_32x32_8bpc_avx512icl.main_oddhalf_fast2
cextern inv_txfm_add_dct_dct_32x32_8bpc_avx512icl.main_oddhalf_fast3
cextern inv_txfm_add_dct_dct_16x64_8bpc_avx512icl.main_oddhalf
cextern inv_txfm_add_dct_dct_16x64_8bpc_avx512icl.main_oddhalf_fast
cextern inv_txfm_add_dct_dct_32x64_8bpc_avx512icl.main_part1
cextern inv_txfm_add_dct_dct_32x64_8bpc_avx512icl.main_part1_fast
cextern inv_txfm_add_dct_dct_32x64_8bpc_avx512icl.main_part1_fast2
cextern inv_txfm_add_dct_dct_32x64_8bpc_avx512icl.main_part2
SECTION .text
%define o_base (pw_2048+4*128)
%define o_base_8bpc (int8_permA+64*18)
%define o(x) (r5 - o_base + (x))
%define m(x) mangle(private_prefix %+ _ %+ x %+ SUFFIX)
INIT_ZMM avx512icl
; dst1 = (src1 * coef1 - src2 * coef2 + rnd) >> 12
; dst2 = (src1 * coef2 + src2 * coef1 + rnd) >> 12
; flags: 1 = inv_dst1, 2 = inv_dst2
; skip round/shift if rnd is not a number
%macro ITX_MULSUB_2D 8-9 0 ; dst/src[1-2], tmp[1-3], rnd, coef[1-2], flags
%if %8 < 32
pmulld m%4, m%1, m%8
pmulld m%3, m%2, m%8
%else
%if %8 < 4096
vpbroadcastd m%3, [o(pd_%8)]
%else
vbroadcasti32x4 m%3, [o(pd_%8)]
%endif
pmulld m%4, m%1, m%3
pmulld m%3, m%2
%endif
%if %7 < 32
pmulld m%1, m%7
pmulld m%2, m%7
%else
%if %7 < 4096
vpbroadcastd m%5, [o(pd_%7)]
%else
vbroadcasti32x4 m%5, [o(pd_%7)]
%endif
pmulld m%1, m%5
pmulld m%2, m%5
%endif
%if %9 & 2
psubd m%4, m%6, m%4
psubd m%2, m%4, m%2
%else
%ifnum %6
paddd m%4, m%6
%endif
paddd m%2, m%4
%endif
%ifnum %6
paddd m%1, m%6
%endif
%if %9 & 1
psubd m%1, m%3, m%1
%else
psubd m%1, m%3
%endif
%ifnum %6
psrad m%2, 12
psrad m%1, 12
%endif
%endmacro
%macro INV_TXFM_FN 4 ; type1, type2, eob_offset, size
cglobal inv_txfm_add_%1_%2_%4_10bpc, 4, 7, 0, dst, stride, c, eob, tx2
%define %%p1 m(i%1_%4_internal_10bpc)
lea r5, [o_base]
; Jump to the 1st txfm function if we're not taking the fast path, which
; in turn performs an indirect jump to the 2nd txfm function.
lea tx2q, [m(i%2_%4_internal_10bpc).pass2]
%ifidn %1_%2, dct_dct
test eobd, eobd
jnz %%p1
%else
%if %3
add eobd, %3
%endif
; jump to the 1st txfm function unless it's located directly after this
times ((%%end - %%p1) >> 31) & 1 jmp %%p1
ALIGN function_align
%%end:
%endif
%endmacro
%macro INV_TXFM_8X8_FN 2-3 0 ; type1, type2, eob_offset
INV_TXFM_FN %1, %2, %3, 8x8
%ifidn %1_%2, dct_dct
imul r6d, [cq], 181
mov [cq], eobd ; 0
or r3d, 8
.dconly:
add r6d, 384
sar r6d, 9
.dconly2:
vpbroadcastd ym2, [o(dconly_10bpc)]
imul r6d, 181
add r6d, 2176
sar r6d, 12
vpbroadcastw ym1, r6d
paddsw ym1, ym2
.dconly_loop:
mova xm0, [dstq+strideq*0]
vinserti32x4 ym0, [dstq+strideq*1], 1
paddsw ym0, ym1
psubusw ym0, ym2
mova [dstq+strideq*0], xm0
vextracti32x4 [dstq+strideq*1], ym0, 1
lea dstq, [dstq+strideq*2]
sub r3d, 2
jg .dconly_loop
RET
%endif
%endmacro
INV_TXFM_8X8_FN dct, dct
INV_TXFM_8X8_FN dct, adst
INV_TXFM_8X8_FN dct, flipadst
INV_TXFM_8X8_FN dct, identity
cglobal idct_8x8_internal_10bpc, 0, 7, 16, dst, stride, c, eob, tx2
call .load
vpermi2q m1, m0, m2 ; 1 5
vpermi2q m3, m6, m4 ; 7 3
vpermt2q m0, m5, m4 ; 0 2
vpermt2q m2, m5, m6 ; 4 6
call .main
call .main_end
mova m4, [o(idct8x8p)]
packssdw m0, m2 ; 0 1 4 5
packssdw m1, m3 ; 3 2 7 6
vpermb m0, m4, m0
vprolq m1, 32
vpermb m2, m4, m1
punpckhdq m1, m0, m2
punpckldq m0, m2
jmp tx2q
.pass2:
lea r5, [o_base_8bpc]
vextracti32x8 ym2, m0, 1
vextracti32x8 ym3, m1, 1
call m(idct_8x8_internal_8bpc).main
mova m10, [permC]
vpbroadcastd m12, [pw_2048]
.end:
vpermt2q m0, m10, m1
vpermt2q m2, m10, m3
.end2:
vpbroadcastd m11, [pixel_10bpc_max]
lea r6, [strideq*3]
pxor m10, m10
pmulhrsw m8, m12, m0
call .write_8x4_start
pmulhrsw m8, m12, m2
.write_8x4:
lea dstq, [dstq+strideq*4]
add cq, 64*2
.write_8x4_start:
mova xm9, [dstq+strideq*0]
vinserti32x4 ym9, [dstq+strideq*1], 1
vinserti32x4 m9, [dstq+strideq*2], 2
vinserti32x4 m9, [dstq+r6 ], 3
mova [cq+64*0], m10
mova [cq+64*1], m10
paddw m9, m8
pmaxsw m9, m10
pminsw m9, m11
mova [dstq+strideq*0], xm9
vextracti32x4 [dstq+strideq*1], ym9, 1
vextracti32x4 [dstq+strideq*2], m9, 2
vextracti32x4 [dstq+r6 ], m9, 3
ret
ALIGN function_align
.load:
mova m0, [cq+64*0] ; 0 1
mova m4, [cq+64*1] ; 2 3
mova m1, [o(permB)]
mova m2, [cq+64*2] ; 4 5
mova m6, [cq+64*3] ; 6 7
vpbroadcastd m13, [o(pd_2048)]
vpbroadcastd m14, [o(clip_18b_min)]
vpbroadcastd m15, [o(clip_18b_max)]
psrlq m5, m1, 32
vpbroadcastd m12, [o(pd_2896)]
mova m3, m1
vpbroadcastd m11, [o(pd_1)]
ret
ALIGN function_align
.main_fast: ; bottom half is zero
vbroadcasti32x4 m3, [o(pd_4017_3406)]
vbroadcasti32x4 m8, [o(pd_799_m2276)]
vbroadcasti32x4 m2, [o(pd_2896_3784)]
vbroadcasti32x4 m9, [o(pd_2896_1567)]
pmulld m3, m1 ; t4a t5a
pmulld m1, m8 ; t7a t6a
pmulld m2, m0 ; t0 t3
pmulld m0, m9 ; t1 t2
jmp .main2
.main:
ITX_MULSUB_2D 1, 3, 8, 9, 10, _, 799_3406, 4017_2276
ITX_MULSUB_2D 0, 2, 8, 9, 10, _, 2896_1567, 2896_3784
.main2:
REPX {paddd x, m13}, m1, m3, m0, m2
REPX {psrad x, 12 }, m1, m3, m0, m2
punpcklqdq m8, m1, m3 ; t4a t7a
punpckhqdq m1, m3 ; t5a t6a
psubd m3, m8, m1 ; t5a t6a
paddd m8, m1 ; t4 t7
pmaxsd m3, m14
punpckhqdq m1, m2, m0 ; t3 t2
pminsd m3, m15
punpcklqdq m2, m0 ; t0 t1
pmulld m3, m12
paddd m0, m2, m1 ; dct4 out0 out1
psubd m2, m1 ; dct4 out3 out2
REPX {pmaxsd x, m14}, m8, m0, m2
REPX {pminsd x, m15}, m8, m0, m2
.main3:
pshufd m1, m3, q1032
paddd m3, m13
psubd m9, m3, m1
paddd m3, m1
psrad m9, 12
psrad m3, 12
punpckhqdq m1, m8, m3 ; t7 t6
shufpd m8, m9, 0xaa ; t4 t5
ret
.main_end:
paddd m0, m11
paddd m2, m11
psubd m3, m0, m1 ; out7 out6
paddd m0, m1 ; out0 out1
paddd m1, m2, m8 ; out3 out2
psubd m2, m8 ; out4 out5
REPX {vpsravd x, m11}, m0, m2, m3, m1
ret
INV_TXFM_8X8_FN adst, dct
INV_TXFM_8X8_FN adst, flipadst
INV_TXFM_8X8_FN adst, identity
INV_TXFM_8X8_FN adst, adst
cglobal iadst_8x8_internal_10bpc, 0, 7, 16, dst, stride, c, eob, tx2
call m(idct_8x8_internal_10bpc).load
vpermi2q m1, m6, m2 ; 7 5
vpermi2q m3, m4, m0 ; 3 1
vpermt2q m0, m5, m4 ; 0 2
vpermt2q m2, m5, m6 ; 4 6
call .main
punpckldq m1, m2, m4 ; out4 out6
punpckhdq m2, m0 ; -out5 -out7
punpckldq m0, m3 ; out0 out2
punpckhdq m4, m3 ; -out1 -out3
paddd m1, m11
psubd m3, m11, m2
paddd m0, m11
psubd m4, m11, m4
.pass1_end:
REPX {psrad x, 1}, m1, m0, m3, m4
packssdw m0, m1 ; 0 2 4 6
packssdw m4, m3 ; 1 3 5 7
psrlq m1, [o(permB)], 8
punpckhwd m3, m0, m4
punpcklwd m0, m4
psrlq m2, m1, 32
vpermi2q m1, m0, m3
vpermt2q m0, m2, m3
jmp tx2q
.pass2:
call .main_pass2
movu m10, [permC+2]
vbroadcasti32x8 m12, [pw_2048_m2048+16]
jmp m(idct_8x8_internal_10bpc).end
.main_pass2:
vextracti32x8 ym2, m0, 1
vextracti32x8 ym3, m1, 1
lea r5, [o_base_8bpc]
pshufd ym4, ym0, q1032
pshufd ym5, ym1, q1032
jmp m(iadst_8x8_internal_8bpc).main_pass2
ALIGN function_align
.main:
ITX_MULSUB_2D 1, 0, 4, 5, 6, 13, 401_1931, 4076_3612
ITX_MULSUB_2D 3, 2, 4, 5, 6, 13, 3166_3920, 2598_1189
psubd m4, m0, m2 ; t4 t6
paddd m0, m2 ; t0 t2
psubd m2, m1, m3 ; t5 t7
paddd m1, m3 ; t1 t3
REPX {pmaxsd x, m14}, m4, m2, m0, m1
REPX {pminsd x, m15}, m4, m2, m0, m1
pxor m5, m5
psubd m5, m4
shufpd m4, m2, 0xaa ; t4 t7
shufpd m2, m5, 0xaa ; t5 -t6
ITX_MULSUB_2D 4, 2, 3, 5, 6, 13, 1567, 3784
punpckhqdq m3, m0, m1
punpcklqdq m0, m1
psubd m1, m0, m3 ; t2 t3
paddd m0, m3 ; out0 -out7
punpckhqdq m3, m4, m2 ; t7a t6a
punpcklqdq m4, m2 ; t5a t4a
psubd m2, m4, m3 ; t7 t6
paddd m4, m3 ; out6 -out1
REPX {pmaxsd x, m14}, m1, m2
REPX {pminsd x, m15}, m1, m2
shufpd m3, m1, m2, 0xaa
shufpd m1, m2, 0x55
pmulld m3, m12
pmulld m1, m12
paddd m3, m13
psubd m2, m3, m1
paddd m3, m1
psrad m2, 12 ; out4 -out5
pshufd m3, m3, q1032
psrad m3, 12 ; out2 -out3
ret
INV_TXFM_8X8_FN flipadst, dct
INV_TXFM_8X8_FN flipadst, adst
INV_TXFM_8X8_FN flipadst, identity
INV_TXFM_8X8_FN flipadst, flipadst
cglobal iflipadst_8x8_internal_10bpc, 0, 7, 16, dst, stride, c, eob, tx2
call m(idct_8x8_internal_10bpc).load
vpermi2q m1, m6, m2 ; 7 5
vpermi2q m3, m4, m0 ; 3 1
vpermt2q m0, m5, m4 ; 0 2
vpermt2q m2, m5, m6 ; 4 6
call m(iadst_8x8_internal_10bpc).main
punpckhdq m1, m3, m4 ; -out3 -out1
punpckldq m3, m0 ; out2 out0
punpckhdq m0, m2 ; -out7 -out5
punpckldq m4, m2 ; out6 out4
psubd m1, m11, m1
paddd m3, m11
psubd m0, m11, m0
paddd m4, m11
jmp m(iadst_8x8_internal_10bpc).pass1_end
.pass2:
call m(iadst_8x8_internal_10bpc).main_pass2
movu m10, [permC+1]
vbroadcasti32x8 m12, [pw_m2048_2048+16]
lea r6, [strideq*3]
vpermt2q m0, m10, m1 ; 7 6 5 4
vpbroadcastd m11, [pixel_10bpc_max]
vpermt2q m2, m10, m3 ; 3 2 1 0
pxor m10, m10
pmulhrsw m8, m12, m2
call m(idct_8x8_internal_10bpc).write_8x4_start
pmulhrsw m8, m12, m0
jmp m(idct_8x8_internal_10bpc).write_8x4
INV_TXFM_8X8_FN identity, dct
INV_TXFM_8X8_FN identity, adst
INV_TXFM_8X8_FN identity, flipadst
INV_TXFM_8X8_FN identity, identity
cglobal iidentity_8x8_internal_10bpc, 0, 7, 16, dst, stride, c, eob, tx2
mova m1, [cq+64*0]
packssdw m1, [cq+64*2] ; 0 4 1 5
mova m2, [cq+64*1] ; 2 6 3 7
packssdw m2, [cq+64*3]
mova m0, [o(idtx8x8p)]
vpermb m1, m0, m1
vpermb m2, m0, m2
punpckldq m0, m1, m2 ; 0 1 4 5
punpckhdq m1, m2 ; 2 3 6 7
jmp tx2q
.pass2:
movu m3, [o(permC+2)]
vpbroadcastd m12, [o(pw_4096)]
psrlq m2, m3, 32
vpermi2q m2, m0, m1
vpermt2q m0, m3, m1
jmp m(idct_8x8_internal_10bpc).end2
%macro INV_TXFM_8X16_FN 2-3 0 ; type1, type2, eob_offset
INV_TXFM_FN %1, %2, %3, 8x16
%ifidn %1_%2, dct_dct
imul r6d, [cq], 181
mov [cq], eobd ; 0
or r3d, 16
add r6d, 128
sar r6d, 8
imul r6d, 181
jmp m(inv_txfm_add_dct_dct_8x8_10bpc).dconly
%endif
%endmacro
INV_TXFM_8X16_FN dct, dct
INV_TXFM_8X16_FN dct, identity, 35
INV_TXFM_8X16_FN dct, flipadst
INV_TXFM_8X16_FN dct, adst
cglobal idct_8x16_internal_10bpc, 0, 7, 16, dst, stride, c, eob, tx2
%undef cmp
cmp eobd, 43
jl .fast
call .load
call .main
call .main_end
.pass1_end:
packssdw m0, m4
packssdw m1, m5
packssdw m2, m6
packssdw m3, m7
jmp tx2q
.pass2:
mova m8, [o(idct8x16p)]
REPX {vpermb x, m8, x}, m0, m1, m2, m3
punpckhdq m5, m0, m1
punpckldq m0, m1
punpckhdq m4, m2, m3
punpckldq m2, m3
punpcklqdq m8, m0, m2 ; 15 1
punpckhqdq m0, m2 ; 7 9
punpckhqdq m1, m5, m4 ; 3 13
punpcklqdq m5, m4 ; 11 5
lea r5, [o_base_8bpc]
vextracti32x8 ym7, m8, 1 ; 14 2
vextracti32x8 ym3, m0, 1 ; 6 10
vextracti32x8 ym6, m1, 1 ; 12 4
vextracti32x8 ym9, m5, 1 ; 8 0
call m(idct_8x16_internal_8bpc).main2
mova m8, [permC]
vpbroadcastd m12, [pw_2048]
vpermt2q m0, m8, m1
lea r6, [strideq*3]
vpermt2q m2, m8, m3
vpbroadcastd m11, [pixel_10bpc_max]
vpermt2q m4, m8, m5
pxor m10, m10
vpermt2q m6, m8, m7
pmulhrsw m8, m12, m0
call m(idct_8x8_internal_10bpc).write_8x4_start
pmulhrsw m8, m12, m2
call m(idct_8x8_internal_10bpc).write_8x4
pmulhrsw m8, m12, m4
call m(idct_8x8_internal_10bpc).write_8x4
pmulhrsw m8, m12, m6
jmp m(idct_8x8_internal_10bpc).write_8x4
.fast:
mova ym0, [cq+64*0]
mova ym4, [cq+64*2]
mova ym1, [cq+64*1]
mova ym5, [cq+64*5]
mova ym2, [cq+64*4]
mova ym6, [cq+64*6]
mova ym3, [cq+64*7]
mova ym7, [cq+64*3]
call .round_input_fast
call m(idct_8x8_internal_10bpc).main
call m(idct_8x8_internal_10bpc).main_end
movu m6, [o(permC+3)]
packssdw m3, m1, m3
packssdw m1, m0, m2
vprolq m3, 32
vpermd m1, m6, m1
vpermd m3, m6, m3
mova ym0, ym1 ; 0 4
vextracti32x8 ym1, m1, 1 ; 1 5
mova ym2, ym3 ; 2 6
vextracti32x8 ym3, m3, 1 ; 3 7
jmp tx2q
ALIGN function_align
.round_input_fast:
movshdup m8, [o(permB)]
vpbroadcastd m12, [o(pd_2896)]
vpermt2q m0, m8, m4
vpermt2q m1, m8, m5
vpermt2q m2, m8, m6
vpermt2q m3, m8, m7
vpbroadcastd m13, [o(pd_2048)]
REPX {pmulld x, m12}, m0, m1, m2, m3
vpbroadcastd m14, [o(clip_18b_min)]
vpbroadcastd m15, [o(clip_18b_max)]
REPX {paddd x, m13}, m0, m1, m2, m3
vpbroadcastd m11, [o(pd_1)]
REPX {psrad x, 12 }, m0, m1, m2, m3
ret
ALIGN function_align
.load:
vpbroadcastd m14, [o(clip_18b_min)]
vpbroadcastd m15, [o(clip_18b_max)]
.load2:
vpbroadcastd m12, [o(pd_2896)]
pmulld m0, m12, [cq+64*0]
pmulld m1, m12, [cq+64*1]
pmulld m2, m12, [cq+64*2]
pmulld m3, m12, [cq+64*3]
vpbroadcastd m13, [o(pd_2048)]
pmulld m4, m12, [cq+64*4]
pmulld m5, m12, [cq+64*5]
pmulld m6, m12, [cq+64*6]
pmulld m7, m12, [cq+64*7]
.round:
REPX {paddd x, m13}, m0, m1, m2, m3
REPX {psrad x, 12 }, m0, m1, m2, m3
REPX {paddd x, m13}, m4, m5, m6, m7
REPX {psrad x, 12 }, m4, m5, m6, m7
ret
ALIGN function_align
.main_fast2_rect2:
REPX {paddd x, m13}, m0, m1
REPX {psrad x, 12 }, m0, m1
.main_fast2:
pmulld m0, m12
pmulld m6, m1, [o(pd_4017)] {1to16} ; t7a
pmulld m8, m1, [o(pd_799)] {1to16} ; t4a
REPX {paddd x, m13}, m0, m6, m8
REPX {psrad x, 12 }, m0, m6, m8
pmulld m5, m6, m12
pmulld m1, m8, m12
paddd m5, m13
psubd m4, m5, m1
paddd m5, m1
REPX {psrad x, 12 }, m4, m5
REPX {mova x, m0 }, m1, m2, m3
ret
.main_fast_rect2:
REPX {paddd x, m13}, m0, m1, m2, m3
REPX {psrad x, 12 }, m0, m1, m2, m3
.main_fast:
pmulld m0, m12
pmulld m5, m3, [o(pd_2276)] {1to16} ; t5a
pmulld m3, [o(pd_3406)] {1to16} ; t6a
pmulld m7, m1, [o(pd_4017)] {1to16} ; t7a
pmulld m1, [o(pd_799)] {1to16} ; t4a
pmulld m6, m2, [o(pd_3784)] {1to16} ; t3
pmulld m2, [o(pd_1567)] {1to16} ; t2
paddd m0, m13
psubd m5, m13, m5
psrad m0, 12 ; t0
mova m9, m0 ; t1
jmp .main2
.main_rect2:
call .round
.main:
pmulld m0, m12
ITX_MULSUB_2D 5, 3, 8, 9, 10, _, 3406, 2276 ; t5a t6a
ITX_MULSUB_2D 1, 7, 8, 9, 10, _, 799, 4017 ; t4a t7a
ITX_MULSUB_2D 2, 6, 8, 9, 10, _, 1567, 3784 ; t2 t3
pmulld m4, m12
paddd m0, m13
paddd m5, m13
psubd m9, m0, m4 ; t1
paddd m0, m4 ; t0
psrad m9, 12
psrad m0, 12
.main2:
REPX {paddd x, m13}, m3, m1, m7
REPX {psrad x, 12 }, m5, m1, m3, m7
paddd m8, m1, m5 ; t4
psubd m1, m5 ; t5a
psubd m5, m7, m3 ; t6a
paddd m7, m3 ; t7
pmaxsd m5, m14
pmaxsd m1, m14
paddd m2, m13
paddd m6, m13
pminsd m5, m15
pminsd m1, m15
pmulld m5, m12
pmulld m1, m12
pmaxsd m8, m14
pmaxsd m7, m14
pminsd m8, m15
paddd m5, m13
psubd m4, m5, m1
paddd m5, m1
REPX {psrad x, 12 }, m2, m6, m5, m4
paddd m1, m9, m2 ; dct4 out1
psubd m2, m9, m2 ; dct4 out2
psubd m3, m0, m6 ; dct4 out3
paddd m0, m6 ; dct4 out0
pminsd m6, m15, m7
REPX {pmaxsd x, m14}, m0, m1, m2, m3
REPX {pminsd x, m15}, m0, m1, m2, m3
ret
.main_end:
vpbroadcastd m11, [o(pd_1)]
.main_end2:
REPX {paddd x, m11}, m0, m1, m2, m3
psubd m7, m0, m6 ; out7
paddd m0, m6 ; out0
psubd m6, m1, m5 ; out6
paddd m1, m5 ; out1
psubd m5, m2, m4 ; out5
paddd m2, m4 ; out2
psubd m4, m3, m8 ; out4
paddd m3, m8 ; out3
REPX {vpsravd x, m11}, m0, m1, m2, m3, m4, m5, m6, m7
ret
INV_TXFM_8X16_FN adst, dct
INV_TXFM_8X16_FN adst, identity, 35
INV_TXFM_8X16_FN adst, flipadst
INV_TXFM_8X16_FN adst, adst
cglobal iadst_8x16_internal_10bpc, 0, 7, 16, dst, stride, c, eob, tx2
%undef cmp
cmp eobd, 43
jl .fast
call m(idct_8x16_internal_10bpc).load
call .main
psrad m0, 1
psrad m1, 1
psrad m6, m10, 1
psrad m7, m11, 1
psrad m2, 12
psrad m3, 12
psrad m4, m8, 12
psrad m5, m9, 12
jmp m(idct_8x16_internal_10bpc).pass1_end
.fast:
call .fast_main
punpcklqdq m1, m2, m4 ; out4 out6
punpckhqdq m2, m0 ; -out5 -out7
punpcklqdq m0, m3 ; out0 out2
punpckhqdq m4, m3 ; -out1 -out3
paddd m1, m11
psubd m3, m11, m2
paddd m0, m11
psubd m4, m11, m4
.fast_end:
movu m5, [o(permC+3)]
REPX {psrad x, 1}, m1, m0, m3, m4
packssdw m2, m0, m1 ; 0 2 4 6
packssdw m3, m4, m3 ; 1 3 5 7
vpermd m2, m5, m2
vpermd m3, m5, m3
mova ym0, ym2
vextracti32x8 ym2, m2, 1
mova ym1, ym3
vextracti32x8 ym3, m3, 1
jmp tx2q
.pass2:
call .pass2_main
movu m4, [permB+2]
vbroadcasti32x8 m12, [pw_2048_m2048+16]
psrlq m7, m4, 8
vpermi2q m4, m0, m3 ; 0 1 2 3
psrlq m5, m7, 24
vpermi2q m7, m0, m3 ; 12 13 14 15
psrlq m6, m5, 8
vpermq m5, m5, m1 ; 4 5 6 7
vpermq m6, m6, m2 ; 8 9 10 11
.pass2_end:
vpbroadcastd m11, [pixel_10bpc_max]
pxor m10, m10
lea r6, [strideq*3]
pmulhrsw m8, m12, m4
call m(idct_8x8_internal_10bpc).write_8x4_start
pmulhrsw m8, m12, m5
call m(idct_8x8_internal_10bpc).write_8x4
pmulhrsw m8, m12, m6
call m(idct_8x8_internal_10bpc).write_8x4
pmulhrsw m8, m12, m7
jmp m(idct_8x8_internal_10bpc).write_8x4
ALIGN function_align
.main:
ITX_MULSUB_2D 7, 0, 8, 9, 10, 13, 401, 4076 ; t1a, t0a
ITX_MULSUB_2D 1, 6, 8, 9, 10, 13, 3920, 1189 ; t7a, t6a
ITX_MULSUB_2D 5, 2, 8, 9, 10, 13, 1931, 3612 ; t3a, t2a
ITX_MULSUB_2D 3, 4, 8, 9, 10, 13, 3166, 2598 ; t5a, t4a
psubd m8, m2, m6 ; t6
paddd m2, m6 ; t2
psubd m6, m0, m4 ; t4
paddd m0, m4 ; t0
psubd m4, m5, m1 ; t7
paddd m5, m1 ; t3
psubd m1, m7, m3 ; t5
paddd m7, m3 ; t1
REPX {pmaxsd x, m14}, m6, m1, m8, m4, m2, m0, m5, m7
REPX {pminsd x, m15}, m6, m1, m8, m4, m2, m0, m5, m7
vpbroadcastd m10, [o(pd_1567)]
vpbroadcastd m11, [o(pd_3784)]
ITX_MULSUB_2D 6, 1, 3, 9, _, 13, 10, 11 ; t5a, t4a
ITX_MULSUB_2D 4, 8, 3, 9, _, 13, 11, 10 ; t6a, t7a
vpbroadcastd m12, [o(pd_1448)]
psubd m9, m6, m8 ; t7
paddd m6, m8 ; out6
psubd m3, m7, m5 ; t3
paddd m7, m5 ; -out7
psubd m5, m0, m2 ; t2
paddd m0, m2 ; out0
psubd m2, m1, m4 ; t6
paddd m1, m4 ; -out1
REPX {pmaxsd x, m14}, m5, m3, m2, m9
REPX {pminsd x, m15}, m5, m3, m2, m9
REPX {pmulld x, m12}, m5, m3, m2, m9
vpbroadcastd m4, [o(pd_1)]
psubd m8, m5, m3 ; (t2 - t3) * 1448
paddd m3, m5 ; (t2 + t3) * 1448
psubd m5, m2, m9 ; (t6 - t7) * 1448
paddd m2, m9 ; (t6 + t7) * 1448
vpbroadcastd m9, [o(pd_3072)]
paddd m0, m4
psubd m1, m4, m1
paddd m10, m6, m4
psubd m11, m4, m7
paddd m2, m9
paddd m8, m9
vpbroadcastd m9, [o(pd_3071)]
psubd m3, m9, m3
psubd m9, m5
ret
ALIGN function_align
.fast_main:
mova ym0, [cq+64*0]
mova ym4, [cq+64*2]
mova ym1, [cq+64*7]
mova ym5, [cq+64*5]
mova ym2, [cq+64*4]
mova ym6, [cq+64*6]
mova ym3, [cq+64*3]
mova ym7, [cq+64*1]
call m(idct_8x16_internal_10bpc).round_input_fast
jmp m(iadst_8x8_internal_10bpc).main
ALIGN function_align
.pass2_main:
mova m8, [o(iadst8x16p)]
REPX {vpermb x, m8, x}, m0, m1, m2, m3
vpbroadcastd m10, [o(pw_2896x8)]
punpckhdq m5, m0, m1
punpckldq m0, m1
punpckhdq m1, m2, m3
punpckldq m2, m3
lea r5, [o_base_8bpc]
punpckhqdq m4, m0, m2 ; 12 3 14 1
punpcklqdq m0, m2 ; 0 15 2 13
punpckhqdq m6, m5, m1 ; 8 7 10 5
punpcklqdq m5, m1 ; 4 11 6 9
call m(iadst_8x16_internal_8bpc).main2
paddsw m1, m2, m4
psubsw m2, m4
pmulhrsw m1, m10 ; -out7 out4 out6 -out5
pmulhrsw m2, m10 ; out8 -out11 -out9 out10
ret
INV_TXFM_8X16_FN flipadst, dct
INV_TXFM_8X16_FN flipadst, identity, 35
INV_TXFM_8X16_FN flipadst, adst
INV_TXFM_8X16_FN flipadst, flipadst
cglobal iflipadst_8x16_internal_10bpc, 0, 7, 16, dst, stride, c, eob, tx2
%undef cmp
cmp eobd, 43
jl .fast
call m(idct_8x16_internal_10bpc).load
call m(iadst_8x16_internal_10bpc).main
psrad m7, m0, 1
psrad m0, m11, 1
psrad m6, m1, 1
psrad m1, m10, 1
psrad m5, m2, 12
psrad m2, m9, 12
psrad m4, m3, 12
psrad m3, m8, 12
jmp m(idct_8x16_internal_10bpc).pass1_end
.fast:
call m(iadst_8x16_internal_10bpc).fast_main
punpckhqdq m1, m3, m4 ; -out3 -out1
punpcklqdq m3, m0 ; out2 out0
punpckhqdq m0, m2 ; -out7 -out5
punpcklqdq m4, m2 ; out6 out4
psubd m1, m11, m1
paddd m3, m11
psubd m0, m11, m0
paddd m4, m11
jmp m(iadst_8x16_internal_10bpc).fast_end
.pass2:
call m(iadst_8x16_internal_10bpc).pass2_main
movu m7, [permB+2]
vbroadcasti32x8 m12, [pw_m2048_2048+16]
psrlq m4, m7, 8
vpermi2q m7, m3, m0 ; 3 2 1 0
psrlq m5, m4, 24
vpermi2q m4, m3, m0 ; 15 14 13 12
psrlq m6, m5, 8
vpermq m5, m5, m2 ; 11 10 9 8
vpermq m6, m6, m1 ; 7 6 5 4
jmp m(iadst_8x16_internal_10bpc).pass2_end
INV_TXFM_8X16_FN identity, dct
INV_TXFM_8X16_FN identity, adst
INV_TXFM_8X16_FN identity, flipadst
INV_TXFM_8X16_FN identity, identity
cglobal iidentity_8x16_internal_10bpc, 0, 7, 16, dst, stride, c, eob, tx2
call m(idct_8x16_internal_10bpc).load2
jmp m(idct_8x16_internal_10bpc).pass1_end
.pass2:
vpbroadcastd m8, [o(pw_1697x16)]
pmulhrsw m4, m8, m0
pmulhrsw m5, m8, m1
pmulhrsw m6, m8, m2
pmulhrsw m7, m8, m3
REPX {paddsw x, x}, m0, m1, m2, m3
paddsw m0, m4
paddsw m1, m5
paddsw m2, m6
paddsw m3, m7
vpbroadcastd m7, [o(pw_2048)]
punpckhwd m4, m0, m1
punpcklwd m0, m1