Presentation is loading. Please wait.

Presentation is loading. Please wait.

GODIAN MABINDAH RUTHERFORD UNUSI RICHARD MWANGI.  Differential coding operates by making numbers small. This is a major goal in compression technology:

Similar presentations


Presentation on theme: "GODIAN MABINDAH RUTHERFORD UNUSI RICHARD MWANGI.  Differential coding operates by making numbers small. This is a major goal in compression technology:"— Presentation transcript:

1 GODIAN MABINDAH RUTHERFORD UNUSI RICHARD MWANGI

2  Differential coding operates by making numbers small. This is a major goal in compression technology: Making numbers small.  Smaller numbers require less information to code than larger numbers.  it would be more accurate to claim that similar numbers require less information to code.

3  However, sticking to that approach requires the video codec to figure out information about what the set of similar numbers is.  Instead, it is more efficient to build a video codec around the assumption that the set of similar numbers will consist of small numbers.  Suppose you are working with a string of bytes. Bytes range from 0..255. Here is a string:

4  150 152 149 150 151 156 153 151 152  On the scale of 0..255, those are reasonably large. However, they are quite similar to each other.  Instead of coding each number separately, code the differences.  The sequence has to start somewhere, so the first number is coded as-is, and the subsequent numbers are coded as differences from the previous number:

5  150 +2 -3 +1 +1 +5 -3 -2 +1  When decoding this string of numbers, start with the first number and start adding the deltas to get the remaining numbers: 150 150 + 2 = 152 152 + -3 = 149 149 + 1 = 150 150 + 1 = 151 151 + 5 = 156 156 + -3 = 153 153 + -2 = 151 151 + 1 = 152

6  Differential pulse code modulation (DPCM) is a procedure of converting an analog into a digital signal in which an analog signal is sampled and then the difference between the actual sample value and its predicted value (predicted value is based on previous sample or samples) is quantized and then encoded forming a digital value.  DPCM code words represent differences between samples unlike PCM where code words represented a sample value.

7  DPCM conducted on signals with correlation between successive samples leads to good compression ratios.  Images and video signals are examples of signal correlation.  In images this means that there is a correlation between the neighboring pixels, in video signals correlation is between the same pixels in consecutive frames and inside frames (which is same as correlation inside image).

8  It is important to point out that in forming a prediction receiver i.e. decoder has access only to reconstructed pixel values, since the process of quantization of differential image introduces error, reconstructed values, as expected diverges from the original values.  Identical predictions of both receiver and transmitter are assured by transmitter configuration in which transmitter bases its prediction on the same values as receiver i.e predicted values.  The facts that were mentioned in this paragraph are applicable to signals in general not just image and video signals.

9  Formally written, DPCM compression method can be conducted for intra-frame coding and inter- frame coding.  Intra-frame coding exploits spatial redundancy and inter-frame coding exploits temporal redundancy.  In the intra-frame coding the difference is formed between the neighboring pixels of the same frame, while in the inter-frame coding it is formed between the values of the same value in two consecutive frames.  In both coding intra- and inter- frame the value of target pixel is predicted using the previously- coded neighboring pixels.

10  The disadvantage of PCM is it requires large bandwidth to transmit because of coding each sample. To overcome this problem, Delta modulation is used.

11  Delta modulation transmits only one bit per sample.  That is the present sample value is compared with the previous sample value and the indication, whether the amplitude is increased or decreased is sent. The input signal is approximated to step signal by the delta modulator.  This step size is fixed. The difference between the input signal x(t) and the staircase approximated signal confined to two levels, i.e. +δ, -δ.  If the difference is positive then the approximated signal is increased by +δ, if the difference is decreased then the approximated signal is decreased by -δ. A zero is transmitted for –δ and a one is transmitted for +δ.

12

13  The figure shows the modulator diagram.  The summer in the accumulator adds quantizer output (±δ) with the previous sample approximation.  The previous sample approximation u[(n- 1)T s ] is restored by delaying one sample period T s.  The sampled input signal x(nT s ) and staircase approximated signal is subtracted to get the error signal e(nT s ).

14  Depending on the sign of e(nT s ) one bit quantizer produces an output step of + δ or – δ. If the step size is +δ, then binary '1' is transmitted. If the step size is -δ, then binary '0' is transmitted.

15  At the receiver, an accumulator and a low pass filter are used.  The accumulator generates the staircase approximated signal output and is delayed by one sampling period T s.  It is then added up to the input signal. If the input is '1', then +δ is added to the previous output(which is delayed).  If the input is binary '0'. Then one step is subtracted from the delayed signal.

16

17  Adaptive Differential Pulse Code Modulation (ADPCM) is a lossy compression format that is implemented for XAudio2 to provide additional features for specifying the size of the compression sample block. With a lossy compression format some data is altered and lost during compression. ADPCM can achieve compression ratios of up to 4:1.  The implementation of ADPCM for XAudio2 provides additional features to specify the size of the compression sample block. ADPCM enables the audio designer to choose a setting that is an appropriate compromise among size, quality, and resolution (for placing loop points).

18  XAudio2 uses a modified version of the Microsoft ADPCM codec that supports the extended data formatting required to provide custom sample block sizes. For this reason, XAudio2 audio data cannot be played by audio engines that do not support this version of the ADPCM codec.  Note Currently, ADPCM compression is only available for Windows, including XNA Game Studio Express for Windows deployments.

19  Audio data is encoded to ADPCM using the AdpcmEncode command-line tool.  AdpcmEncode  In order to encode audio files as ADPCM for use with XAudio2, use the AdpcmEncode command-line tool.

20  Software decoding of ADPCM is supported in XAudio2.  XAudio2  In order to use ADPCM encoded data in XAudio2, you need to initialize a ADPCMWAVEFORMAT structure with ADPCM specific values, and pass it as an argument to IXAudio2::CreateSourceVoice when you create a source voice. For an example of loading and playing a sound in XAudio2.IXAudio2::CreateSourceVoice

21  ADPCM compression works by separating the waveform into blocks, and predicting the variation of the waveform samples within each block. The size of the blocks is measured in samples. The smallest block size is 32 samples, and the highest is 512 samples.  Larger blocks allow better compression, which results in smaller file sizes, but at the expense of sound quality and resolution for aligning loop points.  In general, modifying the SamplesPerBlock value results in these tradeoffs:

22

23  Because ADPCM uses sample blocks that are aligned one after the other, a wave compressed with ADPCM may have an unfinished, partial block at its end. The ADPCM decoder generates silence for the remainder of this partial block, which keeps the wave from looping seamlessly.  The value of the SamplesPerBlock parameter affects the resolution with which you can align wave data and loop points.

24  If you try to apply compression to a non- aligned wave, you will get an error or a warning depending on whether the wave is used in any looping play events. You cannot compress a wave used in any looping play events. Remove it from the looping play events, and re-apply compression.  If you use the wave exclusively in non- looping mode, the sample block alignment restriction does not apply.

25

26  The delta modulation has the following advantages over PCM:  Delta modulation transmits only one bit.  The transmitter and receiver is very simple to implement.

27  The following are the disadvantages of delta modulation:  Granular Noise.  Over-slope noise distortion.


Download ppt "GODIAN MABINDAH RUTHERFORD UNUSI RICHARD MWANGI.  Differential coding operates by making numbers small. This is a major goal in compression technology:"

Similar presentations


Ads by Google