[Ffmpeg-devel] [PATCH] new version

Michael Niedermayer michaelni
Thu Sep 14 22:37:04 CEST 2006


Hi

On Thu, Sep 14, 2006 at 10:25:31PM +0300, Andrew Voznytsa wrote:
> Michael Niedermayer wrote:
> > Hi
> >
> > On Thu, Sep 14, 2006 at 06:59:31PM +0300, Andrew Voznytsa wrote:
> >   
> >> Michael Niedermayer wrote:
> >>     
> >>> wont that break amr stored in containers with a sample_rate different from
> >>> that?
> >>>   
> >>>       
> >> As it was mentioned by Benjamin Larsson it is invalid, but as you say -
> >> possible.
> >>
> >> New, spears saving, patch attached. I'd notice that I need it in case
> >> when lavc is used without lavf. Also, for illegal use fans, it would be
> >> worth to change faad.c because sample_rate/channels are initialized
> >> using GA_DecoderSpecificInfo() (AKA extradata) instead preserving
> >> container values.
> >>     
> >
> > i think channels can be set unconditionally and
> > please avoid the code duplication
> >
> >   
> If this is so principal: according to RFC 3267 'stereophonic speech
> session' is possible. This RFC says that 'out-of-band signaling must be
> used to indicate the number of channels' . And 'Although AMR and AMR-WB
> codecs themselves do not support encoding of multi-channel audio content
> into a single bit stream, they can be used to separately encode and
> decode each of the individual channels'. IMO in such case number of AMR
> frames feed to decoder (and decoded) is equal to signaled number of
> channels. After decoding decoder should post process output data if
> required (i.e. interleave samples). Currently lavc's wrapper does not
> support this case. Then it would be right to check signaled number of
> channels and if it is 2+ return error saying that multichannel decoding
> not supported. Alternative way for decoding multichannel AMR would be to
> use a few instances of lavc's AMR decoder wrapper, but for user side it
> is a bit unusual use case when single track should be decoded using more
> than one decoder. Plus it is better to implement it once on lavc side
> (when required) then implementing it each time on user side.
> 
> --
> Best regards,
> Andrew Voznytsa
> 

> Index: libavcodec/amr.c
> ===================================================================
> --- libavcodec/amr.c	(revision 6252)
> +++ libavcodec/amr.c	(working copy)
> @@ -107,6 +107,23 @@
>      return(MR122);
>  }
>  
> +static void amr_decode_fix_avctx(AVCodecContext * avctx)
> +{
> +    const int is_amr_wb = avctx->codec_id == CODEC_ID_AMR_WB;
> +
> +    if(avctx->sample_rate == 0)
> +    {
> +        avctx->sample_rate = 8000 * is_amr_wb;
> +    }

AMR_NB will end up with a sample_rate of 0 here ...


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list