intel / libva-utils

Libva-utils is a collection of tests for VA-API (VIdeo Acceleration API)
https://01.org/linuxmedia
Other
195 stars 162 forks source link

Fix for pic_order_cnt_lsb to accept larger GOP #327

Closed pradkrni closed 1 year ago

pradkrni commented 1 year ago

This the proposed fix foe encoding with larger gop. example idr_period 2048.

XinfengZhang commented 1 year ago

The value of the pic_order_cnt_lsb shall be in the range of 0 to MaxPicOrderCntLsb − 1, inclusive.

MaxPicOrderCntLsb = 2^( log2_max_pic_order_cnt_lsb_minus4 + 4 ) The value of log2_max_pic_order_cnt_lsb_minus4 shall be in the range of 0 to 12, inclusive.

if you want to use input parameter , need a value range check .

pradkrni commented 1 year ago

The value of the pic_order_cnt_lsb shall be in the range of 0 to MaxPicOrderCntLsb − 1, inclusive.

MaxPicOrderCntLsb = 2^( log2_max_pic_order_cnt_lsb_minus4 + 4 ) The value of log2_max_pic_order_cnt_lsb_minus4 shall be in the range of 0 to 12, inclusive.

if you want to use input parameter , need a value range check . Understood. Yes this is requied. if(seq_param.seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4 > 12) seq_param.seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4 = 12;

Or should intra_idr_period should be limited to lie less than 32768

so that the equation Log2MaxPicOrderCntLsb = ceil(log2(intra_idr_period*2)); becomes 15 . well within the safer limits.

And the value for idr_period =32768 is very big.

simpler one would be if(seq_param.seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4 > 12) seq_param.seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4 = 12;

Let me know your thoughts.

XinfengZhang commented 1 year ago

from my perspective , both ok, even current is ok to be merged with another fix following.
but I still suggest to update the PR, because there are one building failure.

pradkrni commented 1 year ago

How to check the build failures.