GNOME Bugzilla – Bug 753229
encoder: HEVC: Fix pic_width/height calculation
Last modified: 2018-04-16 15:11:04 UTC
As per HEVC spec, pic_width_in_luma_samples and pic_height_in_luma_samples should be multiple of MinCbSizeY. Right now we are using 32 bit rounding, better to change the default case to 16 bit rounding otherwise it will slightly impact the bitrate because of extra pixels. eg: 720p video is encoding as pic_height=736 (even though we are setting the crop-rectangle, this is unnecessary). Note: When I was testing it last time, 16 bit rounding caused issues in mulit-slice encoding. But IMHO it should not be that difficult to fix :)
Created attachment 361649 [details] [review] libs: encoder: h265: 16 bit rounding of picture width and height pic_width_in_luma_samples/pic_height_in_luma_samples can be 16-bit rounded instead of 32-bit. In addition, codedbuf_size could be calculated according to this change.
Review of attachment 361649 [details] [review]: @sree, what do you think about this patch? @hyunjun, do you remember if this patch fixed any visible issue or just for correctness?
(In reply to Víctor Manuel Jáquez Leal from comment #2) > Review of attachment 361649 [details] [review] [review]: > > @sree, what do you think about this patch? patch is fine. but please make sure there is no issue with multi-slice encode. IIRC there were some driver bugs, hopefully, fixed by now. > @hyunjun, do you remember if this patch fixed any visible issue or just for > correctness? This is for correctness and will also slightly improve bitrate (explained in the bug description)
Attachment 361649 [details] pushed as e19570a - libs: encoder: h265: 16 bit rounding of picture width and height