bbc / vc2hqencode

Optimised VC-2 HQ Profile Encoder Library
GNU General Public License v2.0
14 stars 4 forks source link

Encode quality worse than reference encoder #10

Open NEOAdvancedTechnology opened 4 years ago

NEOAdvancedTechnology commented 4 years ago

I'm seeing worse quality from vc2hqencode than from the vc-2 reference encoder, even at --speed=slowest:

./vc2-reference/tools/convert_to_16p2 crowd_run_frame_1.yuv

./vc2-reference/src/EncodeHQ-CBR/EncodeHQ-CBR -v -x 1920 -y 1080 -f 4:2:2 -l 10 -k LeGall -d 3 -u 1 -a 2 -s 1296000 crowd_run_frame_1.yuv.16p2 ref_crowd_run_frame_1.vc2

./vc2hqdecode/testprogs/vc2decode ref_crowd_run_frame_1.vc2 ref_crowd_run_frame_1.yuv

./vc2hqencode/testprogs/vc2encode -r=4 --width=1920 --height=1080 -w=legall -d=3 --sliceheight=8 --slicewidth=16 --speed=slowest crowd_run_frame_1.yuv opt_crowd_run_frame_1.vc2

./vc2hqdecode/testprogs/vc2decode opt_crowd_run_frame_1.vc2 opt_crowd_run_frame_1.yuv

ffmpeg -f rawvideo -vcodec rawvideo -s 1920x1080 -r 59.94 -pix_fmt yuv422p10le -i ref_crowd_run_frame_1.yuv -f rawvideo -vcodec rawvideo -s 1920x1080 -r 59.94 -pix_fmt yuv422p10le -i crowd_run_frame_1.yuv -lavfi "psnr=psnr_ref.log" -f null -

ffmpeg -f rawvideo -vcodec rawvideo -s 1920x1080 -r 59.94 -pix_fmt yuv422p10le -i opt_crowd_run_frame_1.yuv -f rawvideo -vcodec rawvideo -s 1920x1080 -r 59.94 -pix_fmt yuv422p10le -i crowd_run_frame_1.yuv -lavfi "psnr=psnr_opt.log" -f null -

$ more *.log
::::::::::::::
psnr_opt.log
::::::::::::::
n:1 mse_avg:83.12 mse_y:88.70 mse_u:81.51 mse_v:73.60 psnr_avg:41.00 psnr_y:40.72 psnr_u:41.09 psnr_v:41.53 
::::::::::::::
psnr_ref.log
::::::::::::::
n:1 mse_avg:62.31 mse_y:62.94 mse_u:64.03 mse_v:59.34 psnr_avg:42.25 psnr_y:42.21 psnr_u:42.13 psnr_v:42.46 

$ wc -c *.vc2
1296053 opt_crowd_run_frame_1.vc2
1296053 ref_crowd_run_frame_1.vc2

vc2hqdecode shows both files with the same wavelet transform parameters:

Transform Parameters:
  Wavelet                          : LeGall 5,3
  Depth                            : 3 levels
  Slices                           : 120 x 135

Files in a zip: [crowd_run_frame_vc2_issue.zip](https://github.com/bbc/vc2hqencode/files/4940720/crowd_run_frame_vc2_issue.zip

NEOAdvancedTechnology commented 4 years ago

Holds up for SSIM as well:

::::::::::::::
ssim_opt.log
::::::::::::::
n:1 Y:0.988574 U:0.960797 V:0.959790 All:0.974433 (15.923274)
::::::::::::::
ssim_ref.log
::::::::::::::
n:1 Y:0.990943 U:0.968559 V:0.966937 All:0.979345 (16.849778)
NEOAdvancedTechnology commented 4 years ago

(BTW I have confirmed that the VC-2 reference decoder and vc2hqdecode will decode the same .vc2 encoded file to the same output)

NEOAdvancedTechnology commented 4 years ago

Some more detail from 1920x1080 Crowd Run from SVT clips vc-2-reference_check.pdf vc-2-reference-ssim.pdf