[FFmpeg-devel] [PATCH 4/8] avcodec/g728dec: G.728 decoder

Peter Ross pross at xvid.org
Mon Jan 13 10:08:44 EET 2025


On Sun, Jan 12, 2025 at 02:48:00PM +0100, Andreas Rheinhardt wrote:
> Peter Ross:
> > ---
> >  libavcodec/Makefile     |   1 +
> >  libavcodec/allcodecs.c  |   1 +
> >  libavcodec/codec_desc.c |   7 ++
> >  libavcodec/codec_id.h   |   1 +
> >  libavcodec/g728data.h   |  70 +++++++++++++
> >  libavcodec/g728dec.c    | 213 ++++++++++++++++++++++++++++++++++++++++
> >  libavcodec/utils.c      |   1 +
> >  7 files changed, 294 insertions(+)
> >  create mode 100644 libavcodec/g728data.h
> >  create mode 100644 libavcodec/g728dec.c
> > 

> > --- /dev/null
> > +++ b/libavcodec/g728dec.c
> > @@ -0,0 +1,213 @@
> > +/*
> > + * G.728 decoder

> > +    if (avpkt->size < 5)
> > +        return AVERROR_INVALIDDATA;
> > +
> > +    if ((ret = init_get_bits8(&gb, avpkt->data, avpkt->size)) < 0)
> > +        return ret;
> > +
> > +    frame->nb_samples = 20;
> > +    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
> > +        return ret;
> > +
> > +    decode_frame(s, &gb, (float *)frame->data[0]);
> > +
> > +    *got_frame_ptr = 1;
> > +
> > +    return 5;
> 
> Won't decoding in 5 byte blocks incur a lot of overhead?

Agree. I will fix this. Thanks for reading my code.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250113/b69fb851/attachment.sig>


More information about the ffmpeg-devel mailing list