[FFmpeg-devel] [PATCH] Add a G.722 encoder

Martin Storsjö martin
Thu Sep 23 23:20:50 CEST 2010


On Thu, 23 Sep 2010, Michael Niedermayer wrote:

> On Fri, Sep 17, 2010 at 09:31:15AM +0300, Martin Storsj? wrote:
> [...]
> > +static inline int encode_high(G722Context *c, int xhigh)
> [...]
> > +static inline int encode_low(const struct G722Band* state, int xlow)
> 
> creepily inconsistant both should be G722Band if possible

Changed

> > +static int g722_encode_frame(AVCodecContext *avctx,
> > +                             uint8_t *dst, int buf_size, void *data)
> > +{
> > +    G722Context *c = avctx->priv_data;
> > +    const int16_t *samples = data;
> > +    int i;
> > +
> > +    for (i = 0; i < buf_size >> 1; i++) {
> > +        int xlow, xhigh, ihigh, ilow;
> > +        filter_samples(c, &samples[2*i], &xlow, &xhigh);
> 
> > +        ihigh = encode_high(c, xhigh);
> > +        ilow  = encode_low(&c->band[0], xlow);
> > +        update_low_predictor(&c->band[0], ilow >> 2);
> 
> update_* is also inconsistantly called

Changed so that encode_high doesn't update the predictor implicitly, to 
make them consistent.

New round attached.

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-a-G.722-encoder.patch
Type: text/x-diff
Size: 6369 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100924/8ffeaa87/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-initial-trellis-support-in-the-G.722-encoder.patch
Type: text/x-diff
Size: 8257 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100924/8ffeaa87/attachment-0001.patch>



More information about the ffmpeg-devel mailing list