Commit graph

5 commits

Author SHA1 Message Date
cenzhanquan1
1120b3db30 avcodec/liblc3enc: support packed float (AV_SAMPLE_FMT_FLT) input.
Previously, the LC3 encoder only accepted planar float (AV_SAMPLE_FMT_FLTP).
This change extends support to packed float (AV_SAMPLE_FMT_FLT) by properly
handling channel layout and sample stride.

The pcm data pointer and stride are now calculated based on the sample
format: for planar, use frame->data[ch]; for packed, use frame->data[0]
with channel offset. The stride is set to 1 for planar and number of
channels for packed layout.

This enables encoding from common packed audio sources without requiring
a prior planar conversion, improving usability and efficiency.

Signed-off-by: cenzhanquan1 <cenzhanquan1@xiaomi.com>
2025-10-23 14:42:50 +00:00
Andreas Rheinhardt
15a9c8dea3 avcodec/liblc3enc: Avoid allocating buffer to send a zero frame
liblc3 supports arbitrary strides, so one can simply use a stride
of zero to make it read the same zero value again and again.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-10-04 06:07:37 +02:00
Andreas Rheinhardt
0971fcf0a0 avcodec/codec_internal, all: Use macros to set deprecated AVCodec fields
The aim of this is twofold: a) Clang warns when setting a deprecated
field in a definition and because several of the widely set
AVCodec fields are deprecated, one gets several hundred warnings
from Clang for an ordinary build. Yet fortunately Clang (unlike GCC)
allows to disable deprecation warnings inside a definition, so
that one can create simple macros to set these fields that also suppress
deprecation warnings for Clang. This has already been done in
fdff1b9cbf for AVCodec.channel_layouts.
b) Using macros will allow to easily migrate these fields to internal ones.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-10 00:57:23 +01:00
James Almer
3db674614d avcodec/liblc3enc: don't force unspec channel layouts
We only care about channel count. Layout details will be ignored either way.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-04 13:57:34 -03:00
Antoine Soulier via ffmpeg-devel
240fd04db2 avcodec/liblc3: add encoding/decoding support of LC3 audio codec
The LC3 audio codec is the default codec of Bluetooth LE audio.
This is a wrapper over the liblc3 library (https://github.com/google/liblc3).

Signed-off-by: Antoine Soulier <asoulier@google.com>
2024-04-04 17:47:31 +02:00