Imported Upstream version 6.1
[platform/upstream/ffmpeg.git] / libavcodec / mpeg4audio.c
index 2286303..fbd2a8f 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 #include "get_bits.h"
-#include "put_bits.h"
 #include "mpeg4audio.h"
 
 /**
@@ -57,14 +56,7 @@ static int parse_config_ALS(GetBitContext *gb, MPEG4AudioConfig *c, void *logctx
     return 0;
 }
 
-/* XXX: make sure to update the copies in the different encoders if you change
- * this table */
-const int avpriv_mpeg4audio_sample_rates[16] = {
-    96000, 88200, 64000, 48000, 44100, 32000,
-    24000, 22050, 16000, 12000, 11025, 8000, 7350
-};
-
-const uint8_t ff_mpeg4audio_channels[14] = {
+const uint8_t ff_mpeg4audio_channels[15] = {
     0,
     1, // mono (1/0)
     2, // stereo (2/0)
@@ -78,7 +70,8 @@ const uint8_t ff_mpeg4audio_channels[14] = {
     0,
     7, // 3/3.1
     8, // 3/2/2.1
-    24 // 3/3/3 - 5/2/3 - 3/0/0.2
+    24, // 3/3/3 - 5/2/3 - 3/0/0.2
+    8, // 3/2.1 - 2/0
 };
 
 static inline int get_object_type(GetBitContext *gb)
@@ -93,7 +86,7 @@ static inline int get_sample_rate(GetBitContext *gb, int *index)
 {
     *index = get_bits(gb, 4);
     return *index == 0x0f ? get_bits(gb, 24) :
-        avpriv_mpeg4audio_sample_rates[*index];
+        ff_mpeg4audio_sample_rates[*index];
 }
 
 int ff_mpeg4audio_get_config_gb(MPEG4AudioConfig *c, GetBitContext *gb,
@@ -169,24 +162,6 @@ int ff_mpeg4audio_get_config_gb(MPEG4AudioConfig *c, GetBitContext *gb,
     return specific_config_bitindex - start_bit_index;
 }
 
-#if LIBAVCODEC_VERSION_MAJOR < 59
-int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
-                                 int bit_size, int sync_extension)
-{
-    GetBitContext gb;
-    int ret;
-
-    if (bit_size <= 0)
-        return AVERROR_INVALIDDATA;
-
-    ret = init_get_bits(&gb, buf, bit_size);
-    if (ret < 0)
-        return ret;
-
-    return ff_mpeg4audio_get_config_gb(c, &gb, sync_extension, NULL);
-}
-#endif
-
 int avpriv_mpeg4audio_get_config2(MPEG4AudioConfig *c, const uint8_t *buf,
                                   int size, int sync_extension, void *logctx)
 {