[MPlayer-dev-eng] Re: Proposed changes to af_resample

Tobias Diedrich td at sim.uni-hannover.de
Tue Jan 7 15:09:48 CET 2003


Anders Johansson wrote:
> [Arpi wrote:]
> > imho if they are almost same, then no resampling should be done!
> > video will play a little bit slower/faster but no one can notice +-1% ...
> 
> I am trying to avoid this cause it will mean a redesign of the
> automatic filter insertion or an interface redesign or an ugly
> hack. Perhaps the best solution is to fix it in
> libmpcodecs/dec_audio.c ?

I don't see why this would mean a redesign...
AFAICS the resample plugin is inserted in af.c line 350ff:

|    // Check output frequency if not OK fix with resample
|    if(s->last->data->rate!=s->output.rate){
[...]

So if one could change the compare in the following way:

/*
 * maxdeviation is between 0 and 1 and defines the maximum deviation
 * from target allowed in percent.
 */

#define almost_eq(x, target, maxdeviation) \
	((target*(1-maxdeviation) <= x) && \
	 (x <= target*(1+maxdeviation)))

// Check output frequency if not OK fix with resample
if (!almost_eq(s->last->data->rate, s->output.rate, s->cfg.sloppycompareaccuracy){

-- 
Tobias								PGP: 0x9AC7E0BC
This mail is made of 100% recycled bits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030107/3f9b8ab9/attachment.pgp>


More information about the MPlayer-dev-eng mailing list