diff mbox series

[FFmpeg-devel,03/13] avcodec/vorbis_data: Move encoder-related table to its only user

Message ID 20210129052302.3124447-3-andreas.rheinhardt@gmail.com
State Accepted
Commit bfdf03207bc2fc10b92bb79ba67d57c441742bcd
Headers show
Series [FFmpeg-devel,01/13] avfilter/drawutils: Remove remnants of old API | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Jan. 29, 2021, 5:22 a.m. UTC
Said table was unused in case libvorbis was disabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/libvorbisenc.c | 13 ++++++++++++-
 libavcodec/vorbis.h       |  1 -
 libavcodec/vorbis_data.c  | 11 -----------
 3 files changed, 12 insertions(+), 13 deletions(-)

Comments

Lynne Jan. 29, 2021, 8:18 a.m. UTC | #1
Jan 29, 2021, 06:22 by andreas.rheinhardt@gmail.com:

> Said table was unused in case libvorbis was disabled.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/libvorbisenc.c | 13 ++++++++++++-
>  libavcodec/vorbis.h       |  1 -
>  libavcodec/vorbis_data.c  | 11 -----------
>  3 files changed, 12 insertions(+), 13 deletions(-)
>

LGTM
diff mbox series

Patch

diff --git a/libavcodec/libvorbisenc.c b/libavcodec/libvorbisenc.c
index f78f872fe2..bf94764954 100644
--- a/libavcodec/libvorbisenc.c
+++ b/libavcodec/libvorbisenc.c
@@ -70,6 +70,17 @@  static const AVClass vorbis_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
+static const uint8_t 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 },
+};
+
 static int vorbis_error_to_averror(int ov_err)
 {
     switch (ov_err) {
@@ -287,7 +298,7 @@  static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
         buffer = vorbis_analysis_buffer(&s->vd, samples);
         for (c = 0; c < channels; c++) {
             int co = (channels > 8) ? c :
-                     ff_vorbis_encoding_channel_layout_offsets[channels - 1][c];
+                     vorbis_encoding_channel_layout_offsets[channels - 1][c];
             memcpy(buffer[c], frame->extended_data[co],
                    samples * sizeof(*buffer[c]));
         }
diff --git a/libavcodec/vorbis.h b/libavcodec/vorbis.h
index 98dd14f9d4..69ddbd2982 100644
--- a/libavcodec/vorbis.h
+++ b/libavcodec/vorbis.h
@@ -26,7 +26,6 @@ 
 extern const float ff_vorbis_floor1_inverse_db_table[256];
 extern const float * const ff_vorbis_vwin[8];
 extern const uint8_t ff_vorbis_channel_layout_offsets[8][8];
-extern const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8];
 extern const uint64_t ff_vorbis_channel_layouts[9];
 
 typedef struct vorbis_floor1_entry {
diff --git a/libavcodec/vorbis_data.c b/libavcodec/vorbis_data.c
index 4dba6a8cd3..fd7e291de2 100644
--- a/libavcodec/vorbis_data.c
+++ b/libavcodec/vorbis_data.c
@@ -34,17 +34,6 @@  const uint8_t ff_vorbis_channel_layout_offsets[8][8] = {
     { 0, 2, 1, 7, 5, 6, 3, 4 },
 };
 
-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,