allow amr bitrate to be changed "on the fly" through avctx->bitrate.

Patch by Martin % marthi A graphics P cs P uni - sb P de %
Original thread:
date: Nov 20, 2006 6:20 PM
subject: Re: [Ffmpeg-devel] [PATCH] Re: AMR bitrate

Originally committed as revision 7139 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Martin 2006-11-20 20:35:47 +00:00 committed by Guillaume Poirier
parent 0d6d963294
commit 4ec0ccb1a4

View File

@ -482,6 +482,8 @@ static int amr_nb_encode_frame(AVCodecContext *avctx,
AMRContext *s = (AMRContext*)avctx->priv_data;
int written;
s->enc_bitrate=getBitrateMode(avctx->bit_rate);
written = Encoder_Interface_Encode(s->enstate,
s->enc_bitrate,
data,
@ -624,7 +626,9 @@ static int amr_wb_encode_frame(AVCodecContext *avctx,
unsigned char *frame/*out*/, int buf_size, void *data/*in*/)
{
AMRWBContext *s = (AMRWBContext*) avctx->priv_data;
int size = E_IF_encode(s->state, s->mode, data, frame, s->allow_dtx);
int size;
s->mode=getWBBitrateMode(avctx->bit_rate);
size = E_IF_encode(s->state, s->mode, data, frame, s->allow_dtx);
return size;
}