From 50dfb4359619563012997bc3ddafb7667741066c Mon Sep 17 00:00:00 2001 From: Mamadou DIOP Date: Tue, 23 Feb 2016 22:00:35 +0100 Subject: Add new QoS implementation Code formatting --- thirdparties/win32/include/cuda/types.h | 189 ++++++++++++++++---------------- 1 file changed, 93 insertions(+), 96 deletions(-) (limited to 'thirdparties/win32/include/cuda') diff --git a/thirdparties/win32/include/cuda/types.h b/thirdparties/win32/include/cuda/types.h index c7be519..e4941e5 100755 --- a/thirdparties/win32/include/cuda/types.h +++ b/thirdparties/win32/include/cuda/types.h @@ -18,26 +18,25 @@ extern "C" { #endif -struct NVEncoderParams -{ +struct NVEncoderParams { char configFile[256]; char inputFile[256]; char outputFile[256]; - int measure_psnr; - int measure_fps; - int force_device; - int iSurfaceFormat; - int iPictureType; - int nDeviceMemPitch; - - int iCodecType; // NVVE_CODEC_TYPE, - int GPU_count; // Choose the specific GPU count - int GPU_devID; // Choose the specific GPU device ID - int iUseDeviceMem; // CUDA with DEVICE_MEMORY_INPUT (for encoding) - int iForcedGPU; // NVVE_FORCE_GPU_SELECTION //F22 + int measure_psnr; + int measure_fps; + int force_device; + int iSurfaceFormat; + int iPictureType; + int nDeviceMemPitch; + + int iCodecType; // NVVE_CODEC_TYPE, + int GPU_count; // Choose the specific GPU count + int GPU_devID; // Choose the specific GPU device ID + int iUseDeviceMem; // CUDA with DEVICE_MEMORY_INPUT (for encoding) + int iForcedGPU; // NVVE_FORCE_GPU_SELECTION //F22 int iOutputSize[2]; // NVVE_OUT_SIZE, int iInputSize[2]; // NVVE_IN_SIZE, - float fAspectRatio; // + float fAspectRatio; // int iAspectRatio[3]; // NVVE_ASPECT_RATIO, NVVE_FIELD_MODE Fieldmode; // NVVE_FIELD_ENC_MODE, int iP_Interval; // NVVE_P_INTERVAL, @@ -60,10 +59,10 @@ struct NVEncoderParams int iDisableCabac; // NVVE_DISABLE_CABAC, int iNaluFramingType; // NVVE_CONFIGURE_NALU_FRAMING_TYPE int iDisableSPSPPS; // NVVE_DISABLE_SPS_PPS - NVVE_GPUOffloadLevel GPUOffloadLevel; // NVVE_GPU_OFFLOAD_LEVEL - NVVE_GPUOffloadLevel MaxOffloadLevel; // NVVE_GPU_OFFLOAD_LEVEL_MAX - int iSliceCnt; // NVVE_SLICE_COUNT //F19 - int iMultiGPU; // NVVE_MULTI_GPU //F21 + NVVE_GPUOffloadLevel GPUOffloadLevel; // NVVE_GPU_OFFLOAD_LEVEL + NVVE_GPUOffloadLevel MaxOffloadLevel; // NVVE_GPU_OFFLOAD_LEVEL_MAX + int iSliceCnt; // NVVE_SLICE_COUNT //F19 + int iMultiGPU; // NVVE_MULTI_GPU //F21 int iDeviceMemInput; // NVVE_DEVICE_MEMORY_INPUT //F23 // NVVE_STAT_NUM_CODED_FRAMES, @@ -81,29 +80,27 @@ struct NVEncoderParams }; typedef struct { - char *name; - char *yuv_type; - int bpp; + char *name; + char *yuv_type; + int bpp; } _sYUVParams; -static _sYUVParams sSurfaceFormat[] = -{ - { "UYVY", "4:2:2", 16 }, - { "YUY2", "4:2:2", 16 }, - { "YV12", "4:2:0", 12 }, - { "NV12", "4:2:0", 12 }, - { "IYUV", "4:2:0", 12 }, - { NULL , 0 } +static _sYUVParams sSurfaceFormat[] = { + { "UYVY", "4:2:2", 16 }, + { "YUY2", "4:2:2", 16 }, + { "YV12", "4:2:0", 12 }, + { "NV12", "4:2:0", 12 }, + { "IYUV", "4:2:0", 12 }, + { NULL , 0 } }; typedef struct { - char *name; - int params; + char *name; + int params; } _sNVVEEncodeParams; -static _sNVVEEncodeParams sNVVE_EncodeParams[] = -{ - { "UNDEFINED", 1 }, +static _sNVVEEncodeParams sNVVE_EncodeParams[] = { + { "UNDEFINED", 1 }, { "NVVE_OUT_SIZE", 2 }, { "NVVE_ASPECT_RATIO", 3 }, { "NVVE_FIELD_ENC_MODE", 1 }, @@ -111,7 +108,7 @@ static _sNVVEEncodeParams sNVVE_EncodeParams[] = { "NVVE_IDR_PERIOD", 1 }, { "NVVE_DYNAMIC_GOP", 1 }, { "NVVE_RC_TYPE", 1 }, - { "NVVE_AVG_BITRATE", 1 }, + { "NVVE_AVG_BITRATE", 1 }, { "NVVE_PEAK_BITRATE", 1 }, { "NVVE_QP_LEVEL_INTRA", 1 }, { "NVVE_QP_LEVEL_INTER_P", 1 }, @@ -124,7 +121,7 @@ static _sNVVEEncodeParams sNVVE_EncodeParams[] = { "NVVE_CLEAR_STAT (DS)", 1 }, //DShow only { "NVVE_SET_DEINTERLACE", 1 }, { "NVVE_PRESETS", 1 }, - { "NVVE_IN_SIZE", 2 }, + { "NVVE_IN_SIZE", 2 }, { "NVVE_STAT_NUM_CODED_FRAMES (DS)", 1 }, //DShow only { "NVVE_STAT_NUM_RECEIVED_FRAMES (DS)", 1 }, //DShow only { "NVVE_STAT_BITRATE (DS)", 1 }, //DShow only @@ -138,7 +135,7 @@ static _sNVVEEncodeParams sNVVE_EncodeParams[] = { "NVVE_STAT_PERF_FPS (DS)", 1 }, //DShow only { "NVVE_STAT_PERF_AVG_TIME (DS)", 1 }, //DShow only { "NVVE_DISABLE_CABAC", 1 }, - { "NVVE_CONFIGURE_NALU_FRAMING_TYPE", 1 }, + { "NVVE_CONFIGURE_NALU_FRAMING_TYPE", 1 }, { "NVVE_DISABLE_SPS_PPS", 1 }, { "NVVE_SLICE_COUNT", 1 }, { "NVVE_GPU_OFFLOAD_LEVEL", 1 }, @@ -147,91 +144,91 @@ static _sNVVEEncodeParams sNVVE_EncodeParams[] = { "NVVE_GET_GPU_COUNT", 1 }, { "NVVE_GET_GPU_ATTRIBUTES", 1 }, { "NVVE_FORCE_GPU_SELECTION", 1 }, - { "NVVE_DEVICE_MEMORY_INPUT", 1 }, - { "NVVE_DEVICE_CTX_LOCK", 1 }, - { NULL, 0 } + { "NVVE_DEVICE_MEMORY_INPUT", 1 }, + { "NVVE_DEVICE_CTX_LOCK", 1 }, + { NULL, 0 } }; static _sNVVEEncodeParams sProfileName[] = { - { "Baseline", 0x42 }, - { "Main" , 0x4d }, - { "High" , 0x64 }, - { NULL , 0 } + { "Baseline", 0x42 }, + { "Main" , 0x4d }, + { "High" , 0x64 }, + { NULL , 0 } }; static _sNVVEEncodeParams sProfileLevel[] = { - { "1.0", 0x0a }, - { "1.1", 0x0b }, - { "1.2", 0x0c }, - { "1.3", 0x0d }, - { "2.0", 0x14 }, - { "2.1", 0x15 }, - { "2.2", 0x16 }, - { "3.0", 0x1e }, - { "3.1", 0x1f }, - { "3.2", 0x20 }, - { "4.0", 0x28 }, - { "4.1", 0x29 }, - { "4.2", 0x29 }, - { "5.0", 0x32 }, - { "5.1", 0x33 }, - { "Auto", 0xff }, - { NULL , 0 } + { "1.0", 0x0a }, + { "1.1", 0x0b }, + { "1.2", 0x0c }, + { "1.3", 0x0d }, + { "2.0", 0x14 }, + { "2.1", 0x15 }, + { "2.2", 0x16 }, + { "3.0", 0x1e }, + { "3.1", 0x1f }, + { "3.2", 0x20 }, + { "4.0", 0x28 }, + { "4.1", 0x29 }, + { "4.2", 0x29 }, + { "5.0", 0x32 }, + { "5.1", 0x33 }, + { "Auto", 0xff }, + { NULL , 0 } }; inline char * sProfileIDX2Char(_sNVVEEncodeParams *pProfile, int ID) { - int index; - for (index = 0; pProfile[index].name != NULL; index++) { - if (pProfile[index].params == ID) { - // found the profile return the string - return pProfile[index].name; - } - } - return NULL; + int index; + for (index = 0; pProfile[index].name != NULL; index++) { + if (pProfile[index].params == ID) { + // found the profile return the string + return pProfile[index].name; + } + } + return NULL; } static char *sVideoEncodePresets[] = { - "PSP ( 320x 240)", - "iPod/iPhone ( 320x 240)", - "AVCHD", - "BluRay", - "HDV_1440", - "ZuneHD", - "FlipCam", - NULL + "PSP ( 320x 240)", + "iPod/iPhone ( 320x 240)", + "AVCHD", + "BluRay", + "HDV_1440", + "ZuneHD", + "FlipCam", + NULL }; static char *sGPUOffloadLevel[] = { - "CPU PEL processing", - "Motion Estimation", - "Full Encode", - NULL + "CPU PEL processing", + "Motion Estimation", + "Full Encode", + NULL }; static char *sPictureType[] = { - "Frame Mode", - "Field Mode (top first)", - "Field Mode (bottom first)", - "Field Mode (picaff) unsupported", - NULL + "Frame Mode", + "Field Mode (top first)", + "Field Mode (bottom first)", + "Field Mode (picaff) unsupported", + NULL }; static char *sPictureStructure[] = { - "Unknown", - "Top Field", - "Bottom Field", - "Frame Picture", - NULL + "Unknown", + "Top Field", + "Bottom Field", + "Frame Picture", + NULL }; // Rate Control Method (NVVE_RC_TYPE) static char *sNVVE_RateCtrlType[] = { - "Rate Control CQP", + "Rate Control CQP", "Rate Control VBR", - "Rate Control CBR with QP", - "Rate Control VBR with Min QP", - NULL + "Rate Control CBR with QP", + "Rate Control VBR with Min QP", + NULL }; #ifdef __cplusplus -- cgit v1.1