/*1* Copyright (C) 2013 Xiaolei Yu <[email protected]>2*3* This file is part of FFmpeg.4*5* FFmpeg is free software; you can redistribute it and/or6* modify it under the terms of the GNU Lesser General Public7* License as published by the Free Software Foundation; either8* version 2.1 of the License, or (at your option) any later version.9*10* FFmpeg is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13* Lesser General Public License for more details.14*15* You should have received a copy of the GNU Lesser General Public16* License along with FFmpeg; if not, write to the Free Software17* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA18*/1920#include "rgb2yuv_neon_common.S"2122/* downsampled R16G16B16 x8 */23alias_qw r16x8, q724alias_qw g16x8, q825alias_qw b16x8, q92627alias n16x16_l, q1128alias n16x16_h, q122930alias y16x16_l, q1331alias y16x16_h, q143233alias_qw y8x16, q153435.macro init src36vld3.i32 {q13_l, q14_l, q15_l}, [\src]!37vld3.i32 {q13_h[0], q14_h[0], q15_h[0]}, [\src]38vrshrn.i32 CO_R, q13, #739vrshrn.i32 CO_G, q14, #740vrshrn.i32 CO_B, q15, #74142vmov.u8 BIAS_Y, #1643vmov.u8 BIAS_U, #12844.endm454647.macro compute_y_16x1_step action, s8x16, coeff48vmovl.u8 n16x16_l, \s8x16\()_l49vmovl.u8 n16x16_h, \s8x16\()_h5051\action y16x16_l, n16x16_l, \coeff52\action y16x16_h, n16x16_h, \coeff53.endm5455.macro compute_y_16x156compute_y_16x1_step vmul, r8x16, CO_RY57compute_y_16x1_step vmla, g8x16, CO_GY58compute_y_16x1_step vmla, b8x16, CO_BY5960vrshrn.i16 y8x16_l, y16x16_l, #861vrshrn.i16 y8x16_h, y16x16_h, #86263vadd.u8 y8x16, y8x16, BIAS_Y64.endm6566alias c16x8, q1567alias_qw c8x8x2, q10686970.macro compute_chroma_8x1 c, C71vmul c16x8, r16x8, CO_R\C72vmla c16x8, g16x8, CO_G\C73vmla c16x8, b16x8, CO_B\C7475vrshrn.i16 \c\()8x8, c16x8, #876vadd.u8 \c\()8x8, \c\()8x8, BIAS_\C77.endm7879loop_420sp rgbx, nv12, init, kernel_420_16x2, 16808182