react-native-audio-api 0.8.0-nightly-5a12f24-20250901 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RNAudioAPI.podspec +15 -6
- package/android/build.gradle +11 -2
- package/android/src/main/cpp/audioapi/CMakeLists.txt +24 -17
- package/android/src/main/cpp/audioapi/android/core/AudioDecoder.cpp +51 -21
- package/android/src/main/jniLibs/arm64-v8a/libavcodec.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libavformat.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libavutil.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libswresample.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libavcodec.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libavformat.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libavutil.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libswresample.so +0 -0
- package/android/src/main/jniLibs/x86/libavcodec.so +0 -0
- package/android/src/main/jniLibs/x86/libavformat.so +0 -0
- package/android/src/main/jniLibs/x86/libavutil.so +0 -0
- package/android/src/main/jniLibs/x86/libswresample.so +0 -0
- package/android/src/main/jniLibs/x86_64/libavcodec.so +0 -0
- package/android/src/main/jniLibs/x86_64/libavformat.so +0 -0
- package/android/src/main/jniLibs/x86_64/libavutil.so +0 -0
- package/android/src/main/jniLibs/x86_64/libswresample.so +0 -0
- package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.h +11 -0
- package/common/cpp/audioapi/HostObjects/StreamerNodeHostObject.h +30 -0
- package/common/cpp/audioapi/core/BaseAudioContext.cpp +9 -0
- package/common/cpp/audioapi/core/BaseAudioContext.h +2 -0
- package/common/cpp/audioapi/core/sources/StreamerNode.cpp +299 -0
- package/common/cpp/audioapi/core/sources/StreamerNode.h +123 -0
- package/common/cpp/audioapi/core/utils/AudioDecoder.h +61 -0
- package/common/cpp/audioapi/core/utils/AudioNodeManager.cpp +14 -2
- package/common/cpp/audioapi/core/utils/AudioNodeManager.h +3 -0
- package/common/cpp/audioapi/external/arm64-v8a/libcrypto.a +0 -0
- package/common/cpp/audioapi/external/arm64-v8a/libssl.a +0 -0
- package/common/cpp/audioapi/external/armeabi-v7a/libcrypto.a +0 -0
- package/common/cpp/audioapi/external/armeabi-v7a/libssl.a +0 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/ac3_parser.h +36 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/adts_parser.h +37 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/avcodec.h +2947 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/avdct.h +88 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/bsf.h +332 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec.h +367 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_desc.h +134 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_id.h +681 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_par.h +248 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/d3d11va.h +109 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/defs.h +359 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dirac.h +135 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dv_profile.h +82 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dxva2.h +90 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/jni.h +67 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/mediacodec.h +103 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/packet.h +907 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/qsv.h +109 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/vdpau.h +138 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/version.h +45 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/version_major.h +55 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/videotoolbox.h +85 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/vorbis_parser.h +74 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavformat/avformat.h +3004 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavformat/avio.h +831 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavformat/version.h +47 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavformat/version_major.h +50 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/adler32.h +63 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/aes.h +69 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/aes_ctr.h +99 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ambient_viewing_environment.h +72 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/attributes.h +175 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/audio_fifo.h +187 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avassert.h +120 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avconfig.h +6 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avstring.h +428 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avutil.h +364 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/base64.h +72 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/blowfish.h +82 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/bprint.h +254 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/bswap.h +105 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/buffer.h +322 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/camellia.h +70 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/cast5.h +80 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/channel_layout.h +762 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/common.h +589 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/container_fifo.h +130 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/cpu.h +150 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/crc.h +102 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/csp.h +192 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/des.h +81 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/detection_bbox.h +108 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/dict.h +242 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/display.h +109 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/dovi_meta.h +396 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/downmix_info.h +115 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/encryption_info.h +205 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/error.h +129 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/eval.h +140 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/executor.h +67 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ffversion.h +5 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/fifo.h +242 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/file.h +62 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/film_grain_params.h +282 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/frame.h +1163 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hash.h +264 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hdr_dynamic_metadata.h +376 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hdr_dynamic_vivid_metadata.h +292 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hmac.h +99 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext.h +601 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_amf.h +46 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_cuda.h +74 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_d3d11va.h +178 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_d3d12va.h +142 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_drm.h +169 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_dxva2.h +75 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_mediacodec.h +61 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_oh.h +34 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_opencl.h +100 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_qsv.h +87 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vaapi.h +117 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vdpau.h +44 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_videotoolbox.h +106 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vulkan.h +377 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/iamf.h +694 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/imgutils.h +377 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/intfloat.h +77 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/intreadwrite.h +677 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/lfg.h +81 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/log.h +427 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/lzo.h +66 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/macros.h +80 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mastering_display_metadata.h +137 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mathematics.h +300 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/md5.h +89 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mem.h +607 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/motion_vector.h +57 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/murmur3.h +115 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/opt.h +1194 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/parseutils.h +197 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixdesc.h +440 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixelutils.h +51 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixfmt.h +797 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/random_seed.h +57 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/rational.h +225 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/rc4.h +69 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/refstruct.h +297 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/replaygain.h +50 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ripemd.h +83 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/samplefmt.h +269 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/sha.h +90 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/sha512.h +92 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/spherical.h +243 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/stereo3d.h +325 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tdrdi.h +164 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tea.h +71 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/threadmessage.h +115 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/timecode.h +199 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/timestamp.h +85 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tree.h +137 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/twofish.h +70 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tx.h +210 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/uuid.h +146 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/version.h +119 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/video_enc_params.h +171 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/video_hint.h +107 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/xtea.h +94 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libswresample/swresample.h +587 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libswresample/version.h +46 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libswresample/version_major.h +31 -0
- package/common/cpp/audioapi/external/libavcodec.xcframework/Info.plist +44 -0
- package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64/libavcodec.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64/libavcodec.framework/libavcodec +0 -0
- package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/libavcodec +0 -0
- package/common/cpp/audioapi/external/libavformat.xcframework/Info.plist +44 -0
- package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64/libavformat.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64/libavformat.framework/libavformat +0 -0
- package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64_x86_64-simulator/libavformat.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64_x86_64-simulator/libavformat.framework/libavformat +0 -0
- package/common/cpp/audioapi/external/libavutil.xcframework/Info.plist +44 -0
- package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64/libavutil.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64/libavutil.framework/libavutil +0 -0
- package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64_x86_64-simulator/libavutil.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64_x86_64-simulator/libavutil.framework/libavutil +0 -0
- package/common/cpp/audioapi/external/libswresample.xcframework/Info.plist +44 -0
- package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64/libswresample.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64/libswresample.framework/libswresample +0 -0
- package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64_x86_64-simulator/libswresample.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64_x86_64-simulator/libswresample.framework/libswresample +0 -0
- package/common/cpp/audioapi/external/x86/libcrypto.a +0 -0
- package/common/cpp/audioapi/external/x86/libssl.a +0 -0
- package/common/cpp/audioapi/external/x86_64/libcrypto.a +0 -0
- package/common/cpp/audioapi/external/x86_64/libssl.a +0 -0
- package/common/cpp/audioapi/libs/ffmpeg/FFmpegDecoding.cpp +402 -0
- package/common/cpp/audioapi/libs/ffmpeg/FFmpegDecoding.h +27 -0
- package/common/cpp/audioapi/libs/ffmpeg/INSTRUCTIONS.md +26 -0
- package/common/cpp/audioapi/libs/ffmpeg/create_xcframework.sh +111 -0
- package/common/cpp/audioapi/libs/ffmpeg/ffmpeg_setup.sh +361 -0
- package/common/cpp/audioapi/utils/SpscChannel.hpp +47 -38
- package/common/cpp/test/CMakeLists.txt +7 -1
- package/ios/audioapi/ios/core/AudioDecoder.mm +22 -2
- package/lib/commonjs/api.js +7 -0
- package/lib/commonjs/api.js.map +1 -1
- package/lib/commonjs/core/AudioContext.js.map +1 -1
- package/lib/commonjs/core/BaseAudioContext.js +4 -0
- package/lib/commonjs/core/BaseAudioContext.js.map +1 -1
- package/lib/commonjs/core/StreamerNode.js +15 -0
- package/lib/commonjs/core/StreamerNode.js.map +1 -0
- package/lib/module/api.js +1 -0
- package/lib/module/api.js.map +1 -1
- package/lib/module/core/AudioContext.js.map +1 -1
- package/lib/module/core/BaseAudioContext.js +4 -0
- package/lib/module/core/BaseAudioContext.js.map +1 -1
- package/lib/module/core/StreamerNode.js +9 -0
- package/lib/module/core/StreamerNode.js.map +1 -0
- package/lib/typescript/api.d.ts +1 -0
- package/lib/typescript/api.d.ts.map +1 -1
- package/lib/typescript/core/AudioContext.d.ts +1 -1
- package/lib/typescript/core/AudioContext.d.ts.map +1 -1
- package/lib/typescript/core/BaseAudioContext.d.ts +2 -0
- package/lib/typescript/core/BaseAudioContext.d.ts.map +1 -1
- package/lib/typescript/core/StreamerNode.d.ts +5 -0
- package/lib/typescript/core/StreamerNode.d.ts.map +1 -0
- package/lib/typescript/interfaces.d.ts +5 -1
- package/lib/typescript/interfaces.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api.ts +1 -0
- package/src/core/AudioContext.ts +1 -1
- package/src/core/BaseAudioContext.ts +5 -0
- package/src/core/StreamerNode.ts +8 -0
- package/src/interfaces.ts +6 -1
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of FFmpeg.
|
|
3
|
+
*
|
|
4
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
5
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
6
|
+
* License as published by the Free Software Foundation; either
|
|
7
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
8
|
+
*
|
|
9
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
12
|
+
* Lesser General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
15
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
16
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
#ifndef AVUTIL_VIDEO_ENC_PARAMS_H
|
|
20
|
+
#define AVUTIL_VIDEO_ENC_PARAMS_H
|
|
21
|
+
|
|
22
|
+
#include <stddef.h>
|
|
23
|
+
#include <stdint.h>
|
|
24
|
+
|
|
25
|
+
#include "libavutil/avassert.h"
|
|
26
|
+
#include "libavutil/frame.h"
|
|
27
|
+
|
|
28
|
+
enum AVVideoEncParamsType {
|
|
29
|
+
AV_VIDEO_ENC_PARAMS_NONE = -1,
|
|
30
|
+
/**
|
|
31
|
+
* VP9 stores:
|
|
32
|
+
* - per-frame base (luma AC) quantizer index, exported as AVVideoEncParams.qp
|
|
33
|
+
* - deltas for luma DC, chroma AC and chroma DC, exported in the
|
|
34
|
+
* corresponding entries in AVVideoEncParams.delta_qp
|
|
35
|
+
* - per-segment delta, exported as for each block as AVVideoBlockParams.delta_qp
|
|
36
|
+
*
|
|
37
|
+
* To compute the resulting quantizer index for a block:
|
|
38
|
+
* - for luma AC, add the base qp and the per-block delta_qp, saturating to
|
|
39
|
+
* unsigned 8-bit.
|
|
40
|
+
* - for luma DC and chroma AC/DC, add the corresponding
|
|
41
|
+
* AVVideoBlockParams.delta_qp to the luma AC index, again saturating to
|
|
42
|
+
* unsigned 8-bit.
|
|
43
|
+
*/
|
|
44
|
+
AV_VIDEO_ENC_PARAMS_VP9,
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* H.264 stores:
|
|
48
|
+
* - in PPS (per-picture):
|
|
49
|
+
* * initial QP_Y (luma) value, exported as AVVideoEncParams.qp
|
|
50
|
+
* * delta(s) for chroma QP values (same for both, or each separately),
|
|
51
|
+
* exported as in the corresponding entries in AVVideoEncParams.delta_qp
|
|
52
|
+
* - per-slice QP delta, not exported directly, added to the per-MB value
|
|
53
|
+
* - per-MB delta; not exported directly; the final per-MB quantizer
|
|
54
|
+
* parameter - QP_Y - minus the value in AVVideoEncParams.qp is exported
|
|
55
|
+
* as AVVideoBlockParams.qp_delta.
|
|
56
|
+
*/
|
|
57
|
+
AV_VIDEO_ENC_PARAMS_H264,
|
|
58
|
+
|
|
59
|
+
/*
|
|
60
|
+
* MPEG-2-compatible quantizer.
|
|
61
|
+
*
|
|
62
|
+
* Summing the frame-level qp with the per-block delta_qp gives the
|
|
63
|
+
* resulting quantizer for the block.
|
|
64
|
+
*/
|
|
65
|
+
AV_VIDEO_ENC_PARAMS_MPEG2,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Video encoding parameters for a given frame. This struct is allocated along
|
|
70
|
+
* with an optional array of per-block AVVideoBlockParams descriptors.
|
|
71
|
+
* Must be allocated with av_video_enc_params_alloc().
|
|
72
|
+
*/
|
|
73
|
+
typedef struct AVVideoEncParams {
|
|
74
|
+
/**
|
|
75
|
+
* Number of blocks in the array.
|
|
76
|
+
*
|
|
77
|
+
* May be 0, in which case no per-block information is present. In this case
|
|
78
|
+
* the values of blocks_offset / block_size are unspecified and should not
|
|
79
|
+
* be accessed.
|
|
80
|
+
*/
|
|
81
|
+
unsigned int nb_blocks;
|
|
82
|
+
/**
|
|
83
|
+
* Offset in bytes from the beginning of this structure at which the array
|
|
84
|
+
* of blocks starts.
|
|
85
|
+
*/
|
|
86
|
+
size_t blocks_offset;
|
|
87
|
+
/*
|
|
88
|
+
* Size of each block in bytes. May not match sizeof(AVVideoBlockParams).
|
|
89
|
+
*/
|
|
90
|
+
size_t block_size;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Type of the parameters (the codec they are used with).
|
|
94
|
+
*/
|
|
95
|
+
enum AVVideoEncParamsType type;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Base quantisation parameter for the frame. The final quantiser for a
|
|
99
|
+
* given block in a given plane is obtained from this value, possibly
|
|
100
|
+
* combined with {@code delta_qp} and the per-block delta in a manner
|
|
101
|
+
* documented for each type.
|
|
102
|
+
*/
|
|
103
|
+
int32_t qp;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Quantisation parameter offset from the base (per-frame) qp for a given
|
|
107
|
+
* plane (first index) and AC/DC coefficients (second index).
|
|
108
|
+
*/
|
|
109
|
+
int32_t delta_qp[4][2];
|
|
110
|
+
} AVVideoEncParams;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Data structure for storing block-level encoding information.
|
|
114
|
+
* It is allocated as a part of AVVideoEncParams and should be retrieved with
|
|
115
|
+
* av_video_enc_params_block().
|
|
116
|
+
*
|
|
117
|
+
* sizeof(AVVideoBlockParams) is not a part of the ABI and new fields may be
|
|
118
|
+
* added to it.
|
|
119
|
+
*/
|
|
120
|
+
typedef struct AVVideoBlockParams {
|
|
121
|
+
/**
|
|
122
|
+
* Distance in luma pixels from the top-left corner of the visible frame
|
|
123
|
+
* to the top-left corner of the block.
|
|
124
|
+
* Can be negative if top/right padding is present on the coded frame.
|
|
125
|
+
*/
|
|
126
|
+
int src_x, src_y;
|
|
127
|
+
/**
|
|
128
|
+
* Width and height of the block in luma pixels.
|
|
129
|
+
*/
|
|
130
|
+
int w, h;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Difference between this block's final quantization parameter and the
|
|
134
|
+
* corresponding per-frame value.
|
|
135
|
+
*/
|
|
136
|
+
int32_t delta_qp;
|
|
137
|
+
} AVVideoBlockParams;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Get the block at the specified {@code idx}. Must be between 0 and nb_blocks - 1.
|
|
141
|
+
*/
|
|
142
|
+
static av_always_inline AVVideoBlockParams*
|
|
143
|
+
av_video_enc_params_block(AVVideoEncParams *par, unsigned int idx)
|
|
144
|
+
{
|
|
145
|
+
av_assert0(idx < par->nb_blocks);
|
|
146
|
+
return (AVVideoBlockParams *)((uint8_t *)par + par->blocks_offset +
|
|
147
|
+
idx * par->block_size);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Allocates memory for AVVideoEncParams of the given type, plus an array of
|
|
152
|
+
* {@code nb_blocks} AVVideoBlockParams and initializes the variables. Can be
|
|
153
|
+
* freed with a normal av_free() call.
|
|
154
|
+
*
|
|
155
|
+
* @param out_size if non-NULL, the size in bytes of the resulting data array is
|
|
156
|
+
* written here.
|
|
157
|
+
*/
|
|
158
|
+
AVVideoEncParams *av_video_enc_params_alloc(enum AVVideoEncParamsType type,
|
|
159
|
+
unsigned int nb_blocks, size_t *out_size);
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Allocates memory for AVEncodeInfoFrame plus an array of
|
|
163
|
+
* {@code nb_blocks} AVEncodeInfoBlock in the given AVFrame {@code frame}
|
|
164
|
+
* as AVFrameSideData of type AV_FRAME_DATA_VIDEO_ENC_PARAMS
|
|
165
|
+
* and initializes the variables.
|
|
166
|
+
*/
|
|
167
|
+
AVVideoEncParams*
|
|
168
|
+
av_video_enc_params_create_side_data(AVFrame *frame, enum AVVideoEncParamsType type,
|
|
169
|
+
unsigned int nb_blocks);
|
|
170
|
+
|
|
171
|
+
#endif /* AVUTIL_VIDEO_ENC_PARAMS_H */
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023 Elias Carotti <eliascrt at amazon dot it>
|
|
3
|
+
*
|
|
4
|
+
* This file is part of FFmpeg.
|
|
5
|
+
*
|
|
6
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
8
|
+
* License as published by the Free Software Foundation; either
|
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
+
* Lesser General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
17
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
18
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
#ifndef AVUTIL_VIDEO_HINT_H
|
|
22
|
+
#define AVUTIL_VIDEO_HINT_H
|
|
23
|
+
|
|
24
|
+
#include <stddef.h>
|
|
25
|
+
#include <stdint.h>
|
|
26
|
+
#include "libavutil/avassert.h"
|
|
27
|
+
#include "libavutil/frame.h"
|
|
28
|
+
|
|
29
|
+
typedef struct AVVideoRect {
|
|
30
|
+
uint32_t x, y;
|
|
31
|
+
uint32_t width, height;
|
|
32
|
+
} AVVideoRect;
|
|
33
|
+
|
|
34
|
+
typedef enum AVVideoHintType {
|
|
35
|
+
/* rectangled delimit the constant areas (unchanged), default is changed */
|
|
36
|
+
AV_VIDEO_HINT_TYPE_CONSTANT,
|
|
37
|
+
|
|
38
|
+
/* rectangled delimit the constant areas (changed), default is not changed */
|
|
39
|
+
AV_VIDEO_HINT_TYPE_CHANGED,
|
|
40
|
+
} AVVideoHintType;
|
|
41
|
+
|
|
42
|
+
typedef struct AVVideoHint {
|
|
43
|
+
/**
|
|
44
|
+
* Number of AVVideoRect present.
|
|
45
|
+
*
|
|
46
|
+
* May be 0, in which case no per-rectangle information is present. In this
|
|
47
|
+
* case the values of rect_offset / rect_size are unspecified and should
|
|
48
|
+
* not be accessed.
|
|
49
|
+
*/
|
|
50
|
+
size_t nb_rects;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Offset in bytes from the beginning of this structure at which the array
|
|
54
|
+
* of AVVideoRect starts.
|
|
55
|
+
*/
|
|
56
|
+
size_t rect_offset;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Size in bytes of AVVideoRect.
|
|
60
|
+
*/
|
|
61
|
+
size_t rect_size;
|
|
62
|
+
|
|
63
|
+
AVVideoHintType type;
|
|
64
|
+
} AVVideoHint;
|
|
65
|
+
|
|
66
|
+
static av_always_inline AVVideoRect *
|
|
67
|
+
av_video_hint_rects(const AVVideoHint *hints) {
|
|
68
|
+
return (AVVideoRect *)((uint8_t *)hints + hints->rect_offset);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static av_always_inline AVVideoRect *
|
|
72
|
+
av_video_hint_get_rect(const AVVideoHint *hints, size_t idx) {
|
|
73
|
+
return (AVVideoRect *)((uint8_t *)hints + hints->rect_offset + idx * hints->rect_size);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Allocate memory for the AVVideoHint struct along with an nb_rects-sized
|
|
78
|
+
* arrays of AVVideoRect.
|
|
79
|
+
*
|
|
80
|
+
* The side data contains a list of rectangles for the portions of the frame
|
|
81
|
+
* which changed from the last encoded one (and the remainder are assumed to be
|
|
82
|
+
* changed), or, alternately (depending on the type parameter) the unchanged
|
|
83
|
+
* ones (and the remanining ones are those which changed).
|
|
84
|
+
* Macroblocks will thus be hinted either to be P_SKIP-ped or go through the
|
|
85
|
+
* regular encoding procedure.
|
|
86
|
+
*
|
|
87
|
+
* It's responsibility of the caller to fill the AVRects accordingly, and to set
|
|
88
|
+
* the proper AVVideoHintType field.
|
|
89
|
+
*
|
|
90
|
+
* @param out_size if non-NULL, the size in bytes of the resulting data array is
|
|
91
|
+
* written here
|
|
92
|
+
*
|
|
93
|
+
* @return newly allocated AVVideoHint struct (must be freed by the caller using
|
|
94
|
+
* av_free()) on success, NULL on memory allocation failure
|
|
95
|
+
*/
|
|
96
|
+
AVVideoHint *av_video_hint_alloc(size_t nb_rects,
|
|
97
|
+
size_t *out_size);
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Same as av_video_hint_alloc(), except newly-allocated AVVideoHint is attached
|
|
101
|
+
* as side data of type AV_FRAME_DATA_VIDEO_HINT_INFO to frame.
|
|
102
|
+
*/
|
|
103
|
+
AVVideoHint *av_video_hint_create_side_data(AVFrame *frame,
|
|
104
|
+
size_t nb_rects);
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
#endif /* AVUTIL_VIDEO_HINT_H */
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A 32-bit implementation of the XTEA algorithm
|
|
3
|
+
* Copyright (c) 2012 Samuel Pitoiset
|
|
4
|
+
*
|
|
5
|
+
* This file is part of FFmpeg.
|
|
6
|
+
*
|
|
7
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
8
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
9
|
+
* License as published by the Free Software Foundation; either
|
|
10
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
15
|
+
* Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
18
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
19
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
#ifndef AVUTIL_XTEA_H
|
|
23
|
+
#define AVUTIL_XTEA_H
|
|
24
|
+
|
|
25
|
+
#include <stdint.h>
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @file
|
|
29
|
+
* @brief Public header for libavutil XTEA algorithm
|
|
30
|
+
* @defgroup lavu_xtea XTEA
|
|
31
|
+
* @ingroup lavu_crypto
|
|
32
|
+
* @{
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
typedef struct AVXTEA {
|
|
36
|
+
uint32_t key[16];
|
|
37
|
+
} AVXTEA;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Allocate an AVXTEA context.
|
|
41
|
+
*/
|
|
42
|
+
AVXTEA *av_xtea_alloc(void);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Initialize an AVXTEA context.
|
|
46
|
+
*
|
|
47
|
+
* @param ctx an AVXTEA context
|
|
48
|
+
* @param key a key of 16 bytes used for encryption/decryption,
|
|
49
|
+
* interpreted as big endian 32 bit numbers
|
|
50
|
+
*/
|
|
51
|
+
void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]);
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Initialize an AVXTEA context.
|
|
55
|
+
*
|
|
56
|
+
* @param ctx an AVXTEA context
|
|
57
|
+
* @param key a key of 16 bytes used for encryption/decryption,
|
|
58
|
+
* interpreted as little endian 32 bit numbers
|
|
59
|
+
*/
|
|
60
|
+
void av_xtea_le_init(struct AVXTEA *ctx, const uint8_t key[16]);
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Encrypt or decrypt a buffer using a previously initialized context,
|
|
64
|
+
* in big endian format.
|
|
65
|
+
*
|
|
66
|
+
* @param ctx an AVXTEA context
|
|
67
|
+
* @param dst destination array, can be equal to src
|
|
68
|
+
* @param src source array, can be equal to dst
|
|
69
|
+
* @param count number of 8 byte blocks
|
|
70
|
+
* @param iv initialization vector for CBC mode, if NULL then ECB will be used
|
|
71
|
+
* @param decrypt 0 for encryption, 1 for decryption
|
|
72
|
+
*/
|
|
73
|
+
void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
|
|
74
|
+
int count, uint8_t *iv, int decrypt);
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Encrypt or decrypt a buffer using a previously initialized context,
|
|
78
|
+
* in little endian format.
|
|
79
|
+
*
|
|
80
|
+
* @param ctx an AVXTEA context
|
|
81
|
+
* @param dst destination array, can be equal to src
|
|
82
|
+
* @param src source array, can be equal to dst
|
|
83
|
+
* @param count number of 8 byte blocks
|
|
84
|
+
* @param iv initialization vector for CBC mode, if NULL then ECB will be used
|
|
85
|
+
* @param decrypt 0 for encryption, 1 for decryption
|
|
86
|
+
*/
|
|
87
|
+
void av_xtea_le_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
|
|
88
|
+
int count, uint8_t *iv, int decrypt);
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @}
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
#endif /* AVUTIL_XTEA_H */
|