Knowledge Base

What Is The Coded Height?

coded-height

What is the Coded Height of a file? This meta information can be found in many different files; image and video, document and e-book, and even audio. Find out what it says about your file.

Coded Height is the height in pixels that the encoder actually worked with when it packed a video or an image. It is usually the same as the visible height, and sometimes a few pixels larger.

Where the value comes from

It is reported for video streams in files such as MP4, MOV, MKV, AVI and WebM, and also for single images and for cover art embedded in an audio file, because the same tool treats a still picture as a one-frame video. The value is written by the encoder that made the file. Nobody types it in.

The reason it exists is the way video compression works. An encoder does not treat the picture pixel by pixel; it cuts the frame into square blocks and works on one block at a time. H.264, the most common video codec, uses blocks of 16 by 16 pixels. If the height of the picture is not a whole number of blocks, the encoder pads the bottom with extra rows so the last row of blocks is complete, and stores a note telling players to hide them again. Coded Height counts the padded picture. The plain Height row counts what you are meant to see.

Typical values

The value is a whole number of pixels with no unit written after it, for example 1088.

Full HD video is the case everyone runs into. A normal 1920 by 1080 clip reports a Height of 1080 and a Coded Height of 1088, because 1080 is not divisible by 16 and eight hidden rows are added to make up the difference. Most other common sizes divide evenly - 720, 480 and 2160 are all multiples of 16 - so for those the two rows show the same number and the padding never comes up. Together with the Coded Width, this value makes up the coded dimensions of the stream, the pair to compare against plain Width and Height.

Why it matters

First, so you do not go looking for a fault that is not there. A Coded Height a few pixels above the Height is completely normal, it is not a sign of a damaged file, and there is nothing to fix. The handful of hidden rows adds a negligible amount of data and has no effect on picture quality.

Where it does help is odd playback. Some simple players and older fixed-function devices ignore the instruction to hide the padding, and then those extra rows appear as a thin band of black or scrambled pixels along the bottom edge. If you can see such a band, the gap between these two rows is the explanation. A large gap, rather than a few pixels, usually means the file was re-wrapped or assembled by hand and the visible frame is a small window onto a much bigger coded picture, which is worth knowing before you edit it.

The value describes the encoder's arithmetic and nothing else, so it says nothing about a person, a place or a device.