transform coding ii

Upload: rakesh-inani

Post on 01-Jun-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Transform Coding II

    1/19

    TRANSFORM CODING II

  • 8/9/2019 Transform Coding II

    2/19

    Introduction The coding techniques which operate directly on the

     pixels of an image are the spatial domain methods.

    The coding is known as waveform coding. The coding techniques which are based on modifying

    the transform of an image is known as transform

    coding.

    In transform coding a reversible linear transform is

    used to map the image into a set of transform

    coefficients which are then quantized and coded.

  • 8/9/2019 Transform Coding II

    3/19

    A Transform coding System

  • 8/9/2019 Transform Coding II

    4/19

    Important Steps in Transform Coding Transform selection

    The transform which packs most of the information inthe smallest number of transform coefficients is

    selected to achieve the best compression. Sub section selection

    The sub section size which will reduce thereconstruction error and the computational complexity

    is selected. For image data sub image size of ! or "# is common.

    $arger sub image sizes increases the blocking artifacts. For speech data a block of "% to &%msec is selected for

     processing

  • 8/9/2019 Transform Coding II

    5/19

    Important Steps in Transform Coding 'it allocation(

    The reconstruction error depends on the number and

    relative importance of the transform coefficients that arediscarded and the precision used to represent the

    retained coefficients.

    The overall process of truncating quantizing and codingthe coefficients of the transformed sub image is called

     bit allocation.

  • 8/9/2019 Transform Coding II

    6/19

    Quantization and Coding of

    Transform coefficients

    If the amount of information conveyed by each

    coefficient is different it makes sense to assign

    differing numbers of bits to the different coefficients. There are two approaches to assign bits

    )ne approach relies on the average properties of the

    transform coefficients while the other approach assigns

     bits as needed by individual transform coefficients

  • 8/9/2019 Transform Coding II

    7/19

    Quantization and Coding of

    Transform coefficients In the first approach we first obtain an

    estimate of the variances of the transform

    coefficients )n the basis of maximum variance * +onal coding

    )n the basis of maximum magnitude * Threshold coding

    These estimates can be used by one of twoalgorithms to assign the number of bits used

    to quantize each of the coefficients

  • 8/9/2019 Transform Coding II

    8/19

    ona! Coding ,e assume that the relative variance of the coefficients

    corresponds to the amount of information contained in each

    coefficient.

    Thus coefficients with higher variance are assigned more bitsthan coefficients with smaller variance.

    $et us find an expression for the distortion then find the bitallocation that minimizes the distortion.

    To perform the minimization we will use the method of

    $agrange.

  • 8/9/2019 Transform Coding II

    9/19

    ona! Coding To find the number of bits to be allotted(

    If the average number of bits per sample to be used

     by the transform coding system is R, and the averagenumber of bits per sample used by the k th coefficientis Rk then

    - * o( of transform coefficients.

      /"0

  • 8/9/2019 Transform Coding II

    10/19

    ona! Coding The reconstruction error variance for the kth quantizer

    1rk &  is related to the kth quantizer input variance 12k & 

     by

    3k   4 factor that depends on the input distribution and the

    quantizer.

    The total reconstruction error is given by

  • 8/9/2019 Transform Coding II

    11/19

    ona! Coding So we need to find 5 k   to minimize the error at

    the same time keeping the average number of

     bits to 5. 6ssuming that 3k  is a constant 3 for all

    k we can set up the minimization problem in

    terms of $agrange multiplier as

  • 8/9/2019 Transform Coding II

    12/19

    ona! Coding Taking the derivative of 7 with respect to 5 k  and

    setting it equal to zero we can obtain the

    expression for 5 k  as

    Substituting for 5 k   in equation /"0 we get the

    value of 8 as

  • 8/9/2019 Transform Coding II

    13/19

    ona! Coding  ow substituting this expression for 8 in the equation

    for 5 k  we obtain

    The values obtained for 5 k   will not be positiveintegers. So the standard approach is to set thenegative 5 k s to zero. This will increase the average bitrate above 5. Therefore the non zero 5 k s are

    uniformly reduced until the average rate is equal to 5.

  • 8/9/2019 Transform Coding II

    14/19

    T"res"o!d Coding The underlying principle is that for any sub image the

    transform coefficients of largest magnitude make the

    most significant contribution to reconstructed sub imagequality.

    6fter applying the threshold masks the resulting nxn

    array is reordered in a zigzag fashion and is run length

    encoded. 6nd variable length coding is done to the

    resulting sequence.

  • 8/9/2019 Transform Coding II

    15/19

    T"res"o!d Coding

    There are three ways to threshold the

    transformed image 6 single global thresholding can be applied to all

    sub images.

    6 different threshold can be applied for each sub

    image. The threshold can be varied as a function of

    location of each coefficient within the sub image.

  • 8/9/2019 Transform Coding II

    16/19

    T"res"o!d Coding 9sually the third method is used where the

    thresholding and quantization is implemented using a

    single equation

    .0/

    0./0/:

    0/

    0/0/:

    arrayionnormalizat transformtheof element vu Z 

    vuT of ionapproximat quantized and d thresholdevuT where

    vu Z 

    vuT round vuT 

    =

  • 8/9/2019 Transform Coding II

    17/19

    T"res"o!d Coding

  • 8/9/2019 Transform Coding II

    18/19

  • 8/9/2019 Transform Coding II

    19/19