https://bugs.freedesktop.org/show_bug.cgi?id=91281

--- Comment #6 from Andy Furniss <adf.lists at gmail.com> ---
Maybe if enc->base.level is unreliable I shouldn't trust
enc->base.max_references either, but it seems that the h/w gets set up using it
-

radeon_vce_40_2_2.c
RVCE_CS(MAX2(enc->base.max_references, 1) - 1); // encBPicPattern
RVCE_CS(MIN2(enc->base.max_references, 2)); // encNumberOfReferenceFrames
RVCE_CS(enc->base.max_references + 1); // encMaxNumRefFrames

radeon_vce_52.c:
enc->enc_pic.pc.enc_b_pic_pattern = MAX2(enc->base.max_references, 1) - 1;
enc->enc_pic.pc.enc_number_of_reference_frames = MIN2(enc->base.max_references,
2);
enc->enc_pic.pc.enc_max_num_ref_frames = enc->base.max_references + 1;

So unless I miss something the whole function body of get_cpb_num could be
replaced with just

return MIN2(enc->base.max_references + 1, 16);

It works testing wise with level 5.2 and doesn't need the level given by the
encoder/omx state tracker to be correct. It also saves allocating buffers that
aren't really used.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160807/fbca76ea/attachment.html>

Reply via email to