40 lines
962 B
Java
40 lines
962 B
Java
package com.hw.videoprocessor.util;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class FrameDropper {
|
|
private int a;
|
|
private int b;
|
|
private boolean c;
|
|
private int d;
|
|
private int e;
|
|
|
|
public FrameDropper(int i, int i2) {
|
|
this.a = i;
|
|
this.b = i2;
|
|
if (i <= i2) {
|
|
CL.a("原始帧率:" + i + "小于目标帧率:" + i2 + ",不支持补帧", new Object[0]);
|
|
this.c = true;
|
|
}
|
|
}
|
|
|
|
public boolean a(int i) {
|
|
if (this.c) {
|
|
return false;
|
|
}
|
|
if (i == 0) {
|
|
this.e++;
|
|
return false;
|
|
}
|
|
float f = (r7 - this.b) / this.a;
|
|
int i2 = this.d;
|
|
int i3 = this.e;
|
|
boolean z = Math.abs((((float) (i2 + 1)) / ((float) (i2 + i3))) - f) < Math.abs((((float) i2) / ((float) ((i2 + i3) + 1))) - f);
|
|
if (z) {
|
|
this.d++;
|
|
} else {
|
|
this.e++;
|
|
}
|
|
return z;
|
|
}
|
|
}
|