1
0
Fork 0
Commit Graph

15 Commits

Author SHA1 Message Date
Andreas Rheinhardt c0d483cecb avcodec/aptx: Use AVCodecContext.frame_size according to the API
Currently the APTX (HD) codecs set frame_size if unset and check
whether it is divisible by block_size (corresponding to block_align
as used by other codecs). But this is based upon a misunderstanding
of the API: frame_size is not in bytes, but in samples.

Said value is also not intended to be set by the user at all,
but set by encoders and (possibly) decoders if the number of channels
in a frame is constant. The latter condition is not fulfilled here,
so only set it for encoders. Given that the encoder can handle any
number of samples as long as it is divisible by four and given that
it worked to set a custom frame size before, the encoders accept
any multiple of four; otherwise the value is set to the value
that it already had for APTX: 1024 samples (per channel).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-19 17:05:33 +02:00
Andreas Rheinhardt 18e55de45a avcodec/aptx: Move AudioFrameQueue to aptxenc.c
It is only used by the encoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-27 02:23:43 +02:00
Andreas Rheinhardt 86c909558c avcodec/internal: Move FF_SIGNBIT and ff_log2_run to mathops.h
It is a more fitting place for them.
Also move the definition of ff_log2_run to mathtables.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21 23:25:36 +01:00
Andreas Rheinhardt a688f3c13c avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.h
Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault.
This reduces the amount of files that have to include internal.h
(which comes with quite a lot of indirect inclusions), as e.g.
most encoders don't need it. It is furthemore in preparation
for moving the private part of AVCodec out of the public codec.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21 01:33:09 +01:00
Anton Khirnov 18f61d19c2 aptx: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:40 -03:00
James Almer 2383021a7a avcodec/aptx: split decoder and encoder into separate files
Signed-off-by: James Almer <jamrial@gmail.com>
2020-02-05 22:47:27 -03:00
Michael Niedermayer 98a257c323 avcodec/aptx: Check the number of channels
Fixes: store to null pointer of type 'uint32_t' (aka 'unsigned int')
Fixes: 18021/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APTX_HD_fuzzer-5761738313564160

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-01 20:15:32 +01:00
Michael Niedermayer 675f62a202 avcodec/aptx: Fix multiple shift anomalies
Fixes: left shift of negative value -24576
Fixes: 17719/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APTX_fuzzer-5710508002377728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-30 22:44:43 +02:00
Aurelien Jacobs c69054fa24 aptx: indentation (cosmetics only) 2018-02-09 22:10:56 +01:00
Aurelien Jacobs 6fd110a094 aptx: implement the aptX HD bluetooth codec 2018-02-09 22:10:55 +01:00
Aurelien Jacobs 96b217f5e8 aptx: do some clipping to match original codec in extreme cases 2018-02-09 22:10:55 +01:00
Aurelien Jacobs fea8e119a2 aptx: factorize FFABS calculation 2018-02-09 22:10:55 +01:00
Aurelien Jacobs b7915f8a14 aptx: simplify by pre-calculating factor_max 2018-02-09 22:10:55 +01:00
Aurelien Jacobs 3f88744067 aptx: add codec cap SMALL_LAST_FRAME and INIT_THREADSAFE as appropriate 2017-12-18 01:07:00 +00:00
Aurelien Jacobs a337b36b8b aptx: implement the aptX bluetooth codec
The encoder was reverse engineered from binary library and from
EP0398973B1 patent (long expired).
The decoder was simply deduced from the encoder.
2017-11-10 21:32:06 +00:00