2 * Copyright (C) 2013 Xiaolei Yu <dreifachstein@gmail.com>
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #if HAVE_AS_DN_DIRECTIVE
23 #include "rgb2yuv_neon_common.S"
25 /* downsampled R16G16B16 x8 */
39 vld3.i32 {q13_l, q14_l, q15_l}, [\src]!
40 vld3.i32 {q13_h[0], q14_h[0], q15_h[0]}, [\src]
41 vrshrn.i32 CO_R, q13, #7
42 vrshrn.i32 CO_G, q14, #7
43 vrshrn.i32 CO_B, q15, #7
50 .macro compute_y_16x1_step action, s8x16, coeff
51 vmovl.u8 n16x16_l, \s8x16\()_l
52 vmovl.u8 n16x16_h, \s8x16\()_h
54 \action y16x16_l, n16x16_l, \coeff
55 \action y16x16_h, n16x16_h, \coeff
59 compute_y_16x1_step vmul, r8x16, CO_RY
60 compute_y_16x1_step vmla, g8x16, CO_GY
61 compute_y_16x1_step vmla, b8x16, CO_BY
63 vrshrn.i16 y8x16_l, y16x16_l, #8
64 vrshrn.i16 y8x16_h, y16x16_h, #8
66 vadd.u8 y8x16, y8x16, BIAS_Y
73 .macro compute_chroma_8x1 c, C
74 vmul c16x8, r16x8, CO_R\C
75 vmla c16x8, g16x8, CO_G\C
76 vmla c16x8, b16x8, CO_B\C
78 vrshrn.i16 \c\()8x8, c16x8, #8
79 vadd.u8 \c\()8x8, \c\()8x8, BIAS_\C
82 loop_420sp rgbx, nv12, init, kernel_420_16x2, 16