Move nv_avc_init into setup

This commit is contained in:
Diego Waxemberg 2014-01-20 23:49:06 -05:00
parent 01f11fc095
commit ef6909da88
2 changed files with 23 additions and 24 deletions

View File

@ -8,6 +8,29 @@
#import <Foundation/Foundation.h>
// Disables the deblocking filter at the cost of image quality
#define DISABLE_LOOP_FILTER 0x1
// Uses the low latency decode flag (disables multithreading)
#define LOW_LATENCY_DECODE 0x2
// Threads process each slice, rather than each frame
#define SLICE_THREADING 0x4
// Uses nonstandard speedup tricks
#define FAST_DECODE 0x8
// Uses bilinear filtering instead of bicubic
#define BILINEAR_FILTERING 0x10
// Uses a faster bilinear filtering with lower image quality
#define FAST_BILINEAR_FILTERING 0x20
// Disables color conversion (output is NV21)
#define NO_COLOR_CONVERSION 0x40
// Native color format: RGB0
#define NATIVE_COLOR_RGB0 0x80
// Native color format: 0RGB
#define NATIVE_COLOR_0RGB 0x100
// Native color format: ARGB
#define NATIVE_COLOR_ARGB 0x200
// Native color format: RGBA
#define NATIVE_COLOR_RGBA 0x400
@interface VideoDecoder : NSObject
int nv_avc_init(int width, int height, int perf_lvl, int thread_count);
void nv_avc_destroy(void);

View File

@ -11,34 +11,10 @@
#import "swscale.h"
#include <pthread.h>
// Disables the deblocking filter at the cost of image quality
#define DISABLE_LOOP_FILTER 0x1
// Uses the low latency decode flag (disables multithreading)
#define LOW_LATENCY_DECODE 0x2
// Threads process each slice, rather than each frame
#define SLICE_THREADING 0x4
// Uses nonstandard speedup tricks
#define FAST_DECODE 0x8
// Uses bilinear filtering instead of bicubic
#define BILINEAR_FILTERING 0x10
// Uses a faster bilinear filtering with lower image quality
#define FAST_BILINEAR_FILTERING 0x20
// Disables color conversion (output is NV21)
#define NO_COLOR_CONVERSION 0x40
// Native color format: RGB0
#define NATIVE_COLOR_RGB0 0x80
// Native color format: 0RGB
#define NATIVE_COLOR_0RGB 0x100
// Native color format: ARGB
#define NATIVE_COLOR_ARGB 0x200
// Native color format: RGBA
#define NATIVE_COLOR_RGBA 0x400
@implementation VideoDecoder
- (id) init
{
self = [super init];
nv_avc_init(1280, 720, DISABLE_LOOP_FILTER | FAST_DECODE | FAST_BILINEAR_FILTERING, 1);
return self;
}