Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 1/6] avcodec/liblc3: Add encoding/decoding support of LC3 audio codec
Date: Sat, 23 Mar 2024 23:41:06 +0100
Message-ID: <20240323224106.GE6420@pb2> (raw)
In-Reply-To: <20240322170106.2243608-1-asoulier@google.com>


[-- Attachment #1.1: Type: text/plain, Size: 5356 bytes --]

On Fri, Mar 22, 2024 at 05:01:00PM +0000, Antoine Soulier via ffmpeg-devel wrote:
> 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>
> Signed-off-by: Antoine SOULIER <asoulier@google.com>
> ---
>  libavcodec/Makefile     |   3 +
>  libavcodec/allcodecs.c  |   3 +
>  libavcodec/codec_desc.c |  14 +++
>  libavcodec/codec_id.h   |   2 +
>  libavcodec/liblc3dec.c  | 146 ++++++++++++++++++++++++++++++
>  libavcodec/liblc3enc.c  | 191 ++++++++++++++++++++++++++++++++++++++++
>  6 files changed, 359 insertions(+)
>  create mode 100644 libavcodec/liblc3dec.c
>  create mode 100644 libavcodec/liblc3enc.c
> 
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index 708434ac76..7d2cf3076d 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -1123,6 +1123,9 @@ OBJS-$(CONFIG_LIBILBC_ENCODER)            += libilbc.o
>  OBJS-$(CONFIG_LIBJXL_DECODER)             += libjxldec.o libjxl.o
>  OBJS-$(CONFIG_LIBJXL_ENCODER)             += libjxlenc.o libjxl.o
>  OBJS-$(CONFIG_LIBKVAZAAR_ENCODER)         += libkvazaar.o
> +OBJS-$(CONFIG_LIBLC3_ENCODER)             += liblc3enc.o
> +OBJS-$(CONFIG_LIBLC3_LC3_DECODER)         += liblc3dec.o
> +OBJS-$(CONFIG_LIBLC3_LC3PLUS_DECODER)     += liblc3dec.o
>  OBJS-$(CONFIG_LIBMP3LAME_ENCODER)         += libmp3lame.o
>  OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER)  += libopencore-amr.o
>  OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER)  += libopencore-amr.o
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index 2386b450a6..29aedaeac6 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -776,6 +776,9 @@ extern const FFCodec ff_libilbc_encoder;
>  extern const FFCodec ff_libilbc_decoder;
>  extern const FFCodec ff_libjxl_decoder;
>  extern const FFCodec ff_libjxl_encoder;
> +extern const FFCodec ff_liblc3_encoder;
> +extern const FFCodec ff_liblc3_lc3_decoder;
> +extern const FFCodec ff_liblc3_lc3plus_decoder;
>  extern const FFCodec ff_libmp3lame_encoder;
>  extern const FFCodec ff_libopencore_amrnb_encoder;
>  extern const FFCodec ff_libopencore_amrnb_decoder;
> diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
> index 3bab86db62..230bba2a09 100644
> --- a/libavcodec/codec_desc.c
> +++ b/libavcodec/codec_desc.c
> @@ -3425,6 +3425,20 @@ static const AVCodecDescriptor codec_descriptors[] = {
>          .long_name = NULL_IF_CONFIG_SMALL("QOA (Quite OK Audio)"),
>          .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
>      },
> +    {
> +        .id        = AV_CODEC_ID_LC3,
> +        .type      = AVMEDIA_TYPE_AUDIO,
> +        .name      = "lc3",
> +        .long_name = NULL_IF_CONFIG_SMALL("LC3 (Low Complexity Communication Codec)"),
> +        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
> +    },
> +    {
> +        .id        = AV_CODEC_ID_LC3_PLUS,
> +        .type      = AVMEDIA_TYPE_AUDIO,
> +        .name      = "lc3_plus",
> +        .long_name = NULL_IF_CONFIG_SMALL("LC3plus (Low Complexity Communication Codec plus)"),
> +        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
> +    },
>  
>      /* subtitle codecs */
>      {
> diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
> index c8dc21da74..7e4cb39049 100644
> --- a/libavcodec/codec_id.h
> +++ b/libavcodec/codec_id.h
> @@ -543,6 +543,8 @@ enum AVCodecID {
>      AV_CODEC_ID_AC4,
>      AV_CODEC_ID_OSQ,
>      AV_CODEC_ID_QOA,
> +    AV_CODEC_ID_LC3,
> +    AV_CODEC_ID_LC3_PLUS,
>  
>      /* subtitle codecs */
>      AV_CODEC_ID_FIRST_SUBTITLE = 0x17000,          ///< A dummy ID pointing at the start of subtitle codecs.
> diff --git a/libavcodec/liblc3dec.c b/libavcodec/liblc3dec.c
> new file mode 100644
> index 0000000000..e97cecc68f
> --- /dev/null
> +++ b/libavcodec/liblc3dec.c
> @@ -0,0 +1,146 @@
> +/*
> + * LC3 decoder wrapper
> + * Copyright (C) 2024  Antoine Soulier <asoulier@google.com>
> + *
> + * This file is part of FFmpeg.
> + *
> + * Permission to use, copy, modify, and/or distribute this software for any
> + * purpose with or without fee is hereby granted, provided that the above
> + * copyright notice and this permission notice appear in all copies.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
> + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
> + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
> + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> + */
> +
> +#include <lc3.h>

this breaks build

libavcodec/liblc3enc.c:20:10: fatal error: lc3.h: No such file or directory
 #include <lc3.h>
          ^~~~~~~

configure enables this even before the configure patch

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

      parent reply	other threads:[~2024-03-23 22:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22 17:01 Antoine Soulier via ffmpeg-devel
2024-03-22 17:01 ` [FFmpeg-devel] [PATCH 2/6] avformat/lc3: Add file format for LC3/LC3plus transport Antoine Soulier via ffmpeg-devel
2024-03-22 17:01 ` [FFmpeg-devel] [PATCH 3/6] configure: Add option for enabling LC3/LC3plus wrapper Antoine Soulier via ffmpeg-devel
2024-03-22 17:01 ` [FFmpeg-devel] [PATCH 4/6] doc: Add LC3/LC3plus muxer and encoder parameters documentation Antoine Soulier via ffmpeg-devel
2024-03-22 17:01 ` [FFmpeg-devel] [PATCH 5/6] Changelog: Add LC3/LC3plus decoding/encoding support Antoine Soulier via ffmpeg-devel
2024-03-22 17:01 ` [FFmpeg-devel] [PATCH 6/6] MAINTAINERS: Add maintainer for LC3 audio codec wrapper Antoine Soulier via ffmpeg-devel
2024-03-22 17:20   ` Lynne
2024-03-22 17:25     ` Kieran Kunhya
2024-03-22 18:24       ` Michael Niedermayer
2024-03-23 22:41 ` Michael Niedermayer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240323224106.GE6420@pb2 \
    --to=michael@niedermayer.cc \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git