Knowledge Base

What Is The Coded Width?

coded-width

A file can only have so many values about it’s width. One of them is the so-called Coded Width. Find out what this means about your file and how it differs with respect to other width values.

Coded Width is the width in pixels that the encoder actually used when it packed a video or an image, before the player trims the frame down to the size you are meant to see.

Where the value comes from

It is written by the encoder when the file is created, and it is read out of the stream itself. You will meet it in video files such as MP4, MOV, MKV, AVI and WebM, and also on still images and on cover art tucked inside an audio file, because a single picture is inspected as a video that is one frame long.

Video codecs compress a frame in square blocks rather than pixel by pixel. H.264 works in blocks of 16 by 16 pixels, and newer codecs such as HEVC use larger blocks. When the width of the picture is not a whole number of blocks, the encoder widens it with extra columns of pixels so the last block is full, and records a note telling the player to crop them away again. Coded Width is the padded width. Width is the width after cropping.

Typical values

The value is a plain pixel count, for example 1920. Most widths in common use are already multiples of 16 - 640, 1280, 1920 and 3840 among them - so for landscape video the Coded Width and the Width are normally identical, and this row looks like a duplicate.

Portrait video from a phone is where the difference shows up. A clip shot upright at 1080 by 1920 reports a Width of 1080 and a Coded Width of 1088, because 1080 needs eight extra columns to reach the next multiple of 16. Unusual sizes behave the same way: a frame 1922 pixels wide is padded out to a Coded Width of 1936. Coded Width and Coded Height together are called the coded dimensions of the stream.

Why it matters

Mostly, it explains why one report lists two different widths for the same file. That is normal and nothing is broken, so there is no need to try to make the numbers agree.

It becomes useful when something looks wrong on screen. A player or a device that ignores the crop instruction shows the padding as a narrow stripe of black or noise down one edge of the picture. If you see that, compare these two rows: a small difference is the cause. A large difference points somewhere else, usually to a file that was re-wrapped or built by hand, where the visible frame is a window onto a much larger coded picture - the sort of file that behaves oddly when you crop or re-encode it.

Padding costs a tiny amount of extra data and does not change the quality of what you watch. The value is machine-written geometry and holds no personal information at all.