diff options
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/g723_1.c | 2 | ||||
-rw-r--r-- | libavcodec/mpc8.c | 2 | ||||
-rw-r--r-- | libavcodec/mpegaudiodec.c | 2 | ||||
-rw-r--r-- | libavcodec/mpegaudioenc.c | 5 | ||||
-rw-r--r-- | libavcodec/x86/pngdsp.asm | 2 |
5 files changed, 11 insertions, 2 deletions
diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c index 2b59711..dcf285d 100644 --- a/libavcodec/g723_1.c +++ b/libavcodec/g723_1.c @@ -264,6 +264,7 @@ static int scale_vector(int16_t *vector, int length) for (i = 0; i < length; i++) max = FFMAX(max, FFABS(vector[i])); + max = FFMIN(max, 0x7FFF); bits = normalize_bits(max, 15); scale = shift_table[bits]; @@ -913,6 +914,7 @@ static void formant_postfilter(G723_1_Context *p, int16_t *lpc, int16_t *buf) } iir_filter(filter_coef[0], filter_coef[1], buf + i, filter_signal + i, 1); + lpc += LPC_ORDER; } memcpy(p->fir_mem, buf + FRAME_LEN, LPC_ORDER * sizeof(int16_t)); diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index 7a075e3..cb30b2c 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -419,6 +419,8 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data, c->cur_frame++; c->last_bits_used = get_bits_count(gb); + if(get_bits_left(gb) < 8) // we have only padding left + c->last_bits_used = buf_size << 3; if(c->cur_frame >= c->frames) c->cur_frame = 0; diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index d24b35d..8507976 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -1686,7 +1686,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr, if (s->frame_size <= 0 || s->frame_size > buf_size) { av_log(avctx, AV_LOG_ERROR, "incomplete frame\n"); return AVERROR_INVALIDDATA; - }else if(s->frame_size < buf_size){ + } else if (s->frame_size < buf_size) { av_log(avctx, AV_LOG_DEBUG, "incorrect frame size - multiple frames in buffer?\n"); buf_size= s->frame_size; } diff --git a/libavcodec/mpegaudioenc.c b/libavcodec/mpegaudioenc.c index 585ef44..2c58ddf 100644 --- a/libavcodec/mpegaudioenc.c +++ b/libavcodec/mpegaudioenc.c @@ -24,6 +24,8 @@ * The simplest mpeg audio layer 2 encoder. */ +#include "libavutil/audioconvert.h" + #include "avcodec.h" #include "internal.h" #include "put_bits.h" @@ -792,6 +794,9 @@ AVCodec ff_mp2_encoder = { .supported_samplerates = (const int[]){ 44100, 48000, 32000, 22050, 24000, 16000, 0 }, + .channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, + AV_CH_LAYOUT_STEREO, + 0 }, .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), .defaults = mp2_defaults, }; diff --git a/libavcodec/x86/pngdsp.asm b/libavcodec/x86/pngdsp.asm index 8999c17..970f3db 100644 --- a/libavcodec/x86/pngdsp.asm +++ b/libavcodec/x86/pngdsp.asm @@ -28,7 +28,7 @@ SECTION_RODATA cextern pw_255 -SECTION_TEXT 16 +SECTION_TEXT ; %1 = nr. of xmm registers used %macro ADD_BYTES_FN 1 |