[FFmpeg-devel] [PATCH] wmapro decoder

Michael Niedermayer michaelni
Sun Sep 6 03:41:07 CEST 2009


On Sat, Sep 05, 2009 at 05:21:48PM +0200, Sascha Sommer wrote:
> Hi,
> 
> > > > > > > +            /** save transmitted scale factors so that they can
> > > > > > > be reused for +                the next subframe */
> > > > > > > +            memcpy(s->channel[c].saved_scale_factors,
> > > > > > > +                   s->channel[c].scale_factors, s->num_bands *
> > > > > > > +                   sizeof(*s->channel[c].saved_scale_factors));
> > > > > >
> > > > > > what happens with s->channel[c].scale_factors so that it cant just
> > > > > > be used?
> > > > >
> > > > > The saved scale factors might be resampled for several subframes
> > > > > before some new values are transmitted and saved_scale_factors is
> > > > > updated. If the resampled scale factors would be used for the
> > > > > resampling, the output would change. Therefore two buffers are
> > > > > needed.
> > > >
> > > > understood, please document this though, also isnt it possible to just
> > > > exchange 2 pointers instead of a memcpy?
> > >
> > > I documented it. Is the attached pointer exchange code ok or did you have
> > > something different in mind?
> >
> > [...]
> >
> > >              } else {
> > >                  int i;
> > > +                memcpy(s->channel[c].scale_factors,
> > > +                       s->channel[c].resampled_scale_factors,
> > > s->num_bands * +                      
> > > sizeof(*s->channel[c].saved_scale_factors)); /** run level decode
> > > differences to the resampled factors */ for (i = 0; i < s->num_bands;
> > > i++) {
> > >                      int idx;
> >
> > thats still a memcpy ...
> >
> > i had in mind, no mempcpy at all, am i missing something tha makes that
> > impossible?
> >
> 
> No. Attached patch should do.

ok

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090906/9bfd95e3/attachment.pgp>



More information about the ffmpeg-devel mailing list