Commit Graph

114974 Commits

Author SHA1 Message Date
James Almer ce33a5f16d avformat/movenc: remove one level of indentation
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 12:46:49 -03:00
James Almer 63702d5f9c avcodec/aac/aacdec: remove double colon
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 11:02:00 -03:00
Zhao Zhili 1b41631185 fftools: Fix implicit-const-int-float-conversion warning
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 16:09:09 +08:00
Zhao Zhili 66161166dc avcodec/mediacodecenc: add AV_CODEC_CAP_ENCODER_FLUSH support
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 15:35:26 +08:00
Zhao Zhili 9e49915195 avcodec/mediacodecenc: Add global header support
The extradata is generated by encoding a dummy frame, then reset
the encoder state by mediacodec flush(). It only works for pixel
format other than AV_PIX_FMT_MEDIACODEC, since I'm not sure how
to create a dummy frame safely with AV_PIX_FMT_MEDIACODEC.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 15:35:26 +08:00
Zhao Zhili 3cfea6993a avcodec/mediacodecenc: Remove write only variable
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 15:35:26 +08:00
Zhao Zhili a5a3788f56 avcodec/mediacodecenc: Fix return empty packet when bsf is used
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-04-23 15:35:26 +08:00
Zhao Zhili 32fa20c0c9 avcodec/mediacodec_wrapper: Fix unused variable warning 2024-04-23 15:35:26 +08:00
Zhao Zhili 98b5e80fd6 avcodec/mediacodec_wrapper: link to NDK mediacodec API directly
Drop support of Android version before 5.0.
2024-04-23 15:35:26 +08:00
Zhao Zhili 309cff378c configure: Lower Android API level requirement of mediandk
AImage_delete is introduced in API level 24, while AMediaFormat_new
is introduced in API level 21. We only need API level 21 to support
NDK mediacodec. This change doesn't break or change of
android_camera_indev since camera2ndk still needs API level 24.
2024-04-23 15:35:26 +08:00
Lynne e3650886c7
aacdec: initialize float/fixed SBR tables only when either is needed 2024-04-23 08:31:41 +02:00
Lynne 176c922e4e
aacsbr: constify the only SBR table 2024-04-23 08:31:41 +02:00
Lynne 03cf101645
aacdec: remove AAC-specific MIPS optimizations
The code was written in 2012, but seems to have been broken
for just as long. Compilation is broken on every MIPS/MIPS64
system with an FPU (which the code depends on).
2024-04-23 08:31:40 +02:00
Lynne ae7c6cc17d
aac: move aacdec.c to aac/aacdec.c 2024-04-23 08:31:40 +02:00
Lynne 551ce16b59
aacdec: move aacdec.h into libavcodec/aac 2024-04-23 08:31:40 +02:00
Lynne cd1e404a10
aacdec: merge previously-templated code 2024-04-23 08:31:39 +02:00
Lynne ce740618d1
aacdec: move LATM decode functions into a separate file 2024-04-23 08:31:39 +02:00
Lynne e93793bf3c
aacdec: fully detemplate decoder core 2024-04-23 08:31:38 +02:00
Lynne 2f90d83981
aacdec: move fixed/float DSP initialization to templated init functions 2024-04-23 08:31:38 +02:00
Lynne 905fdb0601
aacdec: reuse TNS and LTP tables between fixed and float decoders
The fixed decoder derives the values from floats anyway.
2024-04-23 08:31:38 +02:00
Lynne 49e7be1e37
aacdec: move prediction to separate files 2024-04-23 08:31:37 +02:00
Lynne b1718ce0f9
aacdec: move CCE decoding to a separate templated file
Unfortunately, although it's a purely decode function, it does
need to be templated.
2024-04-23 08:31:37 +02:00
Lynne 41c04bec0a
aacdec: move fixed-point clipping to a separate function 2024-04-23 08:31:36 +02:00
Lynne 87a93a5670
aacdec: split off channel coupling into a new file 2024-04-23 08:31:36 +02:00
Lynne b7387ea00e
aacdec: deduplicate table initizalization
All tables now initialized by aac/aacdec_fixed|float
2024-04-23 08:31:36 +02:00
Lynne 41ae2b03a5
aacdec: move spectrum decode and dequantization to a new file 2024-04-23 08:31:35 +02:00
Lynne 5c026e6637
aacdec: remove unnecessary decode_spectrum_and_dequant arguments
Small cleanup to reduce number of arguments.
2024-04-23 08:31:35 +02:00
Lynne eef9100a8e
aacdec: template LTP windowing separately
The function is called only internally in DSP, so we do not
need to expose it.

