00001 package commandline.Encoder.foutenschatter;
00002
00003 import commandline.debuggingCode.Debug;
00004
00005 public class PSNRschatter {
00006
00007 float vorige_PSNR;
00008 float doel_PSNR;
00009 public PSNRschatter(float doelPSNR,float start_PSNR) {
00010 this.vorige_PSNR=start_PSNR;
00011 this.doel_PSNR=doelPSNR;
00012 }
00013
00014
00015 public int getGeschatteAantalStappen(int huidigAantalStappen, float huidigePSNR){
00016 float huidige_overbrugde_PSNR=huidigePSNR-this.vorige_PSNR;
00017 if(huidige_overbrugde_PSNR==0){return 1;}
00018 float vorige_PSNRwinst_per_stap=huidige_overbrugde_PSNR/huidigAantalStappen;
00019 float geschat_aantalstappen=(this.doel_PSNR-huidigePSNR)/vorige_PSNRwinst_per_stap;
00020
00021 this.vorige_PSNR=huidigePSNR;
00022 geschat_aantalstappen=geschat_aantalstappen/2;
00023 if(!Debug.DISTIBUTION) Debug.print("geschat_aantalstappen = "+geschat_aantalstappen);
00024 return (int)(Math.abs(geschat_aantalstappen));
00025 }
00026
00027 }