ultravideo / kvazaar

An open-source HEVC encoder
BSD 3-Clause "New" or "Revised" License
821 stars 178 forks source link

Problem about QP settings in the ROI file #408

Open glitch517 opened 1 month ago

glitch517 commented 1 month ago

I set a ROI area of 5 * 5, with qp values ranging from 15 to 39, and this is the ROI file. roi.txt The error message after running is as follows: Screenshot from 2024-07-15 14-33-25 I checked the code and found that KVZ_QP_DELTA_MIN and KVZ_QP_DELTA_MAX were set to -26 and 25. So I tried to change the base QP from 0 to -26, however the error message then reminds that the base QP range is 0-51.May I ask how I can make the QP of the roi region freely defined between 0-51? Thank you!

Jovasa commented 1 month ago

The roi.txt defines the delta QP regarding to the the base QP, and this delta can be at most [-26, 25]. If you want to have QPs between 15 and 39, you could set the base QP to 15 and then substract 15 from all of the values in your roi.txt.

You should also note that the base QP of the frame varies based on the GOP used. If you want that all of the frames have the same base QP you should set --gop 0, thought this will have a negative impact on the coding efficiency.

glitch517 commented 1 month ago

The roi.txt defines the delta QP regarding to the the base QP, and this delta can be at most [-26, 25]. If you want to have QPs between 15 and 39, you could set the base QP to 15 and then substract 15 from all of the values in your roi.txt.

You should also note that the base QP of the frame varies based on the GOP used. If you want that all of the frames have the same base QP you should set --gop 0, thought this will have a negative impact on the coding efficiency.

Okay, I got it. Thank you very much!