diff options
author | Martin Vignali <martin.vignali@gmail.com> | 2017-09-17 21:59:41 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-09-17 17:53:57 -0300 |
commit | 9b8c1224d7e1804b0b750de11e6a8c4648f1e115 (patch) | |
tree | badd352b0822660a1172da30088ad545a530c0c5 /libavcodec/exrdsp.c | |
parent | 08ec828de9663e46fbfe8feef5c15253f841c687 (diff) |
libavcodec/exr : add X86 SIMD for reorder_pixels
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/exrdsp.c')
-rw-r--r-- | libavcodec/exrdsp.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/libavcodec/exrdsp.c b/libavcodec/exrdsp.c new file mode 100644 index 0000000000..e59dac3dc4 --- /dev/null +++ b/libavcodec/exrdsp.c @@ -0,0 +1,47 @@ +/* + * This file is part of FFmpeg. + * + * Copyright (c) 2006 Industrial Light & Magic, a division of Lucas Digital Ltd. LLC + * + * 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 + */ + +#include <stdint.h> + +#include "libavutil/attributes.h" +#include "exrdsp.h" +#include "config.h" + +static void reorder_pixels_scalar(uint8_t *src, uint8_t *dst, ptrdiff_t size) +{ + const uint8_t *t1 = src; + int half_size = size / 2; + const uint8_t *t2 = src + half_size; + uint8_t *s = dst; + int i; + + for (i = 0; i < half_size; i++) { + *(s++) = *(t1++); + *(s++) = *(t2++); + } +} + +av_cold void ff_exrdsp_init(ExrDSPContext *c) +{ + c->reorder_pixels = reorder_pixels_scalar; + + if (ARCH_X86) + ff_exrdsp_init_x86(c); +} |