/*****************************************************************************1* bitstream-a.S: aarch64 bitstream functions2*****************************************************************************3* Copyright (C) 2014-2016 x264 project4*5* Authors: Janne Grunau <[email protected]>6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License as published by9* the Free Software Foundation; either version 2 of the License, or10* (at your option) any later version.11*12* This program is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15* GNU General Public License for more details.16*17* You should have received a copy of the GNU General Public License18* along with this program; if not, write to the Free Software19* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.20*21* This program is also available under a commercial proprietary license.22* For more information, contact us at [email protected].23*****************************************************************************/2425#include "asm.S"2627function x264_nal_escape_neon, export=128movi v0.16b, #0xff29movi v4.16b, #430mov w3, #331subs x6, x1, x232cbz x6, 99f330:34cmn x6, #1535b.lt 16f36mov x1, x237b 100f3816:39ld1 {v1.16b}, [x1], #1640ext v2.16b, v0.16b, v1.16b, #1441ext v3.16b, v0.16b, v1.16b, #1542cmhi v7.16b, v4.16b, v1.16b43cmeq v5.16b, v2.16b, #044cmeq v6.16b, v3.16b, #045and v5.16b, v5.16b, v7.16b46and v5.16b, v5.16b, v6.16b47shrn v7.8b, v5.8h, #448mov x7, v7.d[0]49cbz x7, 16f50mov x6, #-1651100:52umov w5, v0.b[14]53umov w4, v0.b[15]54orr w5, w4, w5, lsl #855101:56ldrb w4, [x1, x6]57orr w9, w4, w5, lsl #1658cmp w9, #359b.hi 102f60strb w3, [x0], #161orr w5, w3, w5, lsl #862102:63adds x6, x6, #164strb w4, [x0], #165orr w5, w4, w5, lsl #866b.lt 101b67subs x6, x1, x268lsr w9, w5, #869mov v0.b[14], w970mov v0.b[15], w571b.lt 0b7273ret7416:75subs x6, x1, x276st1 {v1.16b}, [x0], #1677mov v0.16b, v1.16b78b.lt 0b7999:80ret81endfunc828384