jpegTurbo 调试记录
目的,需要将Jpeg 图片转换为yuv442p
思路jpeg 解码再通过公式转换为yuv442p
#include "turbojpeg.h"
tjInitDecompress
tjDecompressHeader3
tjBufSizeYUV2(width,pad,height,TJSAMP_422) //pad 0 获取大小为零,所以这个pad 具体是指多少?
@param pad the width of each line in each plane of the image is padded to
* the nearest multiple(倍数) of this number of bytes (must be a power of 2.)
行会被填充为该值最接近的整数倍,且该值为2的幂。如1920,1,2,4,8,。。64均整除填充为零,总字节数为4147200,128 填充64*2个(4285440),256 则需要每行填充128*2个总字节数为4423680,
必须为2的幂,传入1大小为原始大小,2也同样为原始倍数(这个地方不对会导致转换是报参数无效错误)
tjDecompressToYUV2 空间会比计算的大,针对部分格式的图片和分辨率,待研究?
赞 (0)