annotate ppc/h264_template_altivec.c @ 5541:6c385356e61f libavcodec

special handling for vp3 idct, use the c reference
author mhoffman
date Mon, 13 Aug 2007 14:16:20 +0000
parents cd266411b11a
children 861eb234e6ba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
1 /*
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
2 * Copyright (c) 2004 Romain Dolbeau <romain@dolbeau.org>
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
3 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3577
diff changeset
4 * This file is part of FFmpeg.
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3577
diff changeset
5 *
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3577
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3577
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
10 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3577
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
14 * Lesser General Public License for more details.
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
15 *
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3577
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
3036
0b546eab515d Update licensing information: The FSF changed postal address.
diego
parents: 2967
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
19 */
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
20
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
21 /* this code assume that stride % 16 == 0 */
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
22 void PREFIX_h264_chroma_mc8_altivec(uint8_t * dst, uint8_t * src, int stride, int h, int x, int y) {
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
23 POWERPC_PERF_DECLARE(PREFIX_h264_chroma_mc8_num, 1);
5019
41cabe79ba25 use macro Use DECLARE_ALIGNED_16 to align stack-allocated variables
gpoirier
parents: 3947
diff changeset
24 DECLARE_ALIGNED_16(signed int, ABCD[4]) =
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
25 {((8 - x) * (8 - y)),
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
26 ((x) * (8 - y)),
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
27 ((8 - x) * (y)),
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
28 ((x) * (y))};
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
29 register int i;
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
30 vec_u8_t fperm;
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
31 const vec_s32_t vABCD = vec_ld(0, ABCD);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
32 const vec_s16_t vA = vec_splat((vec_s16_t)vABCD, 1);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
33 const vec_s16_t vB = vec_splat((vec_s16_t)vABCD, 3);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
34 const vec_s16_t vC = vec_splat((vec_s16_t)vABCD, 5);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
35 const vec_s16_t vD = vec_splat((vec_s16_t)vABCD, 7);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
36 LOAD_ZERO;
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
37 const vec_s16_t v32ss = vec_sl(vec_splat_s16(1),vec_splat_u16(5));
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
38 const vec_u16_t v6us = vec_splat_u16(6);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
39 register int loadSecond = (((unsigned long)src) % 16) <= 7 ? 0 : 1;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
40 register int reallyBadAlign = (((unsigned long)src) % 16) == 15 ? 1 : 0;
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
41
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
42 vec_u8_t vsrcAuc, vsrcBuc, vsrcperm0, vsrcperm1;
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
43 vec_u8_t vsrc0uc, vsrc1uc;
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
44 vec_s16_t vsrc0ssH, vsrc1ssH;
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
45 vec_u8_t vsrcCuc, vsrc2uc, vsrc3uc;
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
46 vec_s16_t vsrc2ssH, vsrc3ssH, psum;
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
47 vec_u8_t vdst, ppsum, vfdst, fsum;
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
48
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
49 POWERPC_PERF_START_COUNT(PREFIX_h264_chroma_mc8_num, 1);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
50
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
51 if (((unsigned long)dst) % 16 == 0) {
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
52 fperm = (vec_u8_t)AVV(0x10, 0x11, 0x12, 0x13,
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
53 0x14, 0x15, 0x16, 0x17,
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
54 0x08, 0x09, 0x0A, 0x0B,
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
55 0x0C, 0x0D, 0x0E, 0x0F);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
56 } else {
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
57 fperm = (vec_u8_t)AVV(0x00, 0x01, 0x02, 0x03,
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
58 0x04, 0x05, 0x06, 0x07,
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
59 0x18, 0x19, 0x1A, 0x1B,
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
60 0x1C, 0x1D, 0x1E, 0x1F);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
61 }
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
62
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
63 vsrcAuc = vec_ld(0, src);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
64
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
65 if (loadSecond)
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
66 vsrcBuc = vec_ld(16, src);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
67 vsrcperm0 = vec_lvsl(0, src);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
68 vsrcperm1 = vec_lvsl(1, src);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
69
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
70 vsrc0uc = vec_perm(vsrcAuc, vsrcBuc, vsrcperm0);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
71 if (reallyBadAlign)
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
72 vsrc1uc = vsrcBuc;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
73 else
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
74 vsrc1uc = vec_perm(vsrcAuc, vsrcBuc, vsrcperm1);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
75
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
76 vsrc0ssH = (vec_s16_t)vec_mergeh(zero_u8v,(vec_u8_t)vsrc0uc);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
77 vsrc1ssH = (vec_s16_t)vec_mergeh(zero_u8v,(vec_u8_t)vsrc1uc);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
78
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
79 if (!loadSecond) {// -> !reallyBadAlign
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
80 for (i = 0 ; i < h ; i++) {
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
81
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
82
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
83 vsrcCuc = vec_ld(stride + 0, src);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
84
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
85 vsrc2uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm0);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
86 vsrc3uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm1);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
87
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
88 vsrc2ssH = (vec_s16_t)vec_mergeh(zero_u8v,(vec_u8_t)vsrc2uc);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
89 vsrc3ssH = (vec_s16_t)vec_mergeh(zero_u8v,(vec_u8_t)vsrc3uc);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
90
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
91 psum = vec_mladd(vA, vsrc0ssH, vec_splat_s16(0));
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
92 psum = vec_mladd(vB, vsrc1ssH, psum);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
93 psum = vec_mladd(vC, vsrc2ssH, psum);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
94 psum = vec_mladd(vD, vsrc3ssH, psum);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
95 psum = vec_add(v32ss, psum);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
96 psum = vec_sra(psum, v6us);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
97
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
98 vdst = vec_ld(0, dst);
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
99 ppsum = (vec_u8_t)vec_packsu(psum, psum);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
100 vfdst = vec_perm(vdst, ppsum, fperm);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
101
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
102 OP_U8_ALTIVEC(fsum, vfdst, vdst);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
103
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
104 vec_st(fsum, 0, dst);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
105
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
106 vsrc0ssH = vsrc2ssH;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
107 vsrc1ssH = vsrc3ssH;
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
108
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
109 dst += stride;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
110 src += stride;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
111 }
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
112 } else {
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
113 vec_u8_t vsrcDuc;
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
114 for (i = 0 ; i < h ; i++) {
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
115 vsrcCuc = vec_ld(stride + 0, src);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
116 vsrcDuc = vec_ld(stride + 16, src);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
117
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
118 vsrc2uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm0);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
119 if (reallyBadAlign)
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
120 vsrc3uc = vsrcDuc;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
121 else
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
122 vsrc3uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm1);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
123
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
124 vsrc2ssH = (vec_s16_t)vec_mergeh(zero_u8v,(vec_u8_t)vsrc2uc);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
125 vsrc3ssH = (vec_s16_t)vec_mergeh(zero_u8v,(vec_u8_t)vsrc3uc);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
126
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
127 psum = vec_mladd(vA, vsrc0ssH, vec_splat_s16(0));
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
128 psum = vec_mladd(vB, vsrc1ssH, psum);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
129 psum = vec_mladd(vC, vsrc2ssH, psum);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
130 psum = vec_mladd(vD, vsrc3ssH, psum);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
131 psum = vec_add(v32ss, psum);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
132 psum = vec_sr(psum, v6us);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
133
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
134 vdst = vec_ld(0, dst);
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
135 ppsum = (vec_u8_t)vec_pack(psum, psum);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
136 vfdst = vec_perm(vdst, ppsum, fperm);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
137
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
138 OP_U8_ALTIVEC(fsum, vfdst, vdst);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
139
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
140 vec_st(fsum, 0, dst);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
141
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
142 vsrc0ssH = vsrc2ssH;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
143 vsrc1ssH = vsrc3ssH;
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
144
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
145 dst += stride;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
146 src += stride;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
147 }
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
148 }
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
149 POWERPC_PERF_STOP_COUNT(PREFIX_h264_chroma_mc8_num, 1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
150 }
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
151
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
152 /* this code assume stride % 16 == 0 */
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
153 static void PREFIX_h264_qpel16_h_lowpass_altivec(uint8_t * dst, uint8_t * src, int dstStride, int srcStride) {
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
154 POWERPC_PERF_DECLARE(PREFIX_h264_qpel16_h_lowpass_num, 1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
155 register int i;
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
156
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
157 LOAD_ZERO;
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
158 const vec_u8_t permM2 = vec_lvsl(-2, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
159 const vec_u8_t permM1 = vec_lvsl(-1, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
160 const vec_u8_t permP0 = vec_lvsl(+0, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
161 const vec_u8_t permP1 = vec_lvsl(+1, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
162 const vec_u8_t permP2 = vec_lvsl(+2, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
163 const vec_u8_t permP3 = vec_lvsl(+3, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
164 const vec_s16_t v5ss = vec_splat_s16(5);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
165 const vec_u16_t v5us = vec_splat_u16(5);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
166 const vec_s16_t v20ss = vec_sl(vec_splat_s16(5),vec_splat_u16(2));
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
167 const vec_s16_t v16ss = vec_sl(vec_splat_s16(1),vec_splat_u16(4));
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
168 const vec_u8_t dstperm = vec_lvsr(0, dst);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
169 const vec_u8_t neg1 = (const vec_u8_t) vec_splat_s8(-1);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
170 const vec_u8_t dstmask = vec_perm(zero_u8v, neg1, dstperm);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
171
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
172 vec_u8_t srcM2, srcM1, srcP0, srcP1, srcP2, srcP3;
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
173
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
174 register int align = ((((unsigned long)src) - 2) % 16);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
175
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
176 vec_s16_t srcP0A, srcP0B, srcP1A, srcP1B,
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
177 srcP2A, srcP2B, srcP3A, srcP3B,
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
178 srcM1A, srcM1B, srcM2A, srcM2B,
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
179 sum1A, sum1B, sum2A, sum2B, sum3A, sum3B,
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
180 pp1A, pp1B, pp2A, pp2B, pp3A, pp3B,
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
181 psumA, psumB, sumA, sumB;
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
182
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
183 vec_u8_t sum, dst1, dst2, vdst, fsum, rsum, fdst1, fdst2;
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
184
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
185 POWERPC_PERF_START_COUNT(PREFIX_h264_qpel16_h_lowpass_num, 1);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
186
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
187 for (i = 0 ; i < 16 ; i ++) {
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
188 vec_u8_t srcR1 = vec_ld(-2, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
189 vec_u8_t srcR2 = vec_ld(14, src);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
190
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
191 switch (align) {
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
192 default: {
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
193 srcM2 = vec_perm(srcR1, srcR2, permM2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
194 srcM1 = vec_perm(srcR1, srcR2, permM1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
195 srcP0 = vec_perm(srcR1, srcR2, permP0);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
196 srcP1 = vec_perm(srcR1, srcR2, permP1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
197 srcP2 = vec_perm(srcR1, srcR2, permP2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
198 srcP3 = vec_perm(srcR1, srcR2, permP3);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
199 } break;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
200 case 11: {
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
201 srcM2 = vec_perm(srcR1, srcR2, permM2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
202 srcM1 = vec_perm(srcR1, srcR2, permM1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
203 srcP0 = vec_perm(srcR1, srcR2, permP0);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
204 srcP1 = vec_perm(srcR1, srcR2, permP1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
205 srcP2 = vec_perm(srcR1, srcR2, permP2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
206 srcP3 = srcR2;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
207 } break;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
208 case 12: {
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
209 vec_u8_t srcR3 = vec_ld(30, src);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
210 srcM2 = vec_perm(srcR1, srcR2, permM2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
211 srcM1 = vec_perm(srcR1, srcR2, permM1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
212 srcP0 = vec_perm(srcR1, srcR2, permP0);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
213 srcP1 = vec_perm(srcR1, srcR2, permP1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
214 srcP2 = srcR2;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
215 srcP3 = vec_perm(srcR2, srcR3, permP3);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
216 } break;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
217 case 13: {
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
218 vec_u8_t srcR3 = vec_ld(30, src);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
219 srcM2 = vec_perm(srcR1, srcR2, permM2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
220 srcM1 = vec_perm(srcR1, srcR2, permM1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
221 srcP0 = vec_perm(srcR1, srcR2, permP0);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
222 srcP1 = srcR2;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
223 srcP2 = vec_perm(srcR2, srcR3, permP2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
224 srcP3 = vec_perm(srcR2, srcR3, permP3);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
225 } break;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
226 case 14: {
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
227 vec_u8_t srcR3 = vec_ld(30, src);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
228 srcM2 = vec_perm(srcR1, srcR2, permM2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
229 srcM1 = vec_perm(srcR1, srcR2, permM1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
230 srcP0 = srcR2;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
231 srcP1 = vec_perm(srcR2, srcR3, permP1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
232 srcP2 = vec_perm(srcR2, srcR3, permP2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
233 srcP3 = vec_perm(srcR2, srcR3, permP3);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
234 } break;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
235 case 15: {
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
236 vec_u8_t srcR3 = vec_ld(30, src);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
237 srcM2 = vec_perm(srcR1, srcR2, permM2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
238 srcM1 = srcR2;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
239 srcP0 = vec_perm(srcR2, srcR3, permP0);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
240 srcP1 = vec_perm(srcR2, srcR3, permP1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
241 srcP2 = vec_perm(srcR2, srcR3, permP2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
242 srcP3 = vec_perm(srcR2, srcR3, permP3);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
243 } break;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
244 }
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
245
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
246 srcP0A = (vec_s16_t) vec_mergeh(zero_u8v, srcP0);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
247 srcP0B = (vec_s16_t) vec_mergel(zero_u8v, srcP0);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
248 srcP1A = (vec_s16_t) vec_mergeh(zero_u8v, srcP1);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
249 srcP1B = (vec_s16_t) vec_mergel(zero_u8v, srcP1);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
250
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
251 srcP2A = (vec_s16_t) vec_mergeh(zero_u8v, srcP2);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
252 srcP2B = (vec_s16_t) vec_mergel(zero_u8v, srcP2);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
253 srcP3A = (vec_s16_t) vec_mergeh(zero_u8v, srcP3);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
254 srcP3B = (vec_s16_t) vec_mergel(zero_u8v, srcP3);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
255
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
256 srcM1A = (vec_s16_t) vec_mergeh(zero_u8v, srcM1);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
257 srcM1B = (vec_s16_t) vec_mergel(zero_u8v, srcM1);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
258 srcM2A = (vec_s16_t) vec_mergeh(zero_u8v, srcM2);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
259 srcM2B = (vec_s16_t) vec_mergel(zero_u8v, srcM2);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
260
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
261 sum1A = vec_adds(srcP0A, srcP1A);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
262 sum1B = vec_adds(srcP0B, srcP1B);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
263 sum2A = vec_adds(srcM1A, srcP2A);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
264 sum2B = vec_adds(srcM1B, srcP2B);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
265 sum3A = vec_adds(srcM2A, srcP3A);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
266 sum3B = vec_adds(srcM2B, srcP3B);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
267
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
268 pp1A = vec_mladd(sum1A, v20ss, v16ss);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
269 pp1B = vec_mladd(sum1B, v20ss, v16ss);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
270
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
271 pp2A = vec_mladd(sum2A, v5ss, zero_s16v);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
272 pp2B = vec_mladd(sum2B, v5ss, zero_s16v);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
273
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
274 pp3A = vec_add(sum3A, pp1A);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
275 pp3B = vec_add(sum3B, pp1B);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
276
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
277 psumA = vec_sub(pp3A, pp2A);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
278 psumB = vec_sub(pp3B, pp2B);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
279
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
280 sumA = vec_sra(psumA, v5us);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
281 sumB = vec_sra(psumB, v5us);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
282
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
283 sum = vec_packsu(sumA, sumB);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
284
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
285 dst1 = vec_ld(0, dst);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
286 dst2 = vec_ld(16, dst);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
287 vdst = vec_perm(dst1, dst2, vec_lvsl(0, dst));
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
288
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
289 OP_U8_ALTIVEC(fsum, sum, vdst);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
290
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
291 rsum = vec_perm(fsum, fsum, dstperm);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
292 fdst1 = vec_sel(dst1, rsum, dstmask);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
293 fdst2 = vec_sel(rsum, dst2, dstmask);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
294
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
295 vec_st(fdst1, 0, dst);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
296 vec_st(fdst2, 16, dst);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
297
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
298 src += srcStride;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
299 dst += dstStride;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
300 }
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
301 POWERPC_PERF_STOP_COUNT(PREFIX_h264_qpel16_h_lowpass_num, 1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
302 }
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
303
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
304 /* this code assume stride % 16 == 0 */
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
305 static void PREFIX_h264_qpel16_v_lowpass_altivec(uint8_t * dst, uint8_t * src, int dstStride, int srcStride) {
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
306 POWERPC_PERF_DECLARE(PREFIX_h264_qpel16_v_lowpass_num, 1);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
307
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
308 register int i;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
309
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
310 LOAD_ZERO;
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
311 const vec_u8_t perm = vec_lvsl(0, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
312 const vec_s16_t v20ss = vec_sl(vec_splat_s16(5),vec_splat_u16(2));
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
313 const vec_u16_t v5us = vec_splat_u16(5);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
314 const vec_s16_t v5ss = vec_splat_s16(5);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
315 const vec_s16_t v16ss = vec_sl(vec_splat_s16(1),vec_splat_u16(4));
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
316 const vec_u8_t dstperm = vec_lvsr(0, dst);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
317 const vec_u8_t neg1 = (const vec_u8_t)vec_splat_s8(-1);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
318 const vec_u8_t dstmask = vec_perm(zero_u8v, neg1, dstperm);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
319
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
320 uint8_t *srcbis = src - (srcStride * 2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
321
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
322 const vec_u8_t srcM2a = vec_ld(0, srcbis);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
323 const vec_u8_t srcM2b = vec_ld(16, srcbis);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
324 const vec_u8_t srcM2 = vec_perm(srcM2a, srcM2b, perm);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
325 // srcbis += srcStride;
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
326 const vec_u8_t srcM1a = vec_ld(0, srcbis += srcStride);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
327 const vec_u8_t srcM1b = vec_ld(16, srcbis);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
328 const vec_u8_t srcM1 = vec_perm(srcM1a, srcM1b, perm);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
329 // srcbis += srcStride;
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
330 const vec_u8_t srcP0a = vec_ld(0, srcbis += srcStride);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
331 const vec_u8_t srcP0b = vec_ld(16, srcbis);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
332 const vec_u8_t srcP0 = vec_perm(srcP0a, srcP0b, perm);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
333 // srcbis += srcStride;
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
334 const vec_u8_t srcP1a = vec_ld(0, srcbis += srcStride);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
335 const vec_u8_t srcP1b = vec_ld(16, srcbis);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
336 const vec_u8_t srcP1 = vec_perm(srcP1a, srcP1b, perm);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
337 // srcbis += srcStride;
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
338 const vec_u8_t srcP2a = vec_ld(0, srcbis += srcStride);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
339 const vec_u8_t srcP2b = vec_ld(16, srcbis);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
340 const vec_u8_t srcP2 = vec_perm(srcP2a, srcP2b, perm);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
341 // srcbis += srcStride;
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
342
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
343 vec_s16_t srcM2ssA = (vec_s16_t) vec_mergeh(zero_u8v, srcM2);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
344 vec_s16_t srcM2ssB = (vec_s16_t) vec_mergel(zero_u8v, srcM2);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
345 vec_s16_t srcM1ssA = (vec_s16_t) vec_mergeh(zero_u8v, srcM1);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
346 vec_s16_t srcM1ssB = (vec_s16_t) vec_mergel(zero_u8v, srcM1);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
347 vec_s16_t srcP0ssA = (vec_s16_t) vec_mergeh(zero_u8v, srcP0);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
348 vec_s16_t srcP0ssB = (vec_s16_t) vec_mergel(zero_u8v, srcP0);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
349 vec_s16_t srcP1ssA = (vec_s16_t) vec_mergeh(zero_u8v, srcP1);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
350 vec_s16_t srcP1ssB = (vec_s16_t) vec_mergel(zero_u8v, srcP1);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
351 vec_s16_t srcP2ssA = (vec_s16_t) vec_mergeh(zero_u8v, srcP2);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
352 vec_s16_t srcP2ssB = (vec_s16_t) vec_mergel(zero_u8v, srcP2);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
353
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
354 vec_s16_t pp1A, pp1B, pp2A, pp2B, pp3A, pp3B,
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
355 psumA, psumB, sumA, sumB,
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
356 srcP3ssA, srcP3ssB,
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
357 sum1A, sum1B, sum2A, sum2B, sum3A, sum3B;
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
358
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
359 vec_u8_t sum, dst1, dst2, vdst, fsum, rsum, fdst1, fdst2, srcP3a, srcP3b, srcP3;
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
360
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
361 POWERPC_PERF_START_COUNT(PREFIX_h264_qpel16_v_lowpass_num, 1);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
362
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
363 for (i = 0 ; i < 16 ; i++) {
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
364 srcP3a = vec_ld(0, srcbis += srcStride);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
365 srcP3b = vec_ld(16, srcbis);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
366 srcP3 = vec_perm(srcP3a, srcP3b, perm);
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
367 srcP3ssA = (vec_s16_t) vec_mergeh(zero_u8v, srcP3);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
368 srcP3ssB = (vec_s16_t) vec_mergel(zero_u8v, srcP3);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
369 // srcbis += srcStride;
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
370
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
371 sum1A = vec_adds(srcP0ssA, srcP1ssA);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
372 sum1B = vec_adds(srcP0ssB, srcP1ssB);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
373 sum2A = vec_adds(srcM1ssA, srcP2ssA);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
374 sum2B = vec_adds(srcM1ssB, srcP2ssB);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
375 sum3A = vec_adds(srcM2ssA, srcP3ssA);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
376 sum3B = vec_adds(srcM2ssB, srcP3ssB);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
377
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
378 srcM2ssA = srcM1ssA;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
379 srcM2ssB = srcM1ssB;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
380 srcM1ssA = srcP0ssA;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
381 srcM1ssB = srcP0ssB;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
382 srcP0ssA = srcP1ssA;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
383 srcP0ssB = srcP1ssB;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
384 srcP1ssA = srcP2ssA;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
385 srcP1ssB = srcP2ssB;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
386 srcP2ssA = srcP3ssA;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
387 srcP2ssB = srcP3ssB;
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
388
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
389 pp1A = vec_mladd(sum1A, v20ss, v16ss);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
390 pp1B = vec_mladd(sum1B, v20ss, v16ss);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
391
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
392 pp2A = vec_mladd(sum2A, v5ss, zero_s16v);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
393 pp2B = vec_mladd(sum2B, v5ss, zero_s16v);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
394
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
395 pp3A = vec_add(sum3A, pp1A);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
396 pp3B = vec_add(sum3B, pp1B);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
397
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
398 psumA = vec_sub(pp3A, pp2A);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
399 psumB = vec_sub(pp3B, pp2B);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
400
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
401 sumA = vec_sra(psumA, v5us);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
402 sumB = vec_sra(psumB, v5us);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
403
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
404 sum = vec_packsu(sumA, sumB);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
405
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
406 dst1 = vec_ld(0, dst);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
407 dst2 = vec_ld(16, dst);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
408 vdst = vec_perm(dst1, dst2, vec_lvsl(0, dst));
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
409
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
410 OP_U8_ALTIVEC(fsum, sum, vdst);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
411
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
412 rsum = vec_perm(fsum, fsum, dstperm);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
413 fdst1 = vec_sel(dst1, rsum, dstmask);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
414 fdst2 = vec_sel(rsum, dst2, dstmask);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
415
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
416 vec_st(fdst1, 0, dst);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
417 vec_st(fdst2, 16, dst);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
418
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
419 dst += dstStride;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
420 }
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
421 POWERPC_PERF_STOP_COUNT(PREFIX_h264_qpel16_v_lowpass_num, 1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
422 }
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
423
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
424 /* this code assume stride % 16 == 0 *and* tmp is properly aligned */
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
425 static void PREFIX_h264_qpel16_hv_lowpass_altivec(uint8_t * dst, int16_t * tmp, uint8_t * src, int dstStride, int tmpStride, int srcStride) {
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
426 POWERPC_PERF_DECLARE(PREFIX_h264_qpel16_hv_lowpass_num, 1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
427 register int i;
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
428 LOAD_ZERO;
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
429 const vec_u8_t permM2 = vec_lvsl(-2, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
430 const vec_u8_t permM1 = vec_lvsl(-1, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
431 const vec_u8_t permP0 = vec_lvsl(+0, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
432 const vec_u8_t permP1 = vec_lvsl(+1, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
433 const vec_u8_t permP2 = vec_lvsl(+2, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
434 const vec_u8_t permP3 = vec_lvsl(+3, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
435 const vec_s16_t v20ss = vec_sl(vec_splat_s16(5),vec_splat_u16(2));
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
436 const vec_u32_t v10ui = vec_splat_u32(10);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
437 const vec_s16_t v5ss = vec_splat_s16(5);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
438 const vec_s16_t v1ss = vec_splat_s16(1);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
439 const vec_s32_t v512si = vec_sl(vec_splat_s32(1),vec_splat_u32(9));
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
440 const vec_u32_t v16ui = vec_sl(vec_splat_u32(1),vec_splat_u32(4));
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
441
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
442 register int align = ((((unsigned long)src) - 2) % 16);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
443
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
444 const vec_u8_t neg1 = (const vec_u8_t) vec_splat_s8(-1);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
445
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
446 vec_s16_t srcP0A, srcP0B, srcP1A, srcP1B,
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
447 srcP2A, srcP2B, srcP3A, srcP3B,
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
448 srcM1A, srcM1B, srcM2A, srcM2B,
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
449 sum1A, sum1B, sum2A, sum2B, sum3A, sum3B,
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
450 pp1A, pp1B, pp2A, pp2B, psumA, psumB;
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
451
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
452 const vec_u8_t dstperm = vec_lvsr(0, dst);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
453
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
454 const vec_u8_t dstmask = vec_perm(zero_u8v, neg1, dstperm);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
455
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
456 const vec_u8_t mperm = (const vec_u8_t)
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
457 AVV(0x00, 0x08, 0x01, 0x09, 0x02, 0x0A, 0x03, 0x0B,
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
458 0x04, 0x0C, 0x05, 0x0D, 0x06, 0x0E, 0x07, 0x0F);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
459 int16_t *tmpbis = tmp;
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
460
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
461 vec_s16_t tmpM1ssA, tmpM1ssB, tmpM2ssA, tmpM2ssB,
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
462 tmpP0ssA, tmpP0ssB, tmpP1ssA, tmpP1ssB,
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
463 tmpP2ssA, tmpP2ssB;
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
464
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
465 vec_s32_t pp1Ae, pp1Ao, pp1Be, pp1Bo, pp2Ae, pp2Ao, pp2Be, pp2Bo,
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
466 pp3Ae, pp3Ao, pp3Be, pp3Bo, pp1cAe, pp1cAo, pp1cBe, pp1cBo,
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
467 pp32Ae, pp32Ao, pp32Be, pp32Bo, sumAe, sumAo, sumBe, sumBo,
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
468 ssumAe, ssumAo, ssumBe, ssumBo;
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
469 vec_u8_t fsum, sumv, sum, dst1, dst2, vdst, rsum, fdst1, fdst2;
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
470 vec_s16_t ssume, ssumo;
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
471
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
472 POWERPC_PERF_START_COUNT(PREFIX_h264_qpel16_hv_lowpass_num, 1);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
473 src -= (2 * srcStride);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
474 for (i = 0 ; i < 21 ; i ++) {
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
475 vec_u8_t srcM2, srcM1, srcP0, srcP1, srcP2, srcP3;
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
476 vec_u8_t srcR1 = vec_ld(-2, src);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
477 vec_u8_t srcR2 = vec_ld(14, src);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
478
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
479 switch (align) {
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
480 default: {
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
481 srcM2 = vec_perm(srcR1, srcR2, permM2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
482 srcM1 = vec_perm(srcR1, srcR2, permM1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
483 srcP0 = vec_perm(srcR1, srcR2, permP0);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
484 srcP1 = vec_perm(srcR1, srcR2, permP1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
485 srcP2 = vec_perm(srcR1, srcR2, permP2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
486 srcP3 = vec_perm(srcR1, srcR2, permP3);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
487 } break;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
488 case 11: {
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
489 srcM2 = vec_perm(srcR1, srcR2, permM2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
490 srcM1 = vec_perm(srcR1, srcR2, permM1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
491 srcP0 = vec_perm(srcR1, srcR2, permP0);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
492 srcP1 = vec_perm(srcR1, srcR2, permP1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
493 srcP2 = vec_perm(srcR1, srcR2, permP2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
494 srcP3 = srcR2;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
495 } break;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
496 case 12: {
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
497 vec_u8_t srcR3 = vec_ld(30, src);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
498 srcM2 = vec_perm(srcR1, srcR2, permM2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
499 srcM1 = vec_perm(srcR1, srcR2, permM1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
500 srcP0 = vec_perm(srcR1, srcR2, permP0);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
501 srcP1 = vec_perm(srcR1, srcR2, permP1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
502 srcP2 = srcR2;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
503 srcP3 = vec_perm(srcR2, srcR3, permP3);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
504 } break;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
505 case 13: {
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
506 vec_u8_t srcR3 = vec_ld(30, src);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
507 srcM2 = vec_perm(srcR1, srcR2, permM2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
508 srcM1 = vec_perm(srcR1, srcR2, permM1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
509 srcP0 = vec_perm(srcR1, srcR2, permP0);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
510 srcP1 = srcR2;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
511 srcP2 = vec_perm(srcR2, srcR3, permP2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
512 srcP3 = vec_perm(srcR2, srcR3, permP3);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
513 } break;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
514 case 14: {
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
515 vec_u8_t srcR3 = vec_ld(30, src);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
516 srcM2 = vec_perm(srcR1, srcR2, permM2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
517 srcM1 = vec_perm(srcR1, srcR2, permM1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
518 srcP0 = srcR2;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
519 srcP1 = vec_perm(srcR2, srcR3, permP1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
520 srcP2 = vec_perm(srcR2, srcR3, permP2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
521 srcP3 = vec_perm(srcR2, srcR3, permP3);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
522 } break;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
523 case 15: {
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
524 vec_u8_t srcR3 = vec_ld(30, src);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
525 srcM2 = vec_perm(srcR1, srcR2, permM2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
526 srcM1 = srcR2;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
527 srcP0 = vec_perm(srcR2, srcR3, permP0);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
528 srcP1 = vec_perm(srcR2, srcR3, permP1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
529 srcP2 = vec_perm(srcR2, srcR3, permP2);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
530 srcP3 = vec_perm(srcR2, srcR3, permP3);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
531 } break;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
532 }
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
533
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
534 srcP0A = (vec_s16_t) vec_mergeh(zero_u8v, srcP0);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
535 srcP0B = (vec_s16_t) vec_mergel(zero_u8v, srcP0);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
536 srcP1A = (vec_s16_t) vec_mergeh(zero_u8v, srcP1);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
537 srcP1B = (vec_s16_t) vec_mergel(zero_u8v, srcP1);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
538
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
539 srcP2A = (vec_s16_t) vec_mergeh(zero_u8v, srcP2);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
540 srcP2B = (vec_s16_t) vec_mergel(zero_u8v, srcP2);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
541 srcP3A = (vec_s16_t) vec_mergeh(zero_u8v, srcP3);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
542 srcP3B = (vec_s16_t) vec_mergel(zero_u8v, srcP3);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
543
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
544 srcM1A = (vec_s16_t) vec_mergeh(zero_u8v, srcM1);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
545 srcM1B = (vec_s16_t) vec_mergel(zero_u8v, srcM1);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
546 srcM2A = (vec_s16_t) vec_mergeh(zero_u8v, srcM2);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
547 srcM2B = (vec_s16_t) vec_mergel(zero_u8v, srcM2);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
548
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
549 sum1A = vec_adds(srcP0A, srcP1A);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
550 sum1B = vec_adds(srcP0B, srcP1B);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
551 sum2A = vec_adds(srcM1A, srcP2A);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
552 sum2B = vec_adds(srcM1B, srcP2B);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
553 sum3A = vec_adds(srcM2A, srcP3A);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
554 sum3B = vec_adds(srcM2B, srcP3B);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
555
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
556 pp1A = vec_mladd(sum1A, v20ss, sum3A);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
557 pp1B = vec_mladd(sum1B, v20ss, sum3B);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
558
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
559 pp2A = vec_mladd(sum2A, v5ss, zero_s16v);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
560 pp2B = vec_mladd(sum2B, v5ss, zero_s16v);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
561
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
562 psumA = vec_sub(pp1A, pp2A);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
563 psumB = vec_sub(pp1B, pp2B);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
564
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
565 vec_st(psumA, 0, tmp);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
566 vec_st(psumB, 16, tmp);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
567
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
568 src += srcStride;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
569 tmp += tmpStride; /* int16_t*, and stride is 16, so it's OK here */
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
570 }
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
571
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
572 tmpM2ssA = vec_ld(0, tmpbis);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
573 tmpM2ssB = vec_ld(16, tmpbis);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
574 tmpbis += tmpStride;
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
575 tmpM1ssA = vec_ld(0, tmpbis);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
576 tmpM1ssB = vec_ld(16, tmpbis);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
577 tmpbis += tmpStride;
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
578 tmpP0ssA = vec_ld(0, tmpbis);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
579 tmpP0ssB = vec_ld(16, tmpbis);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
580 tmpbis += tmpStride;
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
581 tmpP1ssA = vec_ld(0, tmpbis);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
582 tmpP1ssB = vec_ld(16, tmpbis);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
583 tmpbis += tmpStride;
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
584 tmpP2ssA = vec_ld(0, tmpbis);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
585 tmpP2ssB = vec_ld(16, tmpbis);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
586 tmpbis += tmpStride;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
587
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
588 for (i = 0 ; i < 16 ; i++) {
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
589 const vec_s16_t tmpP3ssA = vec_ld(0, tmpbis);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
590 const vec_s16_t tmpP3ssB = vec_ld(16, tmpbis);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
591
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
592 const vec_s16_t sum1A = vec_adds(tmpP0ssA, tmpP1ssA);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
593 const vec_s16_t sum1B = vec_adds(tmpP0ssB, tmpP1ssB);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
594 const vec_s16_t sum2A = vec_adds(tmpM1ssA, tmpP2ssA);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
595 const vec_s16_t sum2B = vec_adds(tmpM1ssB, tmpP2ssB);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
596 const vec_s16_t sum3A = vec_adds(tmpM2ssA, tmpP3ssA);
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
597 const vec_s16_t sum3B = vec_adds(tmpM2ssB, tmpP3ssB);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
598
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
599 tmpbis += tmpStride;
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
600
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
601 tmpM2ssA = tmpM1ssA;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
602 tmpM2ssB = tmpM1ssB;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
603 tmpM1ssA = tmpP0ssA;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
604 tmpM1ssB = tmpP0ssB;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
605 tmpP0ssA = tmpP1ssA;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
606 tmpP0ssB = tmpP1ssB;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
607 tmpP1ssA = tmpP2ssA;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
608 tmpP1ssB = tmpP2ssB;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
609 tmpP2ssA = tmpP3ssA;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
610 tmpP2ssB = tmpP3ssB;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
611
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
612 pp1Ae = vec_mule(sum1A, v20ss);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
613 pp1Ao = vec_mulo(sum1A, v20ss);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
614 pp1Be = vec_mule(sum1B, v20ss);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
615 pp1Bo = vec_mulo(sum1B, v20ss);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
616
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
617 pp2Ae = vec_mule(sum2A, v5ss);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
618 pp2Ao = vec_mulo(sum2A, v5ss);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
619 pp2Be = vec_mule(sum2B, v5ss);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
620 pp2Bo = vec_mulo(sum2B, v5ss);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
621
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
622 pp3Ae = vec_sra((vec_s32_t)sum3A, v16ui);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
623 pp3Ao = vec_mulo(sum3A, v1ss);
5530
cd266411b11a use shorter types vec_"type" instead of the too long vector "type"
gpoirier
parents: 5019
diff changeset
624 pp3Be = vec_sra((vec_s32_t)sum3B, v16ui);
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
625 pp3Bo = vec_mulo(sum3B, v1ss);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
626
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
627 pp1cAe = vec_add(pp1Ae, v512si);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
628 pp1cAo = vec_add(pp1Ao, v512si);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
629 pp1cBe = vec_add(pp1Be, v512si);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
630 pp1cBo = vec_add(pp1Bo, v512si);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
631
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
632 pp32Ae = vec_sub(pp3Ae, pp2Ae);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
633 pp32Ao = vec_sub(pp3Ao, pp2Ao);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
634 pp32Be = vec_sub(pp3Be, pp2Be);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
635 pp32Bo = vec_sub(pp3Bo, pp2Bo);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
636
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
637 sumAe = vec_add(pp1cAe, pp32Ae);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
638 sumAo = vec_add(pp1cAo, pp32Ao);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
639 sumBe = vec_add(pp1cBe, pp32Be);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
640 sumBo = vec_add(pp1cBo, pp32Bo);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
641
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
642 ssumAe = vec_sra(sumAe, v10ui);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
643 ssumAo = vec_sra(sumAo, v10ui);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
644 ssumBe = vec_sra(sumBe, v10ui);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
645 ssumBo = vec_sra(sumBo, v10ui);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
646
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
647 ssume = vec_packs(ssumAe, ssumBe);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
648 ssumo = vec_packs(ssumAo, ssumBo);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
649
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
650 sumv = vec_packsu(ssume, ssumo);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
651 sum = vec_perm(sumv, sumv, mperm);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
652
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
653 dst1 = vec_ld(0, dst);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
654 dst2 = vec_ld(16, dst);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
655 vdst = vec_perm(dst1, dst2, vec_lvsl(0, dst));
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
656
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
657 OP_U8_ALTIVEC(fsum, sum, vdst);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
658
3346
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
659 rsum = vec_perm(fsum, fsum, dstperm);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
660 fdst1 = vec_sel(dst1, rsum, dstmask);
052765f11f1c Cosmetics: should not hurt performance, scream if are
lu_zero
parents: 3153
diff changeset
661 fdst2 = vec_sel(rsum, dst2, dstmask);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
662
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
663 vec_st(fdst1, 0, dst);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
664 vec_st(fdst2, 16, dst);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
665
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
666 dst += dstStride;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
667 }
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
668 POWERPC_PERF_STOP_COUNT(PREFIX_h264_qpel16_hv_lowpass_num, 1);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
669 }