@drutech/react-native-audio-analyzer 1.1.1-alpha.1
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/LICENSE +20 -0
- package/README.md +124 -0
- package/android/CMakeCache.txt +372 -0
- package/android/CMakeLists.txt +44 -0
- package/android/Makefile +211 -0
- package/android/build.gradle +110 -0
- package/android/cmake_install.cmake +49 -0
- package/android/cpp-adapter.cpp +40 -0
- package/android/ffmpeg_16kb/include/config.h +749 -0
- package/android/ffmpeg_16kb/include/libavcodec/ac3_parser.h +36 -0
- package/android/ffmpeg_16kb/include/libavcodec/adts_parser.h +37 -0
- package/android/ffmpeg_16kb/include/libavcodec/arm/mathops.h +108 -0
- package/android/ffmpeg_16kb/include/libavcodec/avcodec.h +3192 -0
- package/android/ffmpeg_16kb/include/libavcodec/avdct.h +88 -0
- package/android/ffmpeg_16kb/include/libavcodec/avfft.h +118 -0
- package/android/ffmpeg_16kb/include/libavcodec/bsf.h +332 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec.h +375 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec_desc.h +128 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec_id.h +661 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec_par.h +247 -0
- package/android/ffmpeg_16kb/include/libavcodec/d3d11va.h +112 -0
- package/android/ffmpeg_16kb/include/libavcodec/defs.h +192 -0
- package/android/ffmpeg_16kb/include/libavcodec/dirac.h +131 -0
- package/android/ffmpeg_16kb/include/libavcodec/dv_profile.h +82 -0
- package/android/ffmpeg_16kb/include/libavcodec/dxva2.h +93 -0
- package/android/ffmpeg_16kb/include/libavcodec/jni.h +46 -0
- package/android/ffmpeg_16kb/include/libavcodec/mathops.h +255 -0
- package/android/ffmpeg_16kb/include/libavcodec/mediacodec.h +103 -0
- package/android/ffmpeg_16kb/include/libavcodec/packet.h +731 -0
- package/android/ffmpeg_16kb/include/libavcodec/qsv.h +109 -0
- package/android/ffmpeg_16kb/include/libavcodec/vdpau.h +157 -0
- package/android/ffmpeg_16kb/include/libavcodec/version.h +45 -0
- package/android/ffmpeg_16kb/include/libavcodec/version_major.h +52 -0
- package/android/ffmpeg_16kb/include/libavcodec/videotoolbox.h +150 -0
- package/android/ffmpeg_16kb/include/libavcodec/vorbis_parser.h +74 -0
- package/android/ffmpeg_16kb/include/libavcodec/x86/mathops.h +133 -0
- package/android/ffmpeg_16kb/include/libavcodec/xvmc.h +171 -0
- package/android/ffmpeg_16kb/include/libavdevice/avdevice.h +397 -0
- package/android/ffmpeg_16kb/include/libavdevice/version.h +45 -0
- package/android/ffmpeg_16kb/include/libavdevice/version_major.h +36 -0
- package/android/ffmpeg_16kb/include/libavfilter/avfilter.h +1491 -0
- package/android/ffmpeg_16kb/include/libavfilter/buffersink.h +173 -0
- package/android/ffmpeg_16kb/include/libavfilter/buffersrc.h +218 -0
- package/android/ffmpeg_16kb/include/libavfilter/version.h +48 -0
- package/android/ffmpeg_16kb/include/libavfilter/version_major.h +38 -0
- package/android/ffmpeg_16kb/include/libavformat/avformat.h +2826 -0
- package/android/ffmpeg_16kb/include/libavformat/avio.h +837 -0
- package/android/ffmpeg_16kb/include/libavformat/network.h +341 -0
- package/android/ffmpeg_16kb/include/libavformat/os_support.h +317 -0
- package/android/ffmpeg_16kb/include/libavformat/url.h +409 -0
- package/android/ffmpeg_16kb/include/libavformat/version.h +47 -0
- package/android/ffmpeg_16kb/include/libavformat/version_major.h +52 -0
- package/android/ffmpeg_16kb/include/libavutil/aarch64/timer.h +50 -0
- package/android/ffmpeg_16kb/include/libavutil/adler32.h +63 -0
- package/android/ffmpeg_16kb/include/libavutil/aes.h +69 -0
- package/android/ffmpeg_16kb/include/libavutil/aes_ctr.h +99 -0
- package/android/ffmpeg_16kb/include/libavutil/ambient_viewing_environment.h +72 -0
- package/android/ffmpeg_16kb/include/libavutil/arm/timer.h +46 -0
- package/android/ffmpeg_16kb/include/libavutil/attributes.h +173 -0
- package/android/ffmpeg_16kb/include/libavutil/attributes_internal.h +34 -0
- package/android/ffmpeg_16kb/include/libavutil/audio_fifo.h +186 -0
- package/android/ffmpeg_16kb/include/libavutil/avassert.h +75 -0
- package/android/ffmpeg_16kb/include/libavutil/avconfig.h +6 -0
- package/android/ffmpeg_16kb/include/libavutil/avstring.h +429 -0
- package/android/ffmpeg_16kb/include/libavutil/avutil.h +371 -0
- package/android/ffmpeg_16kb/include/libavutil/base64.h +72 -0
- package/android/ffmpeg_16kb/include/libavutil/blowfish.h +82 -0
- package/android/ffmpeg_16kb/include/libavutil/bprint.h +251 -0
- package/android/ffmpeg_16kb/include/libavutil/bswap.h +111 -0
- package/android/ffmpeg_16kb/include/libavutil/buffer.h +322 -0
- package/android/ffmpeg_16kb/include/libavutil/camellia.h +70 -0
- package/android/ffmpeg_16kb/include/libavutil/cast5.h +80 -0
- package/android/ffmpeg_16kb/include/libavutil/channel_layout.h +783 -0
- package/android/ffmpeg_16kb/include/libavutil/common.h +578 -0
- package/android/ffmpeg_16kb/include/libavutil/cpu.h +134 -0
- package/android/ffmpeg_16kb/include/libavutil/crc.h +102 -0
- package/android/ffmpeg_16kb/include/libavutil/csp.h +150 -0
- package/android/ffmpeg_16kb/include/libavutil/des.h +81 -0
- package/android/ffmpeg_16kb/include/libavutil/detection_bbox.h +108 -0
- package/android/ffmpeg_16kb/include/libavutil/dict.h +241 -0
- package/android/ffmpeg_16kb/include/libavutil/display.h +109 -0
- package/android/ffmpeg_16kb/include/libavutil/dovi_meta.h +236 -0
- package/android/ffmpeg_16kb/include/libavutil/downmix_info.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/encryption_info.h +205 -0
- package/android/ffmpeg_16kb/include/libavutil/error.h +128 -0
- package/android/ffmpeg_16kb/include/libavutil/eval.h +140 -0
- package/android/ffmpeg_16kb/include/libavutil/ffversion.h +5 -0
- package/android/ffmpeg_16kb/include/libavutil/fifo.h +448 -0
- package/android/ffmpeg_16kb/include/libavutil/file.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/film_grain_params.h +260 -0
- package/android/ffmpeg_16kb/include/libavutil/frame.h +964 -0
- package/android/ffmpeg_16kb/include/libavutil/getenv_utf8.h +86 -0
- package/android/ffmpeg_16kb/include/libavutil/hash.h +264 -0
- package/android/ffmpeg_16kb/include/libavutil/hdr_dynamic_metadata.h +343 -0
- package/android/ffmpeg_16kb/include/libavutil/hdr_dynamic_vivid_metadata.h +285 -0
- package/android/ffmpeg_16kb/include/libavutil/hmac.h +99 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext.h +610 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_cuda.h +69 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_d3d11va.h +178 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_drm.h +169 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_dxva2.h +75 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_mediacodec.h +61 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_opencl.h +100 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_qsv.h +64 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_vaapi.h +117 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_vdpau.h +44 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_videotoolbox.h +96 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_vulkan.h +281 -0
- package/android/ffmpeg_16kb/include/libavutil/imgutils.h +331 -0
- package/android/ffmpeg_16kb/include/libavutil/internal.h +190 -0
- package/android/ffmpeg_16kb/include/libavutil/intfloat.h +77 -0
- package/android/ffmpeg_16kb/include/libavutil/intreadwrite.h +644 -0
- package/android/ffmpeg_16kb/include/libavutil/lfg.h +81 -0
- package/android/ffmpeg_16kb/include/libavutil/libm.h +471 -0
- package/android/ffmpeg_16kb/include/libavutil/log.h +387 -0
- package/android/ffmpeg_16kb/include/libavutil/lzo.h +66 -0
- package/android/ffmpeg_16kb/include/libavutil/macros.h +80 -0
- package/android/ffmpeg_16kb/include/libavutil/mastering_display_metadata.h +128 -0
- package/android/ffmpeg_16kb/include/libavutil/mathematics.h +245 -0
- package/android/ffmpeg_16kb/include/libavutil/md5.h +89 -0
- package/android/ffmpeg_16kb/include/libavutil/mem.h +609 -0
- package/android/ffmpeg_16kb/include/libavutil/motion_vector.h +57 -0
- package/android/ffmpeg_16kb/include/libavutil/murmur3.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/opt.h +891 -0
- package/android/ffmpeg_16kb/include/libavutil/parseutils.h +197 -0
- package/android/ffmpeg_16kb/include/libavutil/pixdesc.h +435 -0
- package/android/ffmpeg_16kb/include/libavutil/pixelutils.h +51 -0
- package/android/ffmpeg_16kb/include/libavutil/pixfmt.h +691 -0
- package/android/ffmpeg_16kb/include/libavutil/random_seed.h +43 -0
- package/android/ffmpeg_16kb/include/libavutil/rational.h +221 -0
- package/android/ffmpeg_16kb/include/libavutil/rc4.h +69 -0
- package/android/ffmpeg_16kb/include/libavutil/replaygain.h +50 -0
- package/android/ffmpeg_16kb/include/libavutil/reverse.h +28 -0
- package/android/ffmpeg_16kb/include/libavutil/ripemd.h +83 -0
- package/android/ffmpeg_16kb/include/libavutil/samplefmt.h +269 -0
- package/android/ffmpeg_16kb/include/libavutil/sha.h +90 -0
- package/android/ffmpeg_16kb/include/libavutil/sha512.h +92 -0
- package/android/ffmpeg_16kb/include/libavutil/spherical.h +227 -0
- package/android/ffmpeg_16kb/include/libavutil/stereo3d.h +229 -0
- package/android/ffmpeg_16kb/include/libavutil/tea.h +71 -0
- package/android/ffmpeg_16kb/include/libavutil/thread.h +204 -0
- package/android/ffmpeg_16kb/include/libavutil/threadmessage.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/time.h +56 -0
- package/android/ffmpeg_16kb/include/libavutil/timecode.h +199 -0
- package/android/ffmpeg_16kb/include/libavutil/timer.h +156 -0
- package/android/ffmpeg_16kb/include/libavutil/timestamp.h +78 -0
- package/android/ffmpeg_16kb/include/libavutil/tree.h +137 -0
- package/android/ffmpeg_16kb/include/libavutil/twofish.h +70 -0
- package/android/ffmpeg_16kb/include/libavutil/tx.h +176 -0
- package/android/ffmpeg_16kb/include/libavutil/uuid.h +146 -0
- package/android/ffmpeg_16kb/include/libavutil/version.h +122 -0
- package/android/ffmpeg_16kb/include/libavutil/video_enc_params.h +171 -0
- package/android/ffmpeg_16kb/include/libavutil/x86/asm.h +154 -0
- package/android/ffmpeg_16kb/include/libavutil/x86/emms.h +58 -0
- package/android/ffmpeg_16kb/include/libavutil/x86/timer.h +50 -0
- package/android/ffmpeg_16kb/include/libavutil/xtea.h +94 -0
- package/android/ffmpeg_16kb/include/libswresample/swresample.h +650 -0
- package/android/ffmpeg_16kb/include/libswresample/version.h +46 -0
- package/android/ffmpeg_16kb/include/libswresample/version_major.h +31 -0
- package/android/ffmpeg_16kb/include/libswscale/swscale.h +436 -0
- package/android/ffmpeg_16kb/include/libswscale/version.h +44 -0
- package/android/ffmpeg_16kb/include/libswscale/version_major.h +35 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavcodec.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavdevice.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavfilter.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavformat.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavutil.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libswresample.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libswscale.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavcodec_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavdevice_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavfilter_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavformat_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavutil_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libswresample_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libswscale_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavcodec.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavdevice.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavfilter.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavformat.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavutil.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libswresample.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libswscale.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavcodec.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavdevice.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavfilter.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavformat.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavutil.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libswresample.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libswscale.so +0 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/audioanalyzer/AmplitudeData.java +20 -0
- package/android/src/main/java/com/audioanalyzer/AudioAnalyzerModule.java +52 -0
- package/android/src/main/java/com/audioanalyzer/AudioAnalyzerPackage.java +28 -0
- package/cpp/react-native-audio-analyzer.cpp +143 -0
- package/cpp/react-native-audio-analyzer.h +27 -0
- package/ios/AudioAnalyzer.h +19 -0
- package/ios/AudioAnalyzer.mm +43 -0
- package/lib/commonjs/helpers.js +34 -0
- package/lib/commonjs/helpers.js.map +1 -0
- package/lib/commonjs/helpers.test.js +49 -0
- package/lib/commonjs/helpers.test.js.map +1 -0
- package/lib/commonjs/index.js +35 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/helpers.js +27 -0
- package/lib/module/helpers.js.map +1 -0
- package/lib/module/helpers.test.js +47 -0
- package/lib/module/helpers.test.js.map +1 -0
- package/lib/module/index.js +15 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/src/helpers.d.ts +3 -0
- package/lib/typescript/src/helpers.d.ts.map +1 -0
- package/lib/typescript/src/helpers.test.d.ts +2 -0
- package/lib/typescript/src/helpers.test.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +7 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +163 -0
- package/react-native-audio-analyzer.podspec +44 -0
- package/src/helpers.test.ts +59 -0
- package/src/helpers.ts +34 -0
- package/src/index.tsx +30 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Codec parameters public API
|
|
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 AVCODEC_CODEC_PAR_H
|
|
22
|
+
#define AVCODEC_CODEC_PAR_H
|
|
23
|
+
|
|
24
|
+
#include <stdint.h>
|
|
25
|
+
|
|
26
|
+
#include "libavutil/avutil.h"
|
|
27
|
+
#include "libavutil/channel_layout.h"
|
|
28
|
+
#include "libavutil/rational.h"
|
|
29
|
+
#include "libavutil/pixfmt.h"
|
|
30
|
+
|
|
31
|
+
#include "codec_id.h"
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @addtogroup lavc_core
|
|
35
|
+
* @{
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
enum AVFieldOrder {
|
|
39
|
+
AV_FIELD_UNKNOWN,
|
|
40
|
+
AV_FIELD_PROGRESSIVE,
|
|
41
|
+
AV_FIELD_TT, ///< Top coded_first, top displayed first
|
|
42
|
+
AV_FIELD_BB, ///< Bottom coded first, bottom displayed first
|
|
43
|
+
AV_FIELD_TB, ///< Top coded first, bottom displayed first
|
|
44
|
+
AV_FIELD_BT, ///< Bottom coded first, top displayed first
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* This struct describes the properties of an encoded stream.
|
|
49
|
+
*
|
|
50
|
+
* sizeof(AVCodecParameters) is not a part of the public ABI, this struct must
|
|
51
|
+
* be allocated with avcodec_parameters_alloc() and freed with
|
|
52
|
+
* avcodec_parameters_free().
|
|
53
|
+
*/
|
|
54
|
+
typedef struct AVCodecParameters {
|
|
55
|
+
/**
|
|
56
|
+
* General type of the encoded data.
|
|
57
|
+
*/
|
|
58
|
+
enum AVMediaType codec_type;
|
|
59
|
+
/**
|
|
60
|
+
* Specific type of the encoded data (the codec used).
|
|
61
|
+
*/
|
|
62
|
+
enum AVCodecID codec_id;
|
|
63
|
+
/**
|
|
64
|
+
* Additional information about the codec (corresponds to the AVI FOURCC).
|
|
65
|
+
*/
|
|
66
|
+
uint32_t codec_tag;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Extra binary data needed for initializing the decoder, codec-dependent.
|
|
70
|
+
*
|
|
71
|
+
* Must be allocated with av_malloc() and will be freed by
|
|
72
|
+
* avcodec_parameters_free(). The allocated size of extradata must be at
|
|
73
|
+
* least extradata_size + AV_INPUT_BUFFER_PADDING_SIZE, with the padding
|
|
74
|
+
* bytes zeroed.
|
|
75
|
+
*/
|
|
76
|
+
uint8_t *extradata;
|
|
77
|
+
/**
|
|
78
|
+
* Size of the extradata content in bytes.
|
|
79
|
+
*/
|
|
80
|
+
int extradata_size;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* - video: the pixel format, the value corresponds to enum AVPixelFormat.
|
|
84
|
+
* - audio: the sample format, the value corresponds to enum AVSampleFormat.
|
|
85
|
+
*/
|
|
86
|
+
int format;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The average bitrate of the encoded data (in bits per second).
|
|
90
|
+
*/
|
|
91
|
+
int64_t bit_rate;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The number of bits per sample in the codedwords.
|
|
95
|
+
*
|
|
96
|
+
* This is basically the bitrate per sample. It is mandatory for a bunch of
|
|
97
|
+
* formats to actually decode them. It's the number of bits for one sample in
|
|
98
|
+
* the actual coded bitstream.
|
|
99
|
+
*
|
|
100
|
+
* This could be for example 4 for ADPCM
|
|
101
|
+
* For PCM formats this matches bits_per_raw_sample
|
|
102
|
+
* Can be 0
|
|
103
|
+
*/
|
|
104
|
+
int bits_per_coded_sample;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* This is the number of valid bits in each output sample. If the
|
|
108
|
+
* sample format has more bits, the least significant bits are additional
|
|
109
|
+
* padding bits, which are always 0. Use right shifts to reduce the sample
|
|
110
|
+
* to its actual size. For example, audio formats with 24 bit samples will
|
|
111
|
+
* have bits_per_raw_sample set to 24, and format set to AV_SAMPLE_FMT_S32.
|
|
112
|
+
* To get the original sample use "(int32_t)sample >> 8"."
|
|
113
|
+
*
|
|
114
|
+
* For ADPCM this might be 12 or 16 or similar
|
|
115
|
+
* Can be 0
|
|
116
|
+
*/
|
|
117
|
+
int bits_per_raw_sample;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Codec-specific bitstream restrictions that the stream conforms to.
|
|
121
|
+
*/
|
|
122
|
+
int profile;
|
|
123
|
+
int level;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Video only. The dimensions of the video frame in pixels.
|
|
127
|
+
*/
|
|
128
|
+
int width;
|
|
129
|
+
int height;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Video only. The aspect ratio (width / height) which a single pixel
|
|
133
|
+
* should have when displayed.
|
|
134
|
+
*
|
|
135
|
+
* When the aspect ratio is unknown / undefined, the numerator should be
|
|
136
|
+
* set to 0 (the denominator may have any value).
|
|
137
|
+
*/
|
|
138
|
+
AVRational sample_aspect_ratio;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Video only. The order of the fields in interlaced video.
|
|
142
|
+
*/
|
|
143
|
+
enum AVFieldOrder field_order;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Video only. Additional colorspace characteristics.
|
|
147
|
+
*/
|
|
148
|
+
enum AVColorRange color_range;
|
|
149
|
+
enum AVColorPrimaries color_primaries;
|
|
150
|
+
enum AVColorTransferCharacteristic color_trc;
|
|
151
|
+
enum AVColorSpace color_space;
|
|
152
|
+
enum AVChromaLocation chroma_location;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Video only. Number of delayed frames.
|
|
156
|
+
*/
|
|
157
|
+
int video_delay;
|
|
158
|
+
|
|
159
|
+
#if FF_API_OLD_CHANNEL_LAYOUT
|
|
160
|
+
/**
|
|
161
|
+
* Audio only. The channel layout bitmask. May be 0 if the channel layout is
|
|
162
|
+
* unknown or unspecified, otherwise the number of bits set must be equal to
|
|
163
|
+
* the channels field.
|
|
164
|
+
* @deprecated use ch_layout
|
|
165
|
+
*/
|
|
166
|
+
attribute_deprecated
|
|
167
|
+
uint64_t channel_layout;
|
|
168
|
+
/**
|
|
169
|
+
* Audio only. The number of audio channels.
|
|
170
|
+
* @deprecated use ch_layout.nb_channels
|
|
171
|
+
*/
|
|
172
|
+
attribute_deprecated
|
|
173
|
+
int channels;
|
|
174
|
+
#endif
|
|
175
|
+
/**
|
|
176
|
+
* Audio only. The number of audio samples per second.
|
|
177
|
+
*/
|
|
178
|
+
int sample_rate;
|
|
179
|
+
/**
|
|
180
|
+
* Audio only. The number of bytes per coded audio frame, required by some
|
|
181
|
+
* formats.
|
|
182
|
+
*
|
|
183
|
+
* Corresponds to nBlockAlign in WAVEFORMATEX.
|
|
184
|
+
*/
|
|
185
|
+
int block_align;
|
|
186
|
+
/**
|
|
187
|
+
* Audio only. Audio frame size, if known. Required by some formats to be static.
|
|
188
|
+
*/
|
|
189
|
+
int frame_size;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Audio only. The amount of padding (in samples) inserted by the encoder at
|
|
193
|
+
* the beginning of the audio. I.e. this number of leading decoded samples
|
|
194
|
+
* must be discarded by the caller to get the original audio without leading
|
|
195
|
+
* padding.
|
|
196
|
+
*/
|
|
197
|
+
int initial_padding;
|
|
198
|
+
/**
|
|
199
|
+
* Audio only. The amount of padding (in samples) appended by the encoder to
|
|
200
|
+
* the end of the audio. I.e. this number of decoded samples must be
|
|
201
|
+
* discarded by the caller from the end of the stream to get the original
|
|
202
|
+
* audio without any trailing padding.
|
|
203
|
+
*/
|
|
204
|
+
int trailing_padding;
|
|
205
|
+
/**
|
|
206
|
+
* Audio only. Number of samples to skip after a discontinuity.
|
|
207
|
+
*/
|
|
208
|
+
int seek_preroll;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Audio only. The channel layout and number of channels.
|
|
212
|
+
*/
|
|
213
|
+
AVChannelLayout ch_layout;
|
|
214
|
+
} AVCodecParameters;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Allocate a new AVCodecParameters and set its fields to default values
|
|
218
|
+
* (unknown/invalid/0). The returned struct must be freed with
|
|
219
|
+
* avcodec_parameters_free().
|
|
220
|
+
*/
|
|
221
|
+
AVCodecParameters *avcodec_parameters_alloc(void);
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Free an AVCodecParameters instance and everything associated with it and
|
|
225
|
+
* write NULL to the supplied pointer.
|
|
226
|
+
*/
|
|
227
|
+
void avcodec_parameters_free(AVCodecParameters **par);
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Copy the contents of src to dst. Any allocated fields in dst are freed and
|
|
231
|
+
* replaced with newly allocated duplicates of the corresponding fields in src.
|
|
232
|
+
*
|
|
233
|
+
* @return >= 0 on success, a negative AVERROR code on failure.
|
|
234
|
+
*/
|
|
235
|
+
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src);
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* This function is the same as av_get_audio_frame_duration(), except it works
|
|
239
|
+
* with AVCodecParameters instead of an AVCodecContext.
|
|
240
|
+
*/
|
|
241
|
+
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes);
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* @}
|
|
245
|
+
*/
|
|
246
|
+
|
|
247
|
+
#endif // AVCODEC_CODEC_PAR_H
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Direct3D11 HW acceleration
|
|
3
|
+
*
|
|
4
|
+
* copyright (c) 2009 Laurent Aimar
|
|
5
|
+
* copyright (c) 2015 Steve Lhomme
|
|
6
|
+
*
|
|
7
|
+
* This file is part of FFmpeg.
|
|
8
|
+
*
|
|
9
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
10
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
11
|
+
* License as published by the Free Software Foundation; either
|
|
12
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
17
|
+
* Lesser General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
20
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
21
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
#ifndef AVCODEC_D3D11VA_H
|
|
25
|
+
#define AVCODEC_D3D11VA_H
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @file
|
|
29
|
+
* @ingroup lavc_codec_hwaccel_d3d11va
|
|
30
|
+
* Public libavcodec D3D11VA header.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602
|
|
34
|
+
#undef _WIN32_WINNT
|
|
35
|
+
#define _WIN32_WINNT 0x0602
|
|
36
|
+
#endif
|
|
37
|
+
|
|
38
|
+
#include <stdint.h>
|
|
39
|
+
#include <d3d11.h>
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @defgroup lavc_codec_hwaccel_d3d11va Direct3D11
|
|
43
|
+
* @ingroup lavc_codec_hwaccel
|
|
44
|
+
*
|
|
45
|
+
* @{
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for Direct3D11 and old UVD/UVD+ ATI video cards
|
|
49
|
+
#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for Direct3D11 and old Intel GPUs with ClearVideo interface
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* This structure is used to provides the necessary configurations and data
|
|
53
|
+
* to the Direct3D11 FFmpeg HWAccel implementation.
|
|
54
|
+
*
|
|
55
|
+
* The application must make it available as AVCodecContext.hwaccel_context.
|
|
56
|
+
*
|
|
57
|
+
* Use av_d3d11va_alloc_context() exclusively to allocate an AVD3D11VAContext.
|
|
58
|
+
*/
|
|
59
|
+
typedef struct AVD3D11VAContext {
|
|
60
|
+
/**
|
|
61
|
+
* D3D11 decoder object
|
|
62
|
+
*/
|
|
63
|
+
ID3D11VideoDecoder *decoder;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* D3D11 VideoContext
|
|
67
|
+
*/
|
|
68
|
+
ID3D11VideoContext *video_context;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* D3D11 configuration used to create the decoder
|
|
72
|
+
*/
|
|
73
|
+
D3D11_VIDEO_DECODER_CONFIG *cfg;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The number of surface in the surface array
|
|
77
|
+
*/
|
|
78
|
+
unsigned surface_count;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The array of Direct3D surfaces used to create the decoder
|
|
82
|
+
*/
|
|
83
|
+
ID3D11VideoDecoderOutputView **surface;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* A bit field configuring the workarounds needed for using the decoder
|
|
87
|
+
*/
|
|
88
|
+
uint64_t workaround;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Private to the FFmpeg AVHWAccel implementation
|
|
92
|
+
*/
|
|
93
|
+
unsigned report_id;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Mutex to access video_context
|
|
97
|
+
*/
|
|
98
|
+
HANDLE context_mutex;
|
|
99
|
+
} AVD3D11VAContext;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Allocate an AVD3D11VAContext.
|
|
103
|
+
*
|
|
104
|
+
* @return Newly-allocated AVD3D11VAContext or NULL on failure.
|
|
105
|
+
*/
|
|
106
|
+
AVD3D11VAContext *av_d3d11va_alloc_context(void);
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @}
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
#endif /* AVCODEC_D3D11VA_H */
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* This file is part of FFmpeg.
|
|
4
|
+
*
|
|
5
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
6
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
7
|
+
* License as published by the Free Software Foundation; either
|
|
8
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
13
|
+
* Lesser General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
16
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
17
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#ifndef AVCODEC_DEFS_H
|
|
21
|
+
#define AVCODEC_DEFS_H
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @file
|
|
25
|
+
* @ingroup libavc
|
|
26
|
+
* Misc types and constants that do not belong anywhere else.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
#include <stdint.h>
|
|
30
|
+
#include <stdlib.h>
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @ingroup lavc_decoding
|
|
34
|
+
* Required number of additionally allocated bytes at the end of the input bitstream for decoding.
|
|
35
|
+
* This is mainly needed because some optimized bitstream readers read
|
|
36
|
+
* 32 or 64 bit at once and could read over the end.<br>
|
|
37
|
+
* Note: If the first 23 bits of the additional bytes are not 0, then damaged
|
|
38
|
+
* MPEG bitstreams could cause overread and segfault.
|
|
39
|
+
*/
|
|
40
|
+
#define AV_INPUT_BUFFER_PADDING_SIZE 64
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Verify checksums embedded in the bitstream (could be of either encoded or
|
|
44
|
+
* decoded data, depending on the format) and print an error message on mismatch.
|
|
45
|
+
* If AV_EF_EXPLODE is also set, a mismatching checksum will result in the
|
|
46
|
+
* decoder/demuxer returning an error.
|
|
47
|
+
*/
|
|
48
|
+
#define AV_EF_CRCCHECK (1<<0)
|
|
49
|
+
#define AV_EF_BITSTREAM (1<<1) ///< detect bitstream specification deviations
|
|
50
|
+
#define AV_EF_BUFFER (1<<2) ///< detect improper bitstream length
|
|
51
|
+
#define AV_EF_EXPLODE (1<<3) ///< abort decoding on minor error detection
|
|
52
|
+
|
|
53
|
+
#define AV_EF_IGNORE_ERR (1<<15) ///< ignore errors and continue
|
|
54
|
+
#define AV_EF_CAREFUL (1<<16) ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors
|
|
55
|
+
#define AV_EF_COMPLIANT (1<<17) ///< consider all spec non compliances as errors
|
|
56
|
+
#define AV_EF_AGGRESSIVE (1<<18) ///< consider things that a sane encoder/muxer should not do as an error
|
|
57
|
+
|
|
58
|
+
#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software.
|
|
59
|
+
#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences.
|
|
60
|
+
#define FF_COMPLIANCE_NORMAL 0
|
|
61
|
+
#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions
|
|
62
|
+
#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @ingroup lavc_decoding
|
|
66
|
+
*/
|
|
67
|
+
enum AVDiscard{
|
|
68
|
+
/* We leave some space between them for extensions (drop some
|
|
69
|
+
* keyframes for intra-only or drop just some bidir frames). */
|
|
70
|
+
AVDISCARD_NONE =-16, ///< discard nothing
|
|
71
|
+
AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi
|
|
72
|
+
AVDISCARD_NONREF = 8, ///< discard all non reference
|
|
73
|
+
AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames
|
|
74
|
+
AVDISCARD_NONINTRA= 24, ///< discard all non intra frames
|
|
75
|
+
AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
|
|
76
|
+
AVDISCARD_ALL = 48, ///< discard all
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
enum AVAudioServiceType {
|
|
80
|
+
AV_AUDIO_SERVICE_TYPE_MAIN = 0,
|
|
81
|
+
AV_AUDIO_SERVICE_TYPE_EFFECTS = 1,
|
|
82
|
+
AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
|
|
83
|
+
AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3,
|
|
84
|
+
AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4,
|
|
85
|
+
AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5,
|
|
86
|
+
AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6,
|
|
87
|
+
AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7,
|
|
88
|
+
AV_AUDIO_SERVICE_TYPE_KARAOKE = 8,
|
|
89
|
+
AV_AUDIO_SERVICE_TYPE_NB , ///< Not part of ABI
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Pan Scan area.
|
|
94
|
+
* This specifies the area which should be displayed.
|
|
95
|
+
* Note there may be multiple such areas for one frame.
|
|
96
|
+
*/
|
|
97
|
+
typedef struct AVPanScan {
|
|
98
|
+
/**
|
|
99
|
+
* id
|
|
100
|
+
* - encoding: Set by user.
|
|
101
|
+
* - decoding: Set by libavcodec.
|
|
102
|
+
*/
|
|
103
|
+
int id;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* width and height in 1/16 pel
|
|
107
|
+
* - encoding: Set by user.
|
|
108
|
+
* - decoding: Set by libavcodec.
|
|
109
|
+
*/
|
|
110
|
+
int width;
|
|
111
|
+
int height;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* position of the top left corner in 1/16 pel for up to 3 fields/frames
|
|
115
|
+
* - encoding: Set by user.
|
|
116
|
+
* - decoding: Set by libavcodec.
|
|
117
|
+
*/
|
|
118
|
+
int16_t position[3][2];
|
|
119
|
+
} AVPanScan;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* This structure describes the bitrate properties of an encoded bitstream. It
|
|
123
|
+
* roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD
|
|
124
|
+
* parameters for H.264/HEVC.
|
|
125
|
+
*/
|
|
126
|
+
typedef struct AVCPBProperties {
|
|
127
|
+
/**
|
|
128
|
+
* Maximum bitrate of the stream, in bits per second.
|
|
129
|
+
* Zero if unknown or unspecified.
|
|
130
|
+
*/
|
|
131
|
+
int64_t max_bitrate;
|
|
132
|
+
/**
|
|
133
|
+
* Minimum bitrate of the stream, in bits per second.
|
|
134
|
+
* Zero if unknown or unspecified.
|
|
135
|
+
*/
|
|
136
|
+
int64_t min_bitrate;
|
|
137
|
+
/**
|
|
138
|
+
* Average bitrate of the stream, in bits per second.
|
|
139
|
+
* Zero if unknown or unspecified.
|
|
140
|
+
*/
|
|
141
|
+
int64_t avg_bitrate;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The size of the buffer to which the ratecontrol is applied, in bits.
|
|
145
|
+
* Zero if unknown or unspecified.
|
|
146
|
+
*/
|
|
147
|
+
int64_t buffer_size;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* The delay between the time the packet this structure is associated with
|
|
151
|
+
* is received and the time when it should be decoded, in periods of a 27MHz
|
|
152
|
+
* clock.
|
|
153
|
+
*
|
|
154
|
+
* UINT64_MAX when unknown or unspecified.
|
|
155
|
+
*/
|
|
156
|
+
uint64_t vbv_delay;
|
|
157
|
+
} AVCPBProperties;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Allocate a CPB properties structure and initialize its fields to default
|
|
161
|
+
* values.
|
|
162
|
+
*
|
|
163
|
+
* @param size if non-NULL, the size of the allocated struct will be written
|
|
164
|
+
* here. This is useful for embedding it in side data.
|
|
165
|
+
*
|
|
166
|
+
* @return the newly allocated struct or NULL on failure
|
|
167
|
+
*/
|
|
168
|
+
AVCPBProperties *av_cpb_properties_alloc(size_t *size);
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* This structure supplies correlation between a packet timestamp and a wall clock
|
|
172
|
+
* production time. The definition follows the Producer Reference Time ('prft')
|
|
173
|
+
* as defined in ISO/IEC 14496-12
|
|
174
|
+
*/
|
|
175
|
+
typedef struct AVProducerReferenceTime {
|
|
176
|
+
/**
|
|
177
|
+
* A UTC timestamp, in microseconds, since Unix epoch (e.g, av_gettime()).
|
|
178
|
+
*/
|
|
179
|
+
int64_t wallclock;
|
|
180
|
+
int flags;
|
|
181
|
+
} AVProducerReferenceTime;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Encode extradata length to a buffer. Used by xiph codecs.
|
|
185
|
+
*
|
|
186
|
+
* @param s buffer to write to; must be at least (v/255+1) bytes long
|
|
187
|
+
* @param v size of extradata in bytes
|
|
188
|
+
* @return number of bytes written to the buffer.
|
|
189
|
+
*/
|
|
190
|
+
unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
|
|
191
|
+
|
|
192
|
+
#endif // AVCODEC_DEFS_H
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2007 Marco Gerards <marco@gnu.org>
|
|
3
|
+
* Copyright (C) 2009 David Conrad
|
|
4
|
+
* Copyright (C) 2011 Jordi Ortiz
|
|
5
|
+
*
|
|
6
|
+
* This file is part of FFmpeg.
|
|
7
|
+
*
|
|
8
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
9
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
10
|
+
* License as published by the Free Software Foundation; either
|
|
11
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
16
|
+
* Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
19
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
20
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
#ifndef AVCODEC_DIRAC_H
|
|
24
|
+
#define AVCODEC_DIRAC_H
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @file
|
|
28
|
+
* Interface to Dirac Decoder/Encoder
|
|
29
|
+
* @author Marco Gerards <marco@gnu.org>
|
|
30
|
+
* @author David Conrad
|
|
31
|
+
* @author Jordi Ortiz
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
#include "avcodec.h"
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The spec limits the number of wavelet decompositions to 4 for both
|
|
38
|
+
* level 1 (VC-2) and 128 (long-gop default).
|
|
39
|
+
* 5 decompositions is the maximum before >16-bit buffers are needed.
|
|
40
|
+
* Schroedinger allows this for DD 9,7 and 13,7 wavelets only, limiting
|
|
41
|
+
* the others to 4 decompositions (or 3 for the fidelity filter).
|
|
42
|
+
*
|
|
43
|
+
* We use this instead of MAX_DECOMPOSITIONS to save some memory.
|
|
44
|
+
*/
|
|
45
|
+
#define MAX_DWT_LEVELS 5
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Parse code values:
|
|
49
|
+
*
|
|
50
|
+
* Dirac Specification ->
|
|
51
|
+
* 9.6.1 Table 9.1
|
|
52
|
+
*
|
|
53
|
+
* VC-2 Specification ->
|
|
54
|
+
* 10.4.1 Table 10.1
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
enum DiracParseCodes {
|
|
58
|
+
DIRAC_PCODE_SEQ_HEADER = 0x00,
|
|
59
|
+
DIRAC_PCODE_END_SEQ = 0x10,
|
|
60
|
+
DIRAC_PCODE_AUX = 0x20,
|
|
61
|
+
DIRAC_PCODE_PAD = 0x30,
|
|
62
|
+
DIRAC_PCODE_PICTURE_CODED = 0x08,
|
|
63
|
+
DIRAC_PCODE_PICTURE_RAW = 0x48,
|
|
64
|
+
DIRAC_PCODE_PICTURE_LOW_DEL = 0xC8,
|
|
65
|
+
DIRAC_PCODE_PICTURE_HQ = 0xE8,
|
|
66
|
+
DIRAC_PCODE_INTER_NOREF_CO1 = 0x0A,
|
|
67
|
+
DIRAC_PCODE_INTER_NOREF_CO2 = 0x09,
|
|
68
|
+
DIRAC_PCODE_INTER_REF_CO1 = 0x0D,
|
|
69
|
+
DIRAC_PCODE_INTER_REF_CO2 = 0x0E,
|
|
70
|
+
DIRAC_PCODE_INTRA_REF_CO = 0x0C,
|
|
71
|
+
DIRAC_PCODE_INTRA_REF_RAW = 0x4C,
|
|
72
|
+
DIRAC_PCODE_INTRA_REF_PICT = 0xCC,
|
|
73
|
+
DIRAC_PCODE_MAGIC = 0x42424344,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
typedef struct DiracVersionInfo {
|
|
77
|
+
int major;
|
|
78
|
+
int minor;
|
|
79
|
+
} DiracVersionInfo;
|
|
80
|
+
|
|
81
|
+
typedef struct AVDiracSeqHeader {
|
|
82
|
+
unsigned width;
|
|
83
|
+
unsigned height;
|
|
84
|
+
uint8_t chroma_format; ///< 0: 444 1: 422 2: 420
|
|
85
|
+
|
|
86
|
+
uint8_t interlaced;
|
|
87
|
+
uint8_t top_field_first;
|
|
88
|
+
|
|
89
|
+
uint8_t frame_rate_index; ///< index into dirac_frame_rate[]
|
|
90
|
+
uint8_t aspect_ratio_index; ///< index into dirac_aspect_ratio[]
|
|
91
|
+
|
|
92
|
+
uint16_t clean_width;
|
|
93
|
+
uint16_t clean_height;
|
|
94
|
+
uint16_t clean_left_offset;
|
|
95
|
+
uint16_t clean_right_offset;
|
|
96
|
+
|
|
97
|
+
uint8_t pixel_range_index; ///< index into dirac_pixel_range_presets[]
|
|
98
|
+
uint8_t color_spec_index; ///< index into dirac_color_spec_presets[]
|
|
99
|
+
|
|
100
|
+
int profile;
|
|
101
|
+
int level;
|
|
102
|
+
|
|
103
|
+
AVRational framerate;
|
|
104
|
+
AVRational sample_aspect_ratio;
|
|
105
|
+
|
|
106
|
+
enum AVPixelFormat pix_fmt;
|
|
107
|
+
enum AVColorRange color_range;
|
|
108
|
+
enum AVColorPrimaries color_primaries;
|
|
109
|
+
enum AVColorTransferCharacteristic color_trc;
|
|
110
|
+
enum AVColorSpace colorspace;
|
|
111
|
+
|
|
112
|
+
DiracVersionInfo version;
|
|
113
|
+
int bit_depth;
|
|
114
|
+
} AVDiracSeqHeader;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Parse a Dirac sequence header.
|
|
118
|
+
*
|
|
119
|
+
* @param dsh this function will allocate and fill an AVDiracSeqHeader struct
|
|
120
|
+
* and write it into this pointer. The caller must free it with
|
|
121
|
+
* av_free().
|
|
122
|
+
* @param buf the data buffer
|
|
123
|
+
* @param buf_size the size of the data buffer in bytes
|
|
124
|
+
* @param log_ctx if non-NULL, this function will log errors here
|
|
125
|
+
* @return 0 on success, a negative AVERROR code on failure
|
|
126
|
+
*/
|
|
127
|
+
int av_dirac_parse_sequence_header(AVDiracSeqHeader **dsh,
|
|
128
|
+
const uint8_t *buf, size_t buf_size,
|
|
129
|
+
void *log_ctx);
|
|
130
|
+
|
|
131
|
+
#endif /* AVCODEC_DIRAC_H */
|