Spaces:
Runtime error
Runtime error
/* | |
* 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 | |
*/ | |
DECLARE_FF_YUVX_TO_ALL_RGBX_FUNCS(yuv420p) | |
DECLARE_FF_YUVX_TO_ALL_RGBX_FUNCS(yuv422p) | |
DECLARE_FF_NVX_TO_ALL_RGBX_FUNCS(nv12) | |
DECLARE_FF_NVX_TO_ALL_RGBX_FUNCS(nv21) | |
/* We need a 16 pixel width alignment. This constraint can easily be removed | |
* for input reading but for the output which is 4-bytes per pixel (RGBA) the | |
* assembly might be writing as much as 4*15=60 extra bytes at the end of the | |
* line, which won't fit the 32-bytes buffer alignment. */ | |
static void get_unscaled_swscale_neon(SwsContext *c) { | |
int accurate_rnd = c->flags & SWS_ACCURATE_RND; | |
SET_FF_NVX_TO_ALL_RGBX_FUNC(nv12, NV12, accurate_rnd); | |
SET_FF_NVX_TO_ALL_RGBX_FUNC(nv21, NV21, accurate_rnd); | |
SET_FF_NVX_TO_ALL_RGBX_FUNC(yuv420p, YUV420P, accurate_rnd); | |
SET_FF_NVX_TO_ALL_RGBX_FUNC(yuv422p, YUV422P, accurate_rnd); | |
} | |
void ff_get_unscaled_swscale_aarch64(SwsContext *c) | |
{ | |
int cpu_flags = av_get_cpu_flags(); | |
if (have_neon(cpu_flags)) | |
get_unscaled_swscale_neon(c); | |
} | |