From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id D958A456E0 for ; Sat, 18 Feb 2023 16:50:35 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6E22B68BE96; Sat, 18 Feb 2023 18:50:32 +0200 (EET) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B36F468BD2E for ; Sat, 18 Feb 2023 18:50:25 +0200 (EET) Received: by mail-lj1-f178.google.com with SMTP id q12so902241ljp.2 for ; Sat, 18 Feb 2023 08:50:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=d6vBZ7TeyZCesEzQbmxguwEhNOp265XUqE3DATI2Jag=; b=RR0UhAQ3dk+P8ZInZCcTC7VvwcVIw9ZkBXxxCzwgE7YkeJTAIYqBTjQpo8lbE7v1CN 98XM/MQUIyolkJ4xjj3F0HsQI/XGRJjAa7EENXuQrYXrC1reF1RnEC6H0bXBTItwUiMn RhP55034MOYJEidm1zE3DNaTcaEwpAbA3ezt+qq52A2jQ8qzZijSgFBQ1ISKdgjFSOul MRVLST1NR8ut3v+CGZUSIPuJNyjRKDNS5WXZg53O1/522GMePQCat4XRylvST2jjJziB HtvmhQaphLcJVRMyQrGU+8XvprtB12icvUXKhTfBhQA9g6Kw9px46E0Dad5Saqi2sobT 5zYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=d6vBZ7TeyZCesEzQbmxguwEhNOp265XUqE3DATI2Jag=; b=fZ3CoKw/iW1YsW0tS8xu07zpZSknSMYDjs70RE4jVpg26xxjRDNFvl7+L2nDU/jAMl Ae1lPJaYq2m5NHGvCfNWRst0F0FX+/PoNeJYY5fXUqzQKxyHO7Gn37dY6EkBNliaYeBU UmAzJpIbiRm1m8OkON72J/d04kmDy0sMf0fMTQ+ubtagntm44ebEfMFKxXAsyriZebPa UvEnGIqW6dckXBbFf+dLot1B9FNGOcWCVZO5NcXq1KI+Fvv3Lpl5r6v6BHw4yIvWy9/Q 7pXO4iN8Dh8yACx/35AFpE5bn8aPbr7roKt/Ia9EKQjL3J9+LYEQSlKF4G7eXQr56a6s Yr2g== X-Gm-Message-State: AO0yUKVMnMAT6ZdrSrnjaqmLeWU88zH7+OQQc67LPbqXOXLlbmR1adeB ZbENtbBwV8R07CBpXILA4dLJ7YDjuCBAsNyZ9mBaXu4Objk= X-Google-Smtp-Source: AK7set+8NOa4XoDWCkDgAfpbxuw9gAxUEwkYFZVU7lxSpbn4+m4IBHVumfbjlYhkOmkPRugb4M8hxok/Wd0NitxzCm0= X-Received: by 2002:a2e:b943:0:b0:295:71d1:efa6 with SMTP id 3-20020a2eb943000000b0029571d1efa6mr694626ljs.4.1676739024097; Sat, 18 Feb 2023 08:50:24 -0800 (PST) MIME-Version: 1.0 References: <20230218011457.346660-1-marth64@proxyid.net> <20230218011457.346660-2-marth64@proxyid.net> In-Reply-To: <20230218011457.346660-2-marth64@proxyid.net> From: Hendrik Leppkes Date: Sat, 18 Feb 2023 17:50:11 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH v2 2/4] avcodec/mlpdec: add detection of Atmos spatial extension profile in TrueHD X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sat, Feb 18, 2023 at 2:15 AM Marth64 wrote: > > Signed-off-by: Marth64 > --- > libavcodec/avcodec.h | 2 ++ > libavcodec/codec_desc.c | 1 + > libavcodec/mlpdec.c | 11 +++++++++++ > libavcodec/profiles.c | 5 +++++ > libavcodec/profiles.h | 1 + > 5 files changed, 20 insertions(+) > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > index 0e85dd50a4..3feab75741 100644 > --- a/libavcodec/avcodec.h > +++ b/libavcodec/avcodec.h > @@ -1593,6 +1593,8 @@ typedef struct AVCodecContext { > > #define FF_PROFILE_EAC3_DDP_ATMOS 30 > > +#define FF_PROFILE_TRUEHD_ATMOS 30 > + > #define FF_PROFILE_MPEG2_422 0 > #define FF_PROFILE_MPEG2_HIGH 1 > #define FF_PROFILE_MPEG2_SS 2 > diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c > index 4098d4f5a5..e80ac07700 100644 > --- a/libavcodec/codec_desc.c > +++ b/libavcodec/codec_desc.c > @@ -2960,6 +2960,7 @@ static const AVCodecDescriptor codec_descriptors[] = { > .name = "truehd", > .long_name = NULL_IF_CONFIG_SMALL("TrueHD"), > .props = AV_CODEC_PROP_LOSSLESS, > + .profiles = NULL_IF_CONFIG_SMALL(ff_truehd_profiles), > }, > { > .id = AV_CODEC_ID_MP4ALS, > diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c > index 0ee1f0982c..85d6207b9c 100644 > --- a/libavcodec/mlpdec.c > +++ b/libavcodec/mlpdec.c > @@ -42,6 +42,7 @@ > #include "mlpdsp.h" > #include "mlp.h" > #include "config.h" > +#include "profiles.h" > > /** number of bits used for VLC lookup - longest Huffman code is 9 */ > #if ARCH_ARM > @@ -392,6 +393,15 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb) > m->num_substreams = mh.num_substreams; > m->substream_info = mh.substream_info; > > + /* If there is a 4th substream and the MSB of substream_info is set, > + * there is a 16-channel spatial presentation (Atmos in TrueHD). > + */ > + if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD > + && m->num_substreams == 4 > + && m->substream_info >> 7 == 1) { > + m->avctx->profile = FF_PROFILE_TRUEHD_ATMOS; > + } > + Nit: maybe put the if into two lines instead of three? The two substream checks look like they should fit in one line quite well. But this is just a style question, so feel free to ignore. Otherwise LGTM _______________________________________________ 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".