Image aspect ratio && pixel aspect ratio

Perface

This topic describes two related concepts, picture aspect ratio and pixel aspect ratio . It then describes how to use media types in Microsoft Media Foundation to express these concepts.

Picture aspect ratio [Picture Aspect Ratio]

Picture aspect ratio defines the shape of the displayed video image. Image aspect ratio is represented by X:Y, where X:Y is the ratio of image width to image height. Most video standards use a picture aspect ratio of 4:3 or 16:9. The 16:9 aspect ratio is often referred to as widescreen . Movies usually use an aspect ratio of 1.85:1 or 1.66:1. Picture aspect ratio is also called Display Aspect Ratio (DAR) .


Sometimes the video image does not have the same shape as the display area. For example, 4:3 video can be played on a widescreen (16×9) TV. In computer video, the video may be displayed within a window of arbitrary size . In this case, there are three ways to fit the image into the display area :

  • Stretch the image along one axis to fit the display area.
  • Scales the image to fit the display area while maintaining the aspect ratio of the original picture.
  • Crop the image.

Stretching an image to fit the display area is almost always a mistake because it does not maintain the correct picture aspect ratio.

Letterboxing

Letterboxing is a method for adjusting the aspect ratio of a video or image.

The term letterboxing is often used to describe the display of video content in a standard format (such as 1.33:1) on a widescreen TV to maintain the integrity of the picture while leaving white space above and below it.

That is to say, if standard format video content is displayed on a widescreen TV, vertical black borders will appear on the upper and lower sides of the screen, forming a "letterbox" shape. This is called letterboxing.

Pan and scan

Pan and scan is a technique that crops a widescreen image into a 4×3 rectangular area for display on 4:3 display devices.

The resulting image fills the entire display without requiring the black letterbox area, but part of the original image is cropped out of the picture.

As the area of ​​interest moves, the cropped area can move from one frame to another. The term "pan" in pan and scan refers to the panning effect produced by moving the pan and scan area.

Pixel aspect ratio [Pixel Aspect Ratio]

Pixel aspect ratio (par) measures the shape of a pixel.
When a digital image is captured, the image is sampled vertically and horizontally, producing a rectangular array of quantized samples, called pixels or pels.

The shape of the sampling grid determines the shape of the pixels in the digitized image.

Here's an example of using small numbers to keep math simple.

Assume that the original image is square (that is, the image aspect ratio is 1:1); assume that the sampling grid contains 12 elements, arranged in a 4×3 grid.

The shape will be wider per resulting pixel.

Specifically, the shape of each pixel will be 3×4. Non-square pixels are called non-square pixels.

Pixel aspect ratio also applies to display devices . The display device's physical shape and physical pixel resolution (horizontal and vertical) determine the display device's standard pixel ratio.

Computer monitors typically use square pixels. If the image standard pixel ratio and the display standard pixel ratio do not match, the image must be scaled in one dimension, either vertically or horizontally, in order to display correctly.

The following formulas involve standard pixel ratio, display aspect ratio (DAR), and image size in pixels:

DAR = (image width in pixels / image height in pixels) × PAR

Note that the image width and image height in this formula refer to the image in memory , not the displayed image.

Here's a real-world example:

NTSC-M analog video contains 480 scan lines in the active image area .
ITU-R Rec.BT.601 specifies a horizontal sampling rate of 704 visible pixels per line , producing a digital image of 704 x 480 pixels.

The expected aspect ratio is 4:3 , resulting in a standard pixel ratio of 10:11.

  • BUT: 4:3
  • Width in pixels: 704
  • Height in pixels: 480
  • PAR: 10/11

4/3 = (704/480) x (10/11)

To display this image correctly on a display device with square pixels, the width must be scaled by 10/11 or the height by 11/10.

Guess you like

Origin blog.csdn.net/weixin_45264425/article/details/132797261