From patchwork Sat Aug 1 11:07:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 21419 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 24DFD449EA5 for ; Sat, 1 Aug 2020 14:15:42 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0A869689734; Sat, 1 Aug 2020 14:15:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5113B68004C for ; Sat, 1 Aug 2020 14:15:36 +0300 (EEST) Received: by mail-ed1-f65.google.com with SMTP id n2so24054992edr.5 for ; Sat, 01 Aug 2020 04:15:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=c5fsJJHpQBL8285Nv/kewIMqUX4bbJWzfjqTaoHB1MM=; b=aEmpVhmTB/gAk5TRXda+naZGHqlIXxJSrIwXQfYxZ9E9WG6IN9Hx7f0VsaCX6AlURs wFS6IZ2CPp2mP8aTwo9fQVDpGheqozH8mxBUHR2BO7SkSFx/k/mpW9sTAKWvxMzdlHFy +SQwL9pLFBlHJFYa5ar8WFuuwe9LEVoQWQm2APn5bwEmmXBahNhKDOgWhNd7Ylgnxsoq j+9e31asJoSOPRkTvbZI3jUaj/cggaZ9bmzbccb8/cFqr1UkvL7LSgxYdHoDrfv8G8mf FefV5Nh6AEP3SFNTxqWPZrLnrg/yjUTfYo8j5VvvG5pdRHYP2EvpoVmDBBT2taZA8Yi6 ZUdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c5fsJJHpQBL8285Nv/kewIMqUX4bbJWzfjqTaoHB1MM=; b=fg/Dkw8yzpQNxuGmJ3rwMrR/Ep2F835vwzRZhXWsnnVhZm15t53fX+Atlus6T1vcx8 OQ64g4QJ8ibG6XXoo6JFVcpiwY6WmNl673Cy42c4wS/m3v6zerMTFVtN+YQFMNsf1UWu tVWYysU8MjqxXQTdZgGcJfJIC7MhJuPibfuBKACzzwV8dUf5gAxPIBPNpGH15RprELoY bwAUEvWniTJ0/sHghvzMVvXrZKbBi3BPcAk75KZFyHp1oqjOEzIAY5h52RbA1b7rUgap 83r/5Pl888X2B083zBnEtlMW3tuwJmnQz8bF4gMRq4kMXhmEliguY5tZdcmA+cDwAuvW ctSg== X-Gm-Message-State: AOAM532zrNU87dQFTl2eDIu5zJ128KTYJ8F4ag8Xy6KU8A903xIyA6np TLYr9R02s6OO4M64ZET/93ORcIFp X-Google-Smtp-Source: ABdhPJw+xlHGFXGUy5glwgovaWQ9sDi2POhxjN5il3HI9y0thSnHZQj5yErt1X3SSaJtR4XvQaNOUw== X-Received: by 2002:a2e:9009:: with SMTP id h9mr3497937ljg.295.1596280057872; Sat, 01 Aug 2020 04:07:37 -0700 (PDT) Received: from localhost.localdomain (91-159-194-103.elisa-laajakaista.fi. [91.159.194.103]) by smtp.gmail.com with ESMTPSA id f24sm2694045ljc.99.2020.08.01.04.07.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2020 04:07:36 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Sat, 1 Aug 2020 14:07:27 +0300 Message-Id: <20200801110730.30642-5-jeebjp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200801110730.30642-1-jeebjp@gmail.com> References: <20200729113952.14574-1-jeebjp@gmail.com> <20200801110730.30642-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/7] avcodec/mpeg4audio: add newer channel_coding mappings X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Additionally, add comments regarding their definitions. Based on ARIB STD-B32, which bases on 14496-3:2009 and 14496-3:2009/AMD4. --- libavcodec/mpeg4audio.c | 17 +++++++++++++++-- libavcodec/mpeg4audio.h | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/libavcodec/mpeg4audio.c b/libavcodec/mpeg4audio.c index 0d83fb8d25..77cf2fb61c 100644 --- a/libavcodec/mpeg4audio.c +++ b/libavcodec/mpeg4audio.c @@ -64,8 +64,21 @@ const int avpriv_mpeg4audio_sample_rates[16] = { 24000, 22050, 16000, 12000, 11025, 8000, 7350 }; -const uint8_t ff_mpeg4audio_channels[8] = { - 0, 1, 2, 3, 4, 5, 6, 8 +const uint8_t ff_mpeg4audio_channels[14] = { + 0, + 1, // mono (1/0) + 2, // stereo (2/0) + 3, // 3/0 + 4, // 3/1 + 5, // 3/2 + 6, // 3/2.1 + 8, // 5/2.1 + 0, + 0, + 0, + 7, // 3/3.1 + 8, // 3/2/2.1 + 24 // 3/3/3 - 5/2/3 - 3/0/0.2 }; static inline int get_object_type(GetBitContext *gb) diff --git a/libavcodec/mpeg4audio.h b/libavcodec/mpeg4audio.h index 4b390e0f42..c4cdc1508c 100644 --- a/libavcodec/mpeg4audio.h +++ b/libavcodec/mpeg4audio.h @@ -46,7 +46,7 @@ typedef struct MPEG4AudioConfig { } MPEG4AudioConfig; extern av_export_avcodec const int avpriv_mpeg4audio_sample_rates[16]; -extern const uint8_t ff_mpeg4audio_channels[8]; +extern const uint8_t ff_mpeg4audio_channels[14]; /** * Parse MPEG-4 systems extradata from a potentially unaligned GetBitContext to retrieve audio configuration.