]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vorbis_data.c
libopenh264dec: Export the decoded profile and level in AVCodecContext
[ffmpeg] / libavcodec / vorbis_data.c
index 35672fa1241f10679e968db78131694eb2f9f751..bafb77b1e8989f3e8d32d16cea99bd57a54d56fb 100644 (file)
@@ -1,46 +1,62 @@
 /*
  * copyright (c) 2005 Denes Balatoni ( dbalatoni programozo hu )
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "dsputil.h"
+#include "libavutil/channel_layout.h"
+#include "libavutil/mem.h"
 #include "vorbis.h"
 
-const uint8_t ff_vorbis_channel_layout_offsets[6][6] = {
-    { 0, },
-    { 0, 1, },
-    { 0, 2, 1, },
-    { 0, 1, 2, 3, },
-    { 0, 2, 1, 3, 4, },
-    { 0, 2, 1, 5, 3, 4, }
+const uint8_t ff_vorbis_channel_layout_offsets[8][8] = {
+    { 0 },
+    { 0, 1 },
+    { 0, 2, 1 },
+    { 0, 1, 2, 3 },
+    { 0, 2, 1, 3, 4 },
+    { 0, 2, 1, 5, 3, 4 },
+    { 0, 2, 1, 6, 5, 3, 4 },
+    { 0, 2, 1, 7, 5, 6, 3, 4 },
 };
 
-const int64_t ff_vorbis_channel_layouts[7] = {
-    CH_LAYOUT_MONO,
-    CH_LAYOUT_STEREO,
-    CH_LAYOUT_SURROUND,
-    CH_LAYOUT_QUAD,
-    CH_LAYOUT_5POINT0_BACK,
-    CH_LAYOUT_5POINT1_BACK,
+const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8] = {
+    { 0 },
+    { 0, 1 },
+    { 0, 2, 1 },
+    { 0, 1, 2, 3 },
+    { 0, 2, 1, 3, 4 },
+    { 0, 2, 1, 4, 5, 3 },
+    { 0, 2, 1, 5, 6, 4, 3 },
+    { 0, 2, 1, 6, 7, 4, 5, 3 },
+};
+
+const uint64_t ff_vorbis_channel_layouts[9] = {
+    AV_CH_LAYOUT_MONO,
+    AV_CH_LAYOUT_STEREO,
+    AV_CH_LAYOUT_SURROUND,
+    AV_CH_LAYOUT_QUAD,
+    AV_CH_LAYOUT_5POINT0_BACK,
+    AV_CH_LAYOUT_5POINT1_BACK,
+    AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER,
+    AV_CH_LAYOUT_7POINT1,
     0
 };
 
-DECLARE_ALIGNED_16(static const float, vwin64[32]) = {
+DECLARE_ALIGNED(16, static const float, vwin64)[32] = {
     0.0009460463F, 0.0085006468F, 0.0235352254F, 0.0458950567F,
     0.0753351908F, 0.1115073077F, 0.1539457973F, 0.2020557475F,
     0.2551056759F, 0.3122276645F, 0.3724270287F, 0.4346027792F,
@@ -51,7 +67,7 @@ DECLARE_ALIGNED_16(static const float, vwin64[32]) = {
     0.9989462667F, 0.9997230082F, 0.9999638688F, 0.9999995525F,
 };
 
-DECLARE_ALIGNED_16(static const float, vwin128[64]) = {
+DECLARE_ALIGNED(16, static const float, vwin128)[64] = {
     0.0002365472F, 0.0021280687F, 0.0059065254F, 0.0115626550F,
     0.0190823442F, 0.0284463735F, 0.0396300935F, 0.0526030430F,
     0.0673285281F, 0.0837631763F, 0.1018564887F, 0.1215504095F,
@@ -70,7 +86,7 @@ DECLARE_ALIGNED_16(static const float, vwin128[64]) = {
     0.9999331503F, 0.9999825563F, 0.9999977357F, 0.9999999720F,
 };
 
-DECLARE_ALIGNED_16(static const float, vwin256[128]) = {
+DECLARE_ALIGNED(16, static const float, vwin256)[128] = {
     0.0000591390F, 0.0005321979F, 0.0014780301F, 0.0028960636F,
     0.0047854363F, 0.0071449926F, 0.0099732775F, 0.0132685298F,
     0.0170286741F, 0.0212513119F, 0.0259337111F, 0.0310727950F,
@@ -105,7 +121,7 @@ DECLARE_ALIGNED_16(static const float, vwin256[128]) = {
     0.9999958064F, 0.9999989077F, 0.9999998584F, 0.9999999983F,
 };
 
-DECLARE_ALIGNED_16(static const float, vwin512[256]) = {
+DECLARE_ALIGNED(16, static const float, vwin512)[256] = {
     0.0000147849F, 0.0001330607F, 0.0003695946F, 0.0007243509F,
     0.0011972759F, 0.0017882983F, 0.0024973285F, 0.0033242588F,
     0.0042689632F, 0.0053312973F, 0.0065110982F, 0.0078081841F,
@@ -172,7 +188,7 @@ DECLARE_ALIGNED_16(static const float, vwin512[256]) = {
     0.9999997377F, 0.9999999317F, 0.9999999911F, 0.9999999999F,
 };
 
-DECLARE_ALIGNED_16(static const float, vwin1024[512]) = {
+DECLARE_ALIGNED(16, static const float, vwin1024)[512] = {
     0.0000036962F, 0.0000332659F, 0.0000924041F, 0.0001811086F,
     0.0002993761F, 0.0004472021F, 0.0006245811F, 0.0008315063F,
     0.0010679699F, 0.0013339631F, 0.0016294757F, 0.0019544965F,
@@ -303,7 +319,7 @@ DECLARE_ALIGNED_16(static const float, vwin1024[512]) = {
     0.9999999836F, 0.9999999957F, 0.9999999994F, 1.0000000000F,
 };
 
-DECLARE_ALIGNED_16(static const float, vwin2048[1024]) = {
+DECLARE_ALIGNED(16, static const float, vwin2048)[1024] = {
     0.0000009241F, 0.0000083165F, 0.0000231014F, 0.0000452785F,
     0.0000748476F, 0.0001118085F, 0.0001561608F, 0.0002079041F,
     0.0002670379F, 0.0003335617F, 0.0004074748F, 0.0004887765F,
@@ -562,7 +578,7 @@ DECLARE_ALIGNED_16(static const float, vwin2048[1024]) = {
     0.9999999990F, 0.9999999997F, 1.0000000000F, 1.0000000000F,
 };
 
-DECLARE_ALIGNED_16(static const float, vwin4096[2048]) = {
+DECLARE_ALIGNED(16, static const float, vwin4096)[2048] = {
     0.0000002310F, 0.0000020791F, 0.0000057754F, 0.0000113197F,
     0.0000187121F, 0.0000279526F, 0.0000390412F, 0.0000519777F,
     0.0000667623F, 0.0000833949F, 0.0001018753F, 0.0001222036F,
@@ -1077,7 +1093,7 @@ DECLARE_ALIGNED_16(static const float, vwin4096[2048]) = {
     0.9999999999F, 1.0000000000F, 1.0000000000F, 1.0000000000F,
 };
 
-DECLARE_ALIGNED_16(static const float, vwin8192[4096]) = {
+DECLARE_ALIGNED(16, static const float, vwin8192)[4096] = {
     0.0000000578F, 0.0000005198F, 0.0000014438F, 0.0000028299F,
     0.0000046780F, 0.0000069882F, 0.0000097604F, 0.0000129945F,
     0.0000166908F, 0.0000208490F, 0.0000254692F, 0.0000305515F,