how to adaptively set Qp with "quant_offsets" ?
Hi, Thanks your great work. I recently try to use this open-source API to learn video encoding. But I am confused when I try to set Qp, I need your helps.
The idea is to modify the Qp value of specific region of the video, for example: the Qp of whole image is set to 30 while the Qp of the center rectangle region is set to 15.
So, how should I do with this x.264 library ?
Following is my key code to do that, but it does not work:
x264_param_t* pParam = (x264_param_t*)malloc(sizeof(x264_param_t));
pParam->rc.i_rc_method = X264_RC_CQP;
pParam->rc.i_qp_constant = 30;
pParam->rc.i_aq_mode = X264_AQ_AUTOVARIANCE;
pParam->rc.f_aq_strength = 2;
pParam->rc.b_mb_tree = 0;
//this is my function to modify Qp with quant_offsets
setQPinRect(pPic_out->prop.quant_offsets, Size(qp_width, qp_height), Rect(500, 300, 400, 400), -15);
I guess the quant_offsets may help me to achieve that goal, but I don not know how to do it, can you provide some demo code for the quant_offsets ?