Files
Shreesh Adiga 58a2dc3c2e avutil/base64: add aarch64 NEON implementation for base64 encode
Add NEON implementation using LD3 to load 48 bytes with de-interleaving
using which 6 bits are extracted using USHR and SLI to get 4 registers, which
is used as a index into lookup table using TBL with 4 registers to translate
into the 64-byte output, which is written using ST4 to interleave.
Add a checkasm test to validate the input lengths from 0 to 239 bytes to cover
all the code paths introduced in the NEON implementation.
Refactored the C implementation into a header file so that it can be used
from checkasm test without having to duplicate the code there.

Observed about 4x speedup by checkasm on A720 core on 1kB input:
C:
 - base64.base64 [OK]
NEON:
 - base64.base64 [OK]
checkasm: all 1 tests passed
Benchmark results:
  name                      nsecs (vs ref)
  av_base64_encode_c:      1286.9
  av_base64_encode_neon:    315.5 ( 4.08x)
2026-09-18 14:20:59 +00:00

27 lines
977 B
C

/*
* 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
*/
#ifndef AVUTIL_AARCH64_BASE64_H
#define AVUTIL_AARCH64_BASE64_H
#include <stdint.h>
char *ff_base64_encode_neon(char *out, const uint8_t *in, int in_size, const char *tbl);
#endif /* AVUTIL_AARCH64_BASE64_H */