Hello everyone,

I am trying to modify the HEVC reference software to allow spatial variation of the quantisation parameter. For example, give a defined region of interest (ROI) a QP of 0 and the non-ROI a QP of 51. I achieved this with H.264/AVC using the FMO extension to segment frames into slices representing ROIs. I therefore decided to try something similar in HEVC.

HEVC does not currently have the functionality to arbitrarily segment frames into slices. However, you can segment the frame into slices for each LCU (64x64 pixels). This is not really desirable due to the increased signalling overhead and the limiting of prediction (slices are independent units). Even so, I thought this would be a good start.

So far I have been able to spatially vary the quantisation within I-frames by modifying the TEncSlice::compressSlice() function within TEncSlice.cpp file. Simply adding:

if (getSliceIdx()==0)
{
pcSlice->setSliceQp(0);
}

will assign a QP value of 0 to slice 0 (slices are numbered in raster order).

For some reason this does not work with B-frames; slices within B-frames simply take their QP value from the encoder.cfg file.

Can any give me some pointers to help me solve this problem or any suggestions on how you think I should go about this ROI problem in general. Any help would be much appreciated

Thank you!