Package com.gdflab.gdfsr
Class GDFUpscaler
- java.lang.Object
-
- com.gdflab.gdfsr.GDFUpscaler
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class GDFUpscaler extends java.lang.Object implements java.io.CloseableGDFUpscaler class upscale image and enhance image quality.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGDFUpscaler.DelegateTypeTensorflow Lite delegate types.
-
Field Summary
Fields Modifier and Type Field Description (package private) static NativeWrappernativeWrapstatic booleanVERBOSEDetail logging enabled/disabled.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearBuffers()voidclose()GDFContextconv2RGBf(GDFContext ctx)GDFContextconv2YUVf(java.nio.ByteBuffer inp, int extra_ival)intgetScale()static GDFUpscalergetUpscaler(int scale, int width, int height)Get GDFUpscaler instance from upscaling scale and input video resolution.static booleaninitialize(android.content.Context context)Initialize with android context.voidupscale(GDFContext ctx)
-
-
-
Field Detail
-
nativeWrap
static NativeWrapper nativeWrap
-
VERBOSE
public static boolean VERBOSE
Detail logging enabled/disabled.
-
-
Method Detail
-
initialize
public static boolean initialize(android.content.Context context) throws GDFUpscaleExceptionInitialize with android context. Needed for validate OpenGL ES version, and get device model name to select appropriate model. Must be called before use of any API.- Parameters:
context- Android context instance(getApplicationContext() from any Activity).- Throws:
GDFUpscaleException- When device is not supported.
-
getUpscaler
public static GDFUpscaler getUpscaler(int scale, int width, int height) throws GDFUpscaleException
Get GDFUpscaler instance from upscaling scale and input video resolution.- Parameters:
scale- Upscaling scale.width- Input video width.height- Input video height.- Returns:
- GDFUpscaler instance.
- Throws:
GDFUpscaleException- When can't get appropriate model or not initialized.
-
conv2YUVf
public GDFContext conv2YUVf(java.nio.ByteBuffer inp, int extra_ival) throws GDFUpscaleException
- Throws:
GDFUpscaleException
-
upscale
public void upscale(GDFContext ctx) throws GDFUpscaleException
- Throws:
GDFUpscaleException
-
conv2RGBf
public GDFContext conv2RGBf(GDFContext ctx) throws GDFUpscaleException
- Throws:
GDFUpscaleException
-
clearBuffers
public void clearBuffers()
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
getScale
public int getScale()
-
-