Professional Documents
Culture Documents
Research Article
REAL TIME VIDEO COMPRESSION IMPLEMENTED USING
ADAPTIVE BLOCK TRANSFER / MOTION COMPENSATION
FOR LOWER BIT RATES
S.L. Lahudkar# and R.K. Prasad*
Address for Correspondence
# : Ph.D student , Bharati Vidyapeeth Deemed University, Pune
*: Guide; Head Dept. of Electronics & Telecommunication , AIT Pune
Affiliation: 1) Bharati Vidyapeeth Deemed University College of Engineering, Pune
2) JSPMs Imperial College of Engineering & Research, Pune
ABSTRACT
The aim of this paper is to achieve considerable amount of compression in real-time images by using adaptive block
transform with lower bit rates. The project aims to achieve the above mentioned objective by developing a code on a Turbo
C++ platform / MATLAB. The project discusses important features of adaptive block transform in compression of still
images, including the extent to which the quality of image is degraded by the process of discrete cosine transform
compression and decompression. Image quality is measured objectively, using peak signal-to-noise ratio or picture quality
scale, and subjectively, using perceived image quality. The effects of different functions, image contents and compression
ratios are assessed. A comparison with a discrete-cosine-transform-based compression system is given. Our results provide a
platform for reduced memory space and bandwidth requirements in on-line applications like video conferencing. Our project
also discusses the challenges faced while developing an efficient solution for bandwidth and memory problems on a Turbo
C++ platform. The still image formats used are essentially BMP (Bitmap), JPEG (Joint Photographic Experts Group)
and GIF (Graphical Inter-Face).On similar lines the real-time image formats we have worked with are MPEG(Motion
Picture Experts Group) and AVI(Audio-Visual Interface) .
KEY WORDS Compression, JPEG, Discrete Cosine Transform, Inverse Discrete Cosine Transform, Quantization, Run
Length Coding, Entropy, Adaptive Block Transfer.
1.0 INTRODUCTION: the sender's data more concisely, but nevertheless
1.1 Types of compression: There are two basic perfectly. Lossless compression is possible because
compression schemes: most real-world data has statistical redundancy. For
1.1.1: Lossless vs. lossy compression: The example, in English text, the letter 'e' is much more
advantage of lossy methods over lossless methods is common than the letter 'z', and the probability that the
that in some cases a lossy method can produce a letter 'q' will be followed by the letter 'z' is very
much smaller compressed file than any known small. Another kind of compression, called lossy data
lossless method, while still meeting the requirements compression, is possible if some loss of fidelity is
of the application. Lossy methods are most often used acceptable. For example, a person viewing a picture
for compressing sound, images or videos. The or television video scene might not notice if some of
compression ratio (that is, the size of the compressed its finest details are removed or not represented
file compared to that of the uncompressed file) of perfectly. Similarly, two clips of audio may be
lossy video codecs are nearly always far superior to perceived as the same to a listener even though one is
those of the audio and still-image equivalents. Audio missing details found in the other. [1] Lossy data
can be compressed at 10:1 with no noticeable loss of compression algorithms introduce relatively minor
quality, video can be compressed immensely with differences and represent the picture, video, or audio
little visible quality loss, eg 300:1. [5] Lossily using fewer bits. Lossless compression schemes are
compressed still images are often compressed to reversible so that the original data can be
1/10th their original size, as with audio, but the reconstructed, while lossy schemes accept some loss
quality loss is more noticeable, especially on closer of data in order to achieve higher compression.
inspection. When a user acquires a lossily- However, lossless data compression algorithms will
compressed file, (for example, to reduce download- always fail to compress some files; indeed, any
time) the retrieved file can be quite different from the compression algorithm will necessarily fail to
original at the bit level while being indistinguishable compress any data containing no discernible patterns.
to the human ear or eye for most practical purposes. Attempts to compress data that has been compressed
Many methods focus on the idiosyncrasies of the already will therefore usually result in an expansion,
human anatomy, taking into account, for example, as will attempts to compress encrypted data. In
that the human eye can see only certain frequencies practice, lossy data compression will also come to a
of light. The psycho-acoustic model describes how point where compressing again does not work,
sound can be highly compressed without degrading although an extremely lossy algorithm, which for
the perceived quality of the sound. Flaws caused by example always removes the last byte of a file, will
lossy compression that are noticeable to the human always compress a file up to the point where it is
eye or ear are known as compression artifacts.[5] empty.[2]
Lossless compression algorithms usually exploit 2.0 Theory:
statistical redundancy in such a way as to represent 2.1: What is JPEG?
[B_g,index_g]=sort(green_pow);
[B_b,index_b]=sort(blue_pow);
index_r=flipud(index_r);
index_g=flipud(index_g);
im_dct_r=zeros(size(red));
im_dct_g=zeros(size(green));
im_dct_b=zeros(size(blue));
im1=zeros(size(red,1),size(red,2),3);
for ii=1:coeff
im_dct_r(index_r(ii))=red_dct(index_r(ii));
im_dct_g(index_g(ii))=green_dct(index_g(ii));
im_dct_b(index_b(ii))=blue_dct(index_b(ii));
end
im1(:,:,1)=im_dct_r;
im1(:,:,2)=im_dct_g;
im1(:,:,3)=im_dct_b;
im1=uint8(im1);
dctavi = addframe(dctavi,im1) ; % dct avi file
end
ccnt = ccnt +1;
dctavi = close(dctavi);
% close all
% clear all
cinfo = aviinfo(cname);
ccmp = cinfo.FileSize;
cmpr = double ((ccmp / icmp) * 100);
set(msgs,'String','FILE COMPRESSED!!!');
set(cr,'String',num2str(cmpr));