History

avcodec/vorbis_data: Move encoder-related table to its only user

Said table was unused in case libvorbis was disabled.

Andreas Rheinhardt committed 5 years ago

Commit bfdf0321 parent b91b0443 files · +12 −13Browse files

Showing the changes to libavcodec (3 of 3 files). Show all

Unified · Split

3 files
  1. libavcodec/libvorbisenc.c +12 −1
  2. libavcodec/vorbis.h +0 −1
  3. libavcodec/vorbis_data.c +0 −11
libavcodec/libvorbisenc.c+12−1
@@ -70,6 +70,17 @@ static const AVClass vorbis_class = { · 69 unmodified lines
70 .version = LIBAVUTIL_VERSION_INT,70 .version = LIBAVUTIL_VERSION_INT,
71};71};
72 72
73static const uint8_t vorbis_encoding_channel_layout_offsets[8][8] = {
74 { 0 },
75 { 0, 1 },
76 { 0, 2, 1 },
77 { 0, 1, 2, 3 },
78 { 0, 2, 1, 3, 4 },
79 { 0, 2, 1, 4, 5, 3 },
80 { 0, 2, 1, 5, 6, 4, 3 },
81 { 0, 2, 1, 6, 7, 4, 5, 3 },
82};
83
73static int vorbis_error_to_averror(int ov_err)84static int vorbis_error_to_averror(int ov_err)
74{85{
75 switch (ov_err) {86 switch (ov_err) {
@@ -287,7 +298,7 @@ static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 211 unmodified lines
287 buffer = vorbis_analysis_buffer(&s->vd, samples);298 buffer = vorbis_analysis_buffer(&s->vd, samples);
288 for (c = 0; c < channels; c++) {299 for (c = 0; c < channels; c++) {
289 int co = (channels > 8) ? c :300 int co = (channels > 8) ? c :
290 ff_vorbis_encoding_channel_layout_offsets[channels - 1][c];301 vorbis_encoding_channel_layout_offsets[channels - 1][c];
291 memcpy(buffer[c], frame->extended_data[co],302 memcpy(buffer[c], frame->extended_data[co],
292 samples * sizeof(*buffer[c]));303 samples * sizeof(*buffer[c]));
293 }304 }
libavcodec/vorbis.h+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
26extern const float ff_vorbis_floor1_inverse_db_table[256];26extern const float ff_vorbis_floor1_inverse_db_table[256];
27extern const float * const ff_vorbis_vwin[8];27extern const float * const ff_vorbis_vwin[8];
28extern const uint8_t ff_vorbis_channel_layout_offsets[8][8];28extern const uint8_t ff_vorbis_channel_layout_offsets[8][8];
29extern const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8];
30extern const uint64_t ff_vorbis_channel_layouts[9];29extern const uint64_t ff_vorbis_channel_layouts[9];
31 30
32typedef struct vorbis_floor1_entry {31typedef struct vorbis_floor1_entry {
libavcodec/vorbis_data.c+0−11
@@ -34,17 +34,6 @@ const uint8_t ff_vorbis_channel_layout_offsets[8][8] = { · 33 unmodified lines
34 { 0, 2, 1, 7, 5, 6, 3, 4 },34 { 0, 2, 1, 7, 5, 6, 3, 4 },
35};35};
36 36
37const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8] = {
38 { 0 },
39 { 0, 1 },
40 { 0, 2, 1 },
41 { 0, 1, 2, 3 },
42 { 0, 2, 1, 3, 4 },
43 { 0, 2, 1, 4, 5, 3 },
44 { 0, 2, 1, 5, 6, 4, 3 },
45 { 0, 2, 1, 6, 7, 4, 5, 3 },
46};
47
48const uint64_t ff_vorbis_channel_layouts[9] = {37const uint64_t ff_vorbis_channel_layouts[9] = {
49 AV_CH_LAYOUT_MONO,38 AV_CH_LAYOUT_MONO,
50 AV_CH_LAYOUT_STEREO,39 AV_CH_LAYOUT_STEREO,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t