[FFmpeg-devel] [PATCH v2 4/8] aacenc: reset marked IS and M/S bands upon frame encoding

Michael Niedermayer michaelni at gmx.at
Fri Jul 3 16:19:44 CEST 2015


On Fri, Jul 03, 2015 at 12:02:18AM -0300, Claudio Freire wrote:
> On Thu, Jul 2, 2015 at 3:13 PM, Rostislav Pehlivanov
> <atomnuker at gmail.com> wrote:
> > This commit resets any bands marked as M/S or IS upon encoding a frame. This is needed because the arrays may contain some residual information upon allocation on startup and because there isn't any mechanism to reset the arrays once the frame has been encoded.
> > ---
> >  libavcodec/aacenc.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
> > index 3a512ff..05a8162 100644
> > --- a/libavcodec/aacenc.c
> > +++ b/libavcodec/aacenc.c
> > @@ -617,6 +617,8 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
> >              tag      = s->chan_map[i+1];
> >              chans    = tag == TYPE_CPE ? 2 : 1;
> >              cpe      = &s->cpe[i];
> > +            memset(cpe->is_mask, 0, sizeof(cpe->is_mask));
> > +            memset(cpe->ms_mask, 0, sizeof(cpe->ms_mask));
> >              put_bits(&s->pb, 3, tag);
> >              put_bits(&s->pb, 4, chan_el_counter[tag]++);
> >              for (ch = 0; ch < chans; ch++)
> 
> 
> Looks good and necessary

applied

thanks

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

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150703/9da1300b/attachment.asc>


More information about the ffmpeg-devel mailing list