[FFmpeg-cvslog] avcodec/mlpenc: add support for 4.0/4.1 ch layout

Paul B Mahol git at videolan.org
Fri Oct 27 13:39:49 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Oct 25 12:46:24 2023 +0200| [567af48fba1958bf412075b49fc482cd3c7b96b9] | committer: Paul B Mahol

avcodec/mlpenc: add support for 4.0/4.1 ch layout

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=567af48fba1958bf412075b49fc482cd3c7b96b9
---

 libavcodec/mlpenc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c
index 9cd30d4c3d..2df695efe7 100644
--- a/libavcodec/mlpenc.c
+++ b/libavcodec/mlpenc.c
@@ -178,7 +178,7 @@ typedef struct MLPEncodeContext {
 
     uint8_t         noise_type;
     uint8_t         channel_arrangement;    ///< channel arrangement for MLP streams
-    uint8_t         channel_arrangement8;   ///< 8 channel arrangement for THD streams
+    uint16_t        channel_arrangement8;   ///< 8 channel arrangement for THD streams
 
     uint8_t         multichannel_type6ch;   ///< channel modifier for TrueHD stream 0
     uint8_t         multichannel_type8ch;   ///< channel modifier for TrueHD stream 0
@@ -600,6 +600,8 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx)
         case AV_CH_LAYOUT_2POINT1:
         case AV_CH_LAYOUT_SURROUND:
         case AV_CH_LAYOUT_3POINT1:
+        case AV_CH_LAYOUT_4POINT0:
+        case AV_CH_LAYOUT_4POINT1:
         case AV_CH_LAYOUT_5POINT0:
         case AV_CH_LAYOUT_5POINT1:
             ctx->ch2_presentation_mod= 0;
@@ -2325,13 +2327,15 @@ const FFCodec ff_truehd_encoder = {
     .p.priv_class           = &mlp_class,
     .p.sample_fmts          = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE},
     .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0},
-    CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_2POINT1, AV_CH_LAYOUT_SURROUND, AV_CH_LAYOUT_3POINT1, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1)
+    CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_2POINT1, AV_CH_LAYOUT_SURROUND, AV_CH_LAYOUT_3POINT1, AV_CH_LAYOUT_4POINT0, AV_CH_LAYOUT_4POINT1, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1)
     .p.ch_layouts           = (const AVChannelLayout[]) {
                                   AV_CHANNEL_LAYOUT_MONO,
                                   AV_CHANNEL_LAYOUT_STEREO,
                                   AV_CHANNEL_LAYOUT_2POINT1,
                                   AV_CHANNEL_LAYOUT_SURROUND,
                                   AV_CHANNEL_LAYOUT_3POINT1,
+                                  AV_CHANNEL_LAYOUT_4POINT0,
+                                  AV_CHANNEL_LAYOUT_4POINT1,
                                   AV_CHANNEL_LAYOUT_5POINT0,
                                   AV_CHANNEL_LAYOUT_5POINT1,
                                   { 0 }



More information about the ffmpeg-cvslog mailing list