[FFmpeg-devel] [PATCH] G.722 decoder

Martin Storsjö martin
Thu Sep 9 10:04:39 CEST 2010

On Thu, 9 Sep 2010, Carl Eugen Hoyos wrote:

> Martin Storsj? <martin <at> martin.st> writes:
> > Implemented it, and it works more or less. I had to add an A flag to the 
> > lowres option in lavc/options.c. Also, if lowres is enabled, I set the 
> > sample rate to the half in g722_init, but it doesn't propagate 
> > automatically to the output when transcoding with ffmpeg, since it 
> > probably copies the original sample rate before opening the decoder.
> I suspect you have to right shift the sample_rate in avcodec_open by lowres (and
> remove AVMEDIA_TYPE_VIDEO from the lowres sanity check and change your decoder
> definition accordingly).

I don't think that would help. The original sample rate is copied to the 
output encoder before the input decoder is opened, and thus it doesn't 
matter if the shifting happens in avcodec_open or the codec's init 
function, which is called within avcodec_open.

// Martin

More information about the ffmpeg-devel mailing list