apply_ltp on MIPS uses this function, but due to the function
being just a glue function with no real optimizations,
duplicate it there.
2024-04-23 08:31:35 +02:00
Lynne 091d85217d
aacdec: template windowing and transforms separately 2024-04-23 08:31:34 +02:00
Lynne a309aa4127
aacdec: duplicate table initialization
Preparation to move all table init and support windowing functions.
2024-04-23 08:31:34 +02:00
Lynne e9fc7661da
aacdec: template LTP application separately 2024-04-23 08:31:33 +02:00
Lynne db5128ef70
aacdec: template TNS application separately 2024-04-23 08:31:33 +02:00
Lynne ad16349f9b
aacdec: template intensity stereo application separately 2024-04-23 08:31:33 +02:00
Lynne 9f3fa77e0d
aacdec: template mid/side stereo application separately 2024-04-23 08:31:32 +02:00
Lynne a6295586f5
aacdec: template scalefactor dequantization separately 2024-04-23 08:31:32 +02:00
Lynne 7f3b3e2df1
aacdec: switch-ify scalefactor decoding
Brings it in line with dequantization.
2024-04-23 08:31:31 +02:00
Lynne 77a88bbdda
aacdec: give spectrum dequant+decode SCE rather than an ICS
Eliminates using templated values in function definition.
2024-04-23 08:31:31 +02:00
Lynne 60b60dd635
aacdec: separate out scalefactor dequantization from decoding
Allows to template away dequantization.
2024-04-23 08:31:31 +02:00
Lynne ed009bfd3d
aacdec: add a decoder DSP structure
To be used to abstract away DSP functions.
2024-04-23 08:31:30 +02:00
Andreas Rheinhardt 9de66fd449
avcodec/aacdec_template: Deduplicate common part of aac_decode_init()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:30 +02:00
Andreas Rheinhardt 980a55fb46
avcodec/aacdec_template: Deduplicate AVClass+AVOptions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:29 +02:00
Andreas Rheinhardt e3693c6f56
avcodec/aacdec_template: Deduplicate aac_decode_close()
This is possible now that both AAC decoders share the same
context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:29 +02:00
Andreas Rheinhardt 7117e0c7be
avcodec/aacdec: Use same AACDecContext for fixed and float
Up until now, there was one AACDecContext for the fixed
and one for the floating point decoder. These differed
mostly in certain arrays which were int for the fixed-point
and float for the floating point decoder; there were also
differences in corresponding function pointers.

Yet in order to deduplicate the enormous amount of currently
duplicated code between the float and the fixed-point decoder,
one needs common contexts. Given that int and float have the
same size on all common systems, this commit replaces these
arrays by unions of int arrays and of float arrays. The names
of these arrays have been chosen to be compatible with
AAC_RENAME().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:29 +02:00
Andreas Rheinhardt fc3c2ea8dc
avcodec/aacdec: PredictorState array out of SingleChannelElement
sizeof(PredictorState) is different for the floating-point and
the fixed-point AAC decoders; this is an obstacle for deduplicating
code between these decoders. So don't include this array in
SingleChannelElement, instead add a union of pointers to the
fixed-point PredictorState and the floating-point PredictorState.
The actual arrays are part of the extended ChannelElement
to be allocated by ff_aac_sbr_ctx_alloc_init(); it also
sets the pointers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:28 +02:00
Andreas Rheinhardt 8b2261e573
avcodec/aacdec: Always include AV(Fixed|Float)DSPContext in AACDecContext
Up until now, AACDecContext included pointers to one of these
contexts depending upon USE_FIXED. Yet deduplicating
the common parts of the float and fixed-point AAC decoders
needs common structures, so we put both of these pointers
in a union.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:28 +02:00
Andreas Rheinhardt 5bd7b8d999
avcodec/aacdec: Split SBR context from ChannelElement
The AAC fixed-point and floating-point decoders have
a lot of duplicated code; the main obstacle to
deduplicating it is that several structures with the
same name are actually different types, because
they contain INTFLOATs (int or float) and AAC_FLOATs
(SoftFloat or float). SoftFloat and float typically
have different sizes, so dealing with it is the more
complicated of the two.

AAC_FLOAT is mainly used in the sbr code and structures,
so one can still deduplicate the code by only exposing
the common part of ChannelElement (without SBR context)
to the common decoder part. One prerequisite of this
is to move allocating the whole ChannelElement to
code that will stay unduplicated. It is most natural
to move said allocation to ff_aac_sbr_ctx_init().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:28 +02:00
Andreas Rheinhardt 6975d965fc
avcodec/aacsbr: Make ff_aac_sbr_* funcs accept ChannelElement*
Each ChannelElement contains exactly one SpectralBandReplication
structure; the latter structure contains lots of buffers
whose size depend upon USE_FIXED (i.e. AAC_FLOAT arrays).
This complicates deduplicating the parts of the AAC decoder
that are duplicated between the fixed-point and the floating
point decoder.

In order to fix this, the SpectralBandReplication structure
will be moved from the part of ChannelElement visible to
the common code. Therefore the ff_aac_sbr_* functions
are ported to accept a ChannelElement*; they will then have
to translate that to the corresponding SpectralBandReplication*
themselves (which is possible, because there are floating-point
and fixed-point versions of these functions).

While just at it, also ensure that these functions are properly
namespaced.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-23 08:31:27 +02:00
Lynne 3600f757db
aacsbr_template: include mem.h
Future AAC changes remove the need to include this header.
2024-04-23 08:31:27 +02:00
Lynne f55b587820
aacdec: move aacdec_common to aac/aacdec_tab
Start to clean up the decoder.
Also renames a confusingly named file.
2024-04-23 08:31:18 +02:00
Jun Zhao fc02b910ad lavc/libxevd: Fixed the has_b_frames setting
has_b_frames used in decoder for size of the frame
reordering buffer, and we don't used the max_b_frames
in decoder.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2024-04-23 07:27:38 +08:00