Hi,
We are trying to develop an H.264 encoder application on DM365. When compared to other encoded bitstreams subjectively, I have seen that our encoder has worse quality than the others. In order to verify this observation, I have performed some objective tests and share the results here. So, I want to learn your ideas about how to improve the video quality. My test procedure is as follows;
1) I have downloaded some YUV test files and convert them to NV12 (YUV 4:2:0 semi-planar format) in order to use them on DM365.
2) I have used Digital video test bench (DVTB) in order to compress these YUV files to H.264 format.
3) I have compressed the same files by using "ffmpeg" in order to make a comparison. The bitrate used on DM365 and ffmpeg are almost same.
4) Both of the compressed files obtained by using DVTB on DM365 and ffmpeg are converted to YUV files (YUV 4:2:0 planar format).
5) The MSU video quality measurement tool is used to perform some objective measurements (PSNR and SSIM) on the original file and the files obtained in step 4. Also, Bitrate Viewer software is used to see the bitrates of the compressed files.
The test results and the obtained observations are given as follows;
The average bitrates of both compressed files are around 3300 kb/s as shown below.
The PSNR measurement is given below;
The SSIM measurement is given in figure below, as well.
As seen from both PSNR and SSIM measurements, ffmpeg is better and very consistent among all frames. TI encoder has worse quality than ffmpeg and the values are always changing, sometimes strange peaks and sometimes dips. The ffmpeg measurements are more stable.
This quality difference can be seen visually in a sample frame, as well. If you look at frame 110, which the cursor exists in the SSIM measurement in figure above, you can see that the original, ffmpeg coded and DM365 TI DVTB coded images are very different. All three images are given below.
Original image;
The encoded image with ffmpeg;
The encoded image with TI DVTB on DM365
If you compare the images visually, it is seen that the encoded image with ffmpeg is very close to the original one and these images are clear. But the encoded image with TI DVTB on DM365 has visible distortions. Especially, if you look at the face of the man with moustache in the right, it is very blurry. In general, the image is blurry and the image quality is low when compared to original or ffmpeg coded image. I have also tried to increase the bitrate to 5-6 mb/s for TI encoder, it is still blurry. I want to learn the reason this and I want to learn what I can.
Below, you can find the encoder parameters I set before encoding. The problem is most likely due to encoder parameters, I guess. So, please share your ideas with me on how to improve the video quality. Thanks in advance.
** DVTB Encoder commands for settings
setp engine name encodedecode
setp h264enc1 codec h264enc1
setp h264enc1 encodingPreset 3
setp h264enc1 rateControlPreset 5
setp h264enc1 maxHeight 576
setp h264enc1 maxWidth 704
setp h264enc1 maxFrameRate 30000
setp h264enc1 maxBitRate 4000000
setp h264enc1 dataEndianness 1
setp h264enc1 maxInterFrameInterval 0
setp h264enc1 inputChromaFormat 9
setp h264enc1 inputContentType 0
setp h264enc1 reconChromaFormat 9
setp h264enc1 topFieldFirstFlag 1
setp h264enc1 inputHeight 576
setp h264enc1 inputWidth 704
setp h264enc1 refFrameRate 30000
setp h264enc1 targetFrameRate 30000
setp h264enc1 targetBitRate 4000000
setp h264enc1 intraFrameInterval 30
setp h264enc1 generateHeader 0
setp h264enc1 captureWidth 0
setp h264enc1 forceFrame 0
setp h264enc1 interFrameInterval 0
setp h264enc1 mbDataFlag 0
setp h264enc1 profileIdc 100
setp h264enc1 levelIdc 40
setp h264enc1 meAlgo 0
setp h264enc1 enableVUIparams 0
setp h264enc1 EntropyMode 1
setp h264enc1 Transform8x8FlagIntraFrame 1
setp h264enc1 Transform8x8FlagInterFrame 0
setp h264enc1 EnableLongTermFrame 0
setp h264enc1 ConstraintSetFlag 0
setp h264enc1 Log2MaxFrameNumMinus4 0
setp h264enc1 svcSyntaxEnable 0
setp h264enc1 numTemporalLayers 0
setp h264enc1 resetHDVICPeveryFrame 0
setp h264enc1 SeqScalingFlag 1
setp h264enc1 EncQuality 0
setp h264enc1 enableARM926Tcm 1
setp h264enc1 enableDDRbuff 0
setp h264enc1 sliceMode 0
setp h264enc1 outputDataMode 1
setp h264enc1 sliceFormat 1
setp h264enc1 sliceSize 28
setp h264enc1 airRate 28
setp h264enc1 initQ -1
setp h264enc1 intraFrameQP 0
setp h264enc1 interPFrameQP 0
setp h264enc1 rcQMax 44
setp h264enc1 rcQMin 8
setp h264enc1 rcAlgo 1
setp h264enc1 maxDelay 2000
setp h264enc1 lfDisableIdc 0
setp h264enc1 aspectRatioX 1
setp h264enc1 aspectRatioY 1
setp h264enc1 enableBufSEI 0
setp h264enc1 enablePicTimSEI 0
setp h264enc1 perceptualRC 1
setp h264enc1 idrFrameInterval 100
setp h264enc1 mvSADoutFlag 0
setp h264enc1 enableROI 0
setp h264enc1 metaDataGenerateConsume 0
setp h264enc1 maxBitrateCVBR 768000
setp h264enc1 maxHighCmpxIntCVBR 0
setp h264enc1 CVBRsensitivity 0
setp h264enc1 LBRmaxpicsize 0
setp h264enc1 LBRminpicsize 0
setp h264enc1 LBRskipcontrol 0
setp h264enc1 interlaceRefMode 0
setp h264enc1 LongTermRefreshInterval 0
setp h264enc1 UseLongTermFrame 0
setp h264enc1 SetLongTermFrame 0
setp h264enc1 enableGDR 0
setp h264enc1 GDRduration 5
setp h264enc1 GDRinterval 30
setp h264enc1 numOfROI 0
setp h264enc1 numFrames 300
func h264enc1 -s crew_nv12.yuv -t crew_cmp_dm365.h264
**ffmpeg encoding command
ffmpeg -s 704x576 -pix_fmt yuv420p -i CREW_704x576_30_orig_01.yuv -vcodec libx264 -b 3300k -preset slow crew_cmp_ffmpeg.h264