Video Compression: Intraframe and Interframe Techniques, Lecture notes of Programming Paradigms

The concept of video compression, focusing on intraframe and interframe techniques. Intraframe compression occurs within individual frames, designed to minimize spatial redundancy. Interframe compression, on the other hand, occurs between frames, designed to minimize temporal redundancy. The document also discusses predictive coding and motion compensation for video compression.

Typology: Lecture notes

2020/2021

Uploaded on 06/17/2021

mame-magnaw
mame-magnaw 🇪🇹

4 documents

1 / 45

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Need for video compression
2
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d

Partial preview of the text

Download Video Compression: Intraframe and Interframe Techniques and more Lecture notes Programming Paradigms in PDF only on Docsity!

Need for video compression

2

A video consists of a time-ordered sequence of frames,

i.e.,images.

  • An obvious solution to compress video by applying an image

compression algorithm to each frame , for instance

compressing each image frame as a JPEG image is called M-

JPEG(Motion jpeg)

Compressing in just each frame does not yield a

high enough compression ratio that is required for

general video needs.

It Utilizes two basic compression techniques:

Intraframe compression

  • Occurs within individual frames
  • Designed to minimize the duplication of data in each picture

(Spatial Redundancy)

Interframe compression

  • Compression between frames
  • Designed to minimize data redundancy in successive

pictures (Temporal redundancy)

5

  • Temporal redundancy arises when successive

frames of video display images of the same scene.

  • It is common for the content of the scene to

remain fixed or to change only slightly between

successive frames.

  • Spatial redundancy occurs because parts of the

picture are often replicated (with minor changes)

within a single frame of video.

Temporal redundancy is exploited so that not every

frame of the video needs to be coded independently as a

new image.

It makes more sense to code only the changed information

from frame to frame rather than coding the whole frame.

An obvious solution to video compression would be

predictive coding based on previous frames.

Compression proceeds by subtracting images: subtract in

time order and code the residual error.

It can be done even better by searching for just the right

parts of the image to subtract from the previous frame.

It can be done even better by

searching for just the right parts of the

image to subtract from the previous

frame.

  • Practically, the coherency from frame to

frame is better exploited by observing that

groups of contiguous pixels, rather than

individual pixels, move together with the

same motion vector.

  • Therefore, it makes more sense to

predict frame n+1 in the form of regions

or blocks rather than individual pixels.

10

Fundamentals of Multimedia, Chapter

10

  • The pixel Cn(x, y) shown in the frame n has moved to a new location

in frame n+1. Consequently, C

n+

(x, y) in frame n+1 is not the same

as Cn(x, y) but is offset by the motion vector (dx,dy).

  • the small error difference e(x,y) = C

n+

(x, y) - Cn(x+dx, y+dy)

1

1

It exploits the fact that, often, for many frames of a

movie, the only difference between one frame and

another is the result of either the camera moving or an

object in the frame moving.

In reference to a video file, this means much of the

information that represents one frame will be the same as

the information used in the next frame.

Using motion compensation, a video stream will contain

some full (reference) frames; then the only information

stored for the frames in between would be the

information needed to transform the previous frame into

the next frame.

Chroma sampling:

Chroma subsampling is a method that stores colour

information at lower resolution than intensity information.

Chroma subsampling is meaningful because human visual

system is less sensitive to variations in colour than

brightness.

Chroma subsampling can reduce the bandwidth for colour

detail in almost no perceivable visual difference.

To begin with, numbers are given stating how many pixel

values, per four original pixels, are actually sent. Thus the

chroma subsampling scheme "4:4:4" indicates that no

chroma subsampling is used.

Each pixel's Y, Cb, and Cr values are transmitted, four for

each of Y, C b, and Cr.

For the following array of colour values, give chroma

subsampling results with4:2:2, 4:1:1 and 4:2:0 schemes.

Chroma subsampling result for 4:2:2 scheme:

Chroma subsampling result for 4:1:1 scheme:

Chroma subsampling result for 4:2:0 scheme:

The difference between two macroblocks can then be

measured

by their Mean Absolute Difference (MAD) :

N – size of the macro block,

k and l – indices for pixels in the macro block,

i and j – horizontal and vertical displacements,

C ( x + k, y + l ) – pixels in macro block in Target frame,

R ( x + i + k, y + j + l ) – pixels in macro block in Reference

frame.

- The goal of the search is to find a vector ( i, j ) as the

motion vector MV = (u , v), such that MAD ( i, j ) is

minimum:

  • Smaller macroblocks increase the number of blocks in the

target frame

 a larger number of motion vectors to predict the target frame.

 This requires more bits to compress motion vectors,

 but smaller macroblocks tend to decrease the prediction error.

  • Larger macroblocks

 fewer motion vectors to compress,

 but also tend to increase the prediction error. This is because

larger areas could possibly cover more than one moving region

within a large macro block.

18

Assume 2 * 2 macro block is used. For the following macro block

the corresponding intensities in the reference frame are given as

follows:

Calculate the motion vector, with complete search within 1 pixel

search window.

Answer:

Basic Ideas is to search for Macroblock (MB) Within a ± 2 pixel

window and workout Sum of Absolute Difference (SAD) (or

Mean Absolute Error (MAE) for each window – but this is

computationally more expensive) is a minimum.