You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/aacenc: Remove always-false check
The sample rates have already been checked generically via AVCodec.supported_samplerates. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -1235,14 +1235,13 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Samplerate */
|
/* Samplerate */
|
||||||
for (i = 0; i < 16; i++)
|
for (int i = 0;; i++) {
|
||||||
if (avctx->sample_rate == ff_mpeg4audio_sample_rates[i])
|
av_assert1(i < 13);
|
||||||
break;
|
if (avctx->sample_rate == ff_mpeg4audio_sample_rates[i]) {
|
||||||
s->samplerate_index = i;
|
s->samplerate_index = i;
|
||||||
ERROR_IF(s->samplerate_index == 16 ||
|
break;
|
||||||
s->samplerate_index >= ff_aac_swb_size_1024_len ||
|
}
|
||||||
s->samplerate_index >= ff_aac_swb_size_128_len,
|
}
|
||||||
"Unsupported sample rate %d\n", avctx->sample_rate);
|
|
||||||
|
|
||||||
/* Bitrate limiting */
|
/* Bitrate limiting */
|
||||||
WARN_IF(1024.0 * avctx->bit_rate / avctx->sample_rate > 6144 * s->channels,
|
WARN_IF(1024.0 * avctx->bit_rate / avctx->sample_rate > 6144 * s->channels,
|
||||||
|
@ -103,6 +103,3 @@ const uint8_t *const ff_aac_swb_size_1024[] = {
|
|||||||
swb_size_1024_16, swb_size_1024_16, swb_size_1024_8,
|
swb_size_1024_16, swb_size_1024_16, swb_size_1024_8,
|
||||||
swb_size_1024_8
|
swb_size_1024_8
|
||||||
};
|
};
|
||||||
|
|
||||||
const int ff_aac_swb_size_128_len = FF_ARRAY_ELEMS(ff_aac_swb_size_128);
|
|
||||||
const int ff_aac_swb_size_1024_len = FF_ARRAY_ELEMS(ff_aac_swb_size_1024);
|
|
||||||
|
@ -41,9 +41,7 @@
|
|||||||
#define AAC_MAX_CHANNELS 16
|
#define AAC_MAX_CHANNELS 16
|
||||||
|
|
||||||
extern const uint8_t *const ff_aac_swb_size_1024[];
|
extern const uint8_t *const ff_aac_swb_size_1024[];
|
||||||
extern const int ff_aac_swb_size_1024_len;
|
|
||||||
extern const uint8_t *const ff_aac_swb_size_128[];
|
extern const uint8_t *const ff_aac_swb_size_128[];
|
||||||
extern const int ff_aac_swb_size_128_len;
|
|
||||||
|
|
||||||
/* Supported layouts without using a PCE */
|
/* Supported layouts without using a PCE */
|
||||||
static const AVChannelLayout aac_normal_chan_layouts[7] = {
|
static const AVChannelLayout aac_normal_chan_layouts[7] = {
|
||||||
|
@ -23,6 +23,10 @@
|
|||||||
#ifndef AVCODEC_MPEG4AUDIO_SAMPLE_RATES_H
|
#ifndef AVCODEC_MPEG4AUDIO_SAMPLE_RATES_H
|
||||||
#define AVCODEC_MPEG4AUDIO_SAMPLE_RATES_H
|
#define AVCODEC_MPEG4AUDIO_SAMPLE_RATES_H
|
||||||
|
|
||||||
|
// This table contains only 13 real elements and is padded with zeroes.
|
||||||
|
// It is used by the AAC encoder as sample rate table, so the encoder
|
||||||
|
// needs to actually support all of these rates and it needs to have
|
||||||
|
// a trailing zero.
|
||||||
const int ff_mpeg4audio_sample_rates[16] = {
|
const int ff_mpeg4audio_sample_rates[16] = {
|
||||||
96000, 88200, 64000, 48000, 44100, 32000,
|
96000, 88200, 64000, 48000, 44100, 32000,
|
||||||
24000, 22050, 16000, 12000, 11025, 8000, 7350
|
24000, 22050, 16000, 12000, 11025, 8000, 7350
|
||||||
|
Reference in New Issue
Block a user