Log in

View Full Version : Disabling Intra Predicition in x264


Redhat_doom
5th March 2009, 03:29
Hi,

How can we disable the intra predicition (for each macroblock) in x264? Any idea? Thanks!

Dust Signs
5th March 2009, 07:25
What would be the meaning of that? If no good match for a macroblock in a P or B slice can be found it is reasonable to make it an intra makroblock and to use intra prediction.
As you asked for disabling it in "each makroblock" I'm interested in how you think the first IDR picture will be coded... even the first top left makroblock uses intra prediction, and as there are no neighbours available to predict from they are assumed to be 127 (or is it 128, i'm not 100% at the moment, but this is not the point). So, how would you predict those makroblocks?

Dust Signs

Redhat_doom
7th March 2009, 01:44
Oh, sorry, I didn't ask my question correctly.

Actually, I want to enforce x264 to use always intra-prediction mode 2 (dc) for all macroblocks
just like the first macroblock in each frame. To do so, I modified "x264_macroblock_cache_load"
in such a way that "h->mb.i_neighbour" becomes zero in all cases. I think using this idea,
we can treat each MB just like the first MB in the frame and so after doing this, x264 always uses
the dc inta-mode for each MB but unfortunately it didn't work. But do you know how to do so? Any idea?
Thanks!

LoRd_MuldeR
7th March 2009, 01:56
I wonder, why would you want to do that?

Redhat_doom
7th March 2009, 02:09
OK, let me explain what I want to do. I want to implement FMO (Flexible Macroblock Ordering) Type 1 (checkerboard pattern with only 2 slice groups) in x264. To do so, I used just 2 slices per frame and then I write all white MBs into the first slice and black MBs to the second slice. I also added the required information to the PPS.

To check the correctness of my implementation, I used JM (which supports FMO) but unfortunately my first try led to a crash. I think the problem is related to the fact that when we use a checkerboard pattern, always, all left and top neighbours are unavailable but during the encoding
process, x264 encodes MBs based on these neighbours while during the decoding process, these neighbours are not available. Please note that JM decoder can decode the first macroblock (top left MB) without any problem. As you know, this MB has not any left or top neighbour and so its intra-prediction mode is 2 (dc). Therefore, I think to implement FMO, we must use this intra-prediction mode for all MBs because, the left and the top neighbours of each MB are not available. But what do you think? Thanks!

Redhat_doom
9th March 2009, 01:55
Let me refine my question more. How can we mark an arbitrary macroblock as unavailable (in x264) in such a way that no function can use it?