Introduction to FFmpeg
What's New
- Optimized scaling algorithms (Bilinear, Bicubic, and Lanczos) within the libswscale library of FFmpeg-4.4.2 based on Kunpeng servers.
- Optimized the
sws_scalefunction in the libswscale library of FFmpeg-7.1.1 based on Kunpeng servers.
Overview
Kunpeng FFmpeg optimizes FFmpeg based on Kunpeng servers. It stores patches for FFmpeg performance optimization. The patch provides the following functions:
sws_scaleoptimization: Thesws_scalefunction is one of the core functions of the libswscale library in the FFmpeg framework. It is mainly used for image scaling, color space conversion (CSC), and pixel format conversion. The CSC optimization patch improves performance by parallelizing CSC functions.ffmpeg_4.4.2-optimize-scale.patch: is used to optimize scaling algorithms (Bilinear, Bicubic, and Lanczos) within the libswscale library of FFmpeg-4.4.2. The vectorization customization and rewriting in different scenarios enable SVE vectorization and instruction pipelining, improving the performance of current scaling algorithms.
Directory Structure
├──docs/ # Project document directory
│ ├── en/ # English document directory
│ │ ├── ffmpeg_4.4.2_install_guide.md # FFmpeg-4.4.2_scale installation guide
│ │ ├── LICENSE # Document license
├──patch_for_ffmpeg_4.2.2_to_support_HW265ENC/ # Directory of the HW265 encoder FFmpeg-4.2.2 plugin
├──patch_for_ffmpeg_7.0.1_to_support_HW265ENC/ # Directory of the HW265 encoder FFmpeg-7.0.1 plugin
├──ffmpeg_4.4.2-optimize-scale.patch # FFmpeg-4.4.2 scaling algorithm optimization patch
├──huawei_ffmpeg-7.1.1_sws_scale_optimize.patch # FFmpeg-7.1.1 scaling algorithm optimization patch
├──LICENSE # Open-source license
├──.gitattributes # Git attribute configuration file
├──COPYING.LGPLv2.1 # LGPL v2.1 license text
├──ffmpeg-7.1.1.tar.gz # FFmpeg 7.1.1 source code package
└── README.md # Project description documentFFmpeg 7.1.1 Scaling Optimization
Feature Description
The sws_scale function is one of the core functions of the libswscale library in the FFmpeg framework. It is mainly used for image scaling, color space conversion (CSC), and pixel format conversion. The CSC optimization patch improves performance by parallelizing CSC functions.
Version Description
| Open-Source Software Version | Patch Feature |
|---|---|
| FFmpeg-7.1.1 | sws_scale function optimization |
Environment Deployment
Clone this repository.
git clone https://gitcode.com/boostkit/ffmpeg.git cd ffmpegDecompress the FFmpeg-7.1.1 source code.
tar -zxf ffmpeg-7.1.1.tar.gzCopy the FFmpeg patch to the root directory of the FFmpeg-7.1.1 code.
cp huawei_ffmpeg-7.1.1_sws_scale_optimize.patch ffmpeg-7.1.1/Apply the FFmpeg patch.
cd ffmpeg-7.1.1 patch -p1 < huawei_ffmpeg-7.1.1_sws_scale_optimize.patchCompile FFmpeg. You need to add the corresponding OpenMP options. (The following commands are for reference only. Integrate the corresponding encoding library as required.)
./configure --enable-shared --enable-pthreads --enable-gpl --extra-cflags="-fopenmp" --extra-ldflags="-fopenmp" make sudo make installCheck whether FFmpeg is installed.
export PATH=/usr/local/bin:$PATH export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH ffmpeg -version
FFmpeg 4.4.2 Scaling Optimization
Feature Description
This feature optimizes scaling algorithms (Bilinear, Bicubic, and Lanczos) within the libswscale library of FFmpeg-4.4.2. The vectorization customization and rewriting in different scenarios enable SVE vectorization and instruction pipelining, improving the performance of current scaling algorithms.
Version Description
| Open-Source Software Version | Patch Feature |
|---|---|
| FFmpeg-4.4.2 | Optimization of the Bilinear, Bicubic, and Lanczos algorithms in the sws_scale function |
Environment Deployment
For details about how to deploy the environment for scaling optimization in FFmpeg-4.4.2, see FFmpeg-4.4.2_scale Installation Guide.
Quick Start
# Use the YUV sequence for testing.
taskset -c 88 /home/path/to/ffmpegInstall/bin/ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i /home/path/to/video/Ca4_1920x1080.yuv -vf "scale=1280:720" -sws_flags "bilinear" -pix_fmt yuv420p -y output_1280x720.yuvLicense
This project is licensed under GNU LESSER GENERAL PUBLIC LICENSE 2.1. For details, see LICENSE.
The documents of this project are licensed under CC-BY 4.0. For details, see LICENSE.
Contribution Statement
We welcome your contributions to the community. If you have any questions/suggestions or want to provide feedback on feature requirements and bug reports, you can submit issues. For details, see the contribution guideline. You are also welcome to share insights in Discussions. Thank you for your support.