
libde265
libde265 is a freely available software package that converts heavily compressed video data in the HEVC format back into visible images. It is used, among other things, in image viewers, browsers, and video players that display HEIF photos or H.265 videos.
Videos and photos are heavily compressed before being saved so that they take up less space. This compression follows fixed rules known as a video format. One widely used such format is called HEVC, often also referred to as H.265. To view such a packed file as an image on screen again, a device needs a program that applies the rules in reverse. libde265 is exactly such a program: a freely available building block that developers may incorporate into their own software free of charge. It unpacks, but it does not pack — it cannot create new videos.
Why an open HEVC building block was needed
HEVC is not a freely invented format, but an international standard from 2013. It halves the file size compared to the older H.264 format at roughly the same image quality. This was a major advance for streaming and for 4K television. Accordingly, HEVC spread quickly in cameras, televisions, and smartphones.
For developers of smaller programs, however, this was a problem. Ready-made HEVC software was available mainly from large companies, often expensive and not open to inspection. libde265 was created in 2013 by German developer Dirk Farin as an open-source alternative. Open source means: the entire program text is publicly readable and may be modified and redistributed. Anyone who wants to know exactly what the software does can read it for themselves.
One detail is often confused here. Open program text does not automatically mean that the format itself is free of patent claims. For HEVC, several patent administrators demand licensing fees, and this issue does not concern libde265. This is precisely why some providers now prefer to rely on the freer AV1 format instead.
From data stream to finished individual image
An HEVC file does not contain finished images. It contains instructions for how an image results from the previous one. Only a few images, the so-called key frames, are stored in full. All others describe only differences: this image block has shifted twelve pixels to the right compared to before.
libde265 processes these instructions step by step. First, it reads the header data and learns the resolution and frame rate. Then it unpacks the actual sequences of numbers, calculates the image blocks back, and assembles them. Finally, a filter smooths the edges between the blocks so that no visible squares appear. The result is a series of finished individual images that the calling program can display.
For this to run smoothly, libde265 distributes the work across multiple processor cores simultaneously. One core processes one image strip, another the next. In addition, the library uses special fast computing instructions found in modern processors. On a normal laptop, this is enough for high-resolution video in real time.
Where the library runs in the background
libde265 is almost never directly visible. As a library, it is a component within other programs, comparable to an engine that various car manufacturers install. It is best known for its use in libheif, a piece of software for HEIF images. HEIF is the photo format in which iPhones save their pictures by default.
This is why the name turns up when a Linux system or an image editing program suddenly becomes able to open HEIC photos. File managers, image previews, and some browsers also rely on it via such chains. In addition, there are servers that automatically convert uploaded photos into other formats.
In the news, libde265 usually appears for a less pleasant reason: security vulnerabilities. Decoding software processes data from external sources and is therefore a popular target for attacks. In the worst case, a manipulated image file can execute foreign program code. Several such vulnerabilities have been reported and fixed for libde265. This is not a sign of poor quality, but normal everyday life for software that opens files from others millions of times over.