1 ;*****************************************************************************
2 ;* Copyright (C) 2013 x265 project
4 ;* Authors: Min Chen <chenm001@163.com>
5 ;* Praveen Kumar Tiwari <praveen@multicorewareinc.com>
6 ;* Nabajit Deka <nabajit@multicorewareinc.com>
7 ;* Dnyaneshwar Gorade <dnyaneshwar@multicorewareinc.com>
8 ;* Murugan Vairavel <murugan@multicorewareinc.com>
9 ;* Yuvaraj Venkatesh <yuvaraj@multicorewareinc.com>
10 ;* This program is free software; you can redistribute it and/or modify
11 ;* it under the terms of the GNU General Public License as published by
12 ;* the Free Software Foundation; either version 2 of the License, or
13 ;* (at your option) any later version.
15 ;* This program is distributed in the hope that it will be useful,
16 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;* GNU General Public License for more details.
20 ;* You should have received a copy of the GNU General Public License
21 ;* along with this program; if not, write to the Free Software
22 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
24 ;* This program is also available under a commercial proprietary license.
25 ;* For more information, contact us at license @ x265.com.
26 ;*****************************************************************************/
36 ;============================================================================================================
37 ; void saoCuOrgE0(pixel * rec, int8_t * offsetEo, int lcuWidth, int8_t signLeft)
38 ;============================================================================================================
40 cglobal saoCuOrgE0, 4, 4, 8, rec, offsetEo, lcuWidth, signLeft
42 neg r3 ; r3 = -iSignLeft
44 pslldq m0, 15 ; m0 = [iSignLeft x .. x]
45 pcmpeqb m4, m4 ; m4 = [pb -1]
47 movh m6, [r1] ; m6 = m_offsetEo
50 movu m7, [r0] ; m1 = pRec[x]
52 movu m2, [r0+1] ; m2 = pRec[x+1]
60 pabsb m3, m3 ; m1 = (pRec[x] - pRec[x+1]) > 0) ? 1 : 0
61 por m1, m3 ; m1 = iSignRight
64 palignr m3, m2, m0, 15 ; m3 = -iSignLeft
65 psignb m3, m4 ; m3 = iSignLeft
68 pand m0, m2 ; [pb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1]
70 paddb m2, [pw_2] ; m1 = uiEdgeType
74 pmovsxbw m1, m3 ; iOffsetEo