Spaces:
Runtime error
Runtime error
/* | |
* Copyright (c) 2021 Loongson Technology Corporation Limited | |
* Contributed by Xiwei Gu <[email protected]> | |
* | |
* This file is part of FFmpeg. | |
* | |
* FFmpeg is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; either | |
* version 2.1 of the License, or (at your option) any later version. | |
* | |
* FFmpeg is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
* Lesser General Public License for more details. | |
* | |
* You should have received a copy of the GNU Lesser General Public | |
* License along with FFmpeg; if not, write to the Free Software | |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
*/ | |
void ff_h264_loop_filter_strength_lasx(int16_t bS[2][4][4], uint8_t nnz[40], | |
int8_t ref[2][40], int16_t mv[2][40][2], | |
int bidir, int edges, int step, | |
int mask_mv0, int mask_mv1, int field) | |
{ | |
__m256i out; | |
__m256i ref0, ref1, ref2, ref3; | |
__m256i tmp0, tmp1; | |
__m256i tmp2, tmp3, tmp4, tmp5; | |
__m256i cnst_0, cnst_1, cnst_2; | |
__m256i zero = __lasx_xvldi(0); | |
__m256i one = __lasx_xvnor_v(zero, zero); | |
int64_t cnst3 = 0x0206020602060206, cnst4 = 0x0103010301030103; | |
if (field) { | |
cnst_0 = __lasx_xvreplgr2vr_d(cnst3); | |
cnst_1 = __lasx_xvreplgr2vr_d(cnst4); | |
cnst_2 = __lasx_xvldi(0x01); | |
} else { | |
DUP2_ARG1(__lasx_xvldi, 0x06, 0x03, cnst_0, cnst_1); | |
cnst_2 = __lasx_xvldi(0x01); | |
} | |
step <<= 3; | |
edges <<= 3; | |
H264_LOOP_FILTER_STRENGTH_ITERATION_LASX(edges, step, mask_mv1, | |
1, -8, zero); | |
H264_LOOP_FILTER_STRENGTH_ITERATION_LASX(32, 8, mask_mv0, 0, -1, one); | |
DUP2_ARG2(__lasx_xvld, (int8_t*)bS, 0, (int8_t*)bS, 16, tmp0, tmp1); | |
DUP2_ARG2(__lasx_xvilvh_d, tmp0, tmp0, tmp1, tmp1, tmp2, tmp3); | |
LASX_TRANSPOSE4x4_H(tmp0, tmp2, tmp1, tmp3, tmp2, tmp3, tmp4, tmp5); | |
__lasx_xvstelm_d(tmp2, (int8_t*)bS, 0, 0); | |
__lasx_xvstelm_d(tmp3, (int8_t*)bS + 8, 0, 0); | |
__lasx_xvstelm_d(tmp4, (int8_t*)bS + 16, 0, 0); | |
__lasx_xvstelm_d(tmp5, (int8_t*)bS + 24, 0, 0); | |
} | |