Log in

View Full Version : lossless encoding of particular intra-MBs


thesnowman
30th January 2013, 10:51
Hello, all

Is there any way to encode intra macro block, so that after it will be decoded, one will receive exactly same values as source video?
I modified x264 code, so that it would use qp=0 for blocks of interest and also was playing with scaling lists, but did not succeed.

Is there any way to acheive this? Maybe modify coefficients in some way after DCT, so after IDCT->Dequant we will get same values as source? Will appreciate any insight.

It is ok if I need to preprocess source data of MB in a known way (say make all values even). I do not need to get exactly same data as input video. The idea is to get exactly same values of reconstructed MB as were used to encode it.

To be more clear.

MB src_data -> preprocessed_data(arbitrary, but well defined preprocess (only if needed)) -> MB encode (dct, quant) -> MB decode (idct, dequant) -> rec_data.

So, what I want - is to be sure that rec_data==preprocessed_data

Thanks.

P.S. I could use IPCM blocks, but this has to heavy impact of the ecnoded H264 stream size.

Dark Shikari
30th January 2013, 11:02
qp 0 isn't lossless unless qpprime_y_zero_transform_bypass is set. Mixed lossy/lossless is possible, but x264 needs some slight modification to make it work.

Are you really sure that lossless is going to be that much smaller than PCM, especially for intra blocks?

thesnowman
30th January 2013, 11:22
thanks for help, i'll see what I can do with qpprime_y_zero_transform_bypass.

About PCM: I assume so, because (even if losslessly encoded) I-MBs are still compressed unlike PCMs.

I did some test encoding (using only I-frames) comparing QP=0 vs. PCM (of course qp0 != lossless, but this is what I could do for tests) and based on the results for my case I still want to try to decrease the output size.

Thanks