perf: improve vectorization optimizations and add function multi-versioning (#1271)

Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
K4YT3X
2024-12-22 05:53:09 -05:00
committed by GitHub
parent f68939c478
commit e1e8ed864d
11 changed files with 116 additions and 52 deletions

View File

@@ -254,6 +254,7 @@ int Encoder::init(
return 0;
}
[[gnu::target_clones("default", "avx2", "avx512f")]]
int Encoder::write_frame(AVFrame *frame, int64_t frame_idx) {
AVFrame *converted_frame = nullptr;
int ret;
@@ -325,6 +326,7 @@ int Encoder::write_frame(AVFrame *frame, int64_t frame_idx) {
return 0;
}
[[gnu::target_clones("default", "avx2", "avx512f")]]
int Encoder::flush() {
int ret;
AVPacket *enc_pkt = av_packet_alloc();