How to change macroblock's size in H.264?

836 Views Asked by At

I am using ffmpeg api to implement this paper(Passthrough+: Real-time Stereoscopic View Synthesis for Mobile Mixed Reality). In this paper, they use 8x8 macroblock to calculate motion vectors. However, most of macroblocks are encoded in 16x16 pixels by ffmpeg. How to force macroblock size to be 8x8 using ffmpeg api(or can be done by modifying libavcodec/libx264.c)?

1

There are 1 best solutions below

0
Gyan On

You can't.

The H.264 specification ISO 14496-10 defines macroblock as

A 16x16 block of luma samples and two corresponding blocks of chroma samples of a picture that has three sample arrays, or a 16x16 block of samples of a monochrome picture or a picture that is coded using three separate colour planes.

Of course, these can be further segmented for 'inter prediction' but the macroblock size is fixed by definition.