Browse Source

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
tags/v0.5
Martin Guillaume Poirier 19 years ago
parent
commit
4ec0ccb1a4
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      libavcodec/amr.c

+ 5
- 1
libavcodec/amr.c 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;
}



Loading…
Cancel
Save