Open duankong opened 4 years ago
I try to this code below
ffmpeg -y -i image -pix_fmt yuvj420p source420.yuv
cp source420.yuv source420.raw
opj_compress -i source420.raw -o temp.jp2 -F '%s,%s,%s,%s,u@1x1:2x2:2x2' % (width, height, 3, 8) -r 1
opj_decompress -i temp.jp2-o decoded.ppm
ffmpeg -y -i decoded.ppm-pix_fmt yuvj420p decoded420.yuv
ppm
file and then to convert it to decoded420.yuv
.But in openjpeg code stream the information of image is in YUV
format? I do not certain.
It lossy to convert a YUV
file to ppm
file .
Also it's lossy to convert a ppm
to YUV
file if not in YCoCg
So the psnr
between decoded420.yuv
and source420.yuv
is 56.66 ,it large compare the commom psnr
,may be it can be consider as lossless ? But actually ,it's not lossless. I'm not sure if the lossy cause by the convert between ppm
and YUV
or other problem. Or both them.
I coule compress a yuv444 raw data with this code in lossless
but when i change the sampling mode into yuv420
I know the
decoded.raw
is in 444 format. I try to convert it to 420 sampling ,but it is not lossless withsource420.yuv
.I also try to expand
source420.yuv
to 444 format ,but it is not lossless withdecoded.yuv
.In a word:I can't get a lossless result.
Note: I caculate the
psnr
betweensource.yuv
/souce420.yuv
anddecode.yuv
withffmpeg