Search code examples
vectorh.264motion

H264 motion vectors when height or width cannot be divided by 4


It is my understanding that h264 motion vectors represent an area of 4x4 or 16x16 pixels. What happens if an image height or width is not divisible by 4? Is this even allowed?


Solution

  • The height and width must be divisible by 16 for progressive footage.

    Rec. ITU-T H.264 (04/2017) page 21

    The width and height of the luma sample arrays are each an integer multiple of 16. In coded video sequences using 4:2:0
    chroma sampling, the width and height of chroma sample arrays are each an integer multiple of 8. In coded video sequences
    using 4:2:2 sampling, the width of the chroma sample arrays is an integer multiple of 8 and the height is an integer multiple
    of 16. The height of a luma array that is coded as two separate fields or in macroblock-adaptive frame-field coding (see
    below) is an integer multiple of 32