資源簡介
使用CUDA,將NV12格式的緩沖區編碼為JPEG。代碼可以編譯,并直接運行。代碼是https://blog.csdn.net/mikedai/article/details/79084092,進行了接口、對齊、編譯功能。
代碼片段和文件信息
#include?
#include?
#include?
#include?“Endianess.h“
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?“gh_jpegnpp.h“
//量化表數據
typedef?struct?
{
????unsigned?char?nPrecisionAndIdentifier;
????unsigned?char?aTable[64];
}?QuantizationTable;
//圖片信息
typedef?struct?
{
????unsigned?char??nSamplePrecision;
????unsigned?short?nHeight;
????unsigned?short?nWidth;
????unsigned?char??nComponents;
????unsigned?char??aComponentIdentifier[3];
????unsigned?char??aSamplingFactors[3];
????unsigned?char??aQuantizationTableSelector[3];
}?frameHeader;
//掃描頭
typedef?struct?
{
????unsigned?char?nComponents;
????unsigned?char?aComponentSelector[3];
????unsigned?char?
評論
共有 條評論