Bandwidth standardization has been used extensively in the fields of wireless stan- dards design of NIC and power management. Some of the new devices are compatible with WIFI, ZigBee and GPRS based network services. These are emerging services and affects mostly content management services, and allow their subscriber base to have on-line access to dynamic content. Some of the application developers have provided applications on top of streaming networks, which are very similar to the current approach in this chapter. One other enhancement is DRM (digital rights management) which allows the user to an original copy and copy it many times into specific wireless devices. All the above work does take into consideration the
complete bandwidth QOS, which is needed to make a successful on-line streaming over low bandwidth wireless networks such as GPRS, ZigBee and Sensor networks. The current work uses a content centric trans-coding algorithmic approach, which takes care of quality parameters such as dynamic range, recompression, frames-per- second, and matching characteristics of the end device, which is very specific to the new smart phones and its build-in ability to do power management. Also the same can be scaled to a content delivery engine with multiple subscribers using a lossless model or on-demand lossy model (IETF, 2008).
4.5.1
Reversible Codes
Huffman codes are variable length pre-fix codes and can only be forward decodable. In a sensor network application a data stream is compressed to minimize the number of bits transmitted. Even though this encoding achieves power efficient codes the decoder may not be able to correct errors due to channel noise. As shown earlier, the pre-fix codes are only forward decodable, due to this if some of the bits are corrupted the serial decoder needs to retry the whole transmitted stream again, wasting more battery power. A reversible code will allow decoding in forward and backwards directions allowing to quickly synchronize during an event of an error within the next block. By the virtue of reversible decoding of the bitstream avoids further transmission retries.
Figure 4.1, shows a serial reversible Huffman encoder, where symbols S1...Sn
and their prefix codes B1...Bn are concatenated with their reversed suffix codeword
as shown in the Algorithm 4.1. The bars shown are concatenation of prefix and
suffix codes which are denoted by B1 and B
0
1, and ⊕ performs EXOR of bits of the
Figure 4.1: Reversible Stream Encoder (adapted from Girod (1999)) in both the directions, which amounts to an overhead given by an upper-bound:
L ≥ lmax= maxn l(n)
Where the decodable stream is delayed by l bits and offset by l padded zeros.
Algorithm 4.1 ReversibleVLCStream(S) 1: B= B(1)|B(2)...|B(N) 2: B0 = B0(1)B0(2)|...|B0(N) 3: C= B(1)B(2)...B(N) 0|...|0 | {z } L zeros ⊕ 0|...|0 | {z } L zeros |B0(1)B0(2)|...|B0(N) Forward Decoding 4: B(1)B(2)...B(N) 0|...|0 | {z } L zeros = C ⊕ 0|...|0 | {z } L zeros |B0(1)B0(2)|...|B0(N) Backward Decoding 5: 0|...|0 | {z } L zeros B(N)B(N − 1)...B(1) = C ⊕ B 0 (N)B0(N − 1)|...|B0(1) 0|...|0 | {z } L zeros
During an error, the decoder will synchronize by decoding the bitstream in the reverse direction until it finds a valid codeword which can be decodable with in the next block. Doing so, the decoder achieves high power efficiency by not going all the way back to start of the bitstream header everytime a few bits are corrupted. Figure 4.2 shows the process of decoding a reversible stream. Forward decoding
Figure 4.2: Reversible Stream Decoder (adapted from Girod (1999))
is achieved by Exclusive-or EXOR of the bitstream C by the reversed codewords with offset bits. Similarly, the reverse decoding is accomplished by EXOR of the bitstream C by backward decoding of the
4.5.2
Normalizing to a Standard FPS for Portable Player Applica-
tions
In the case of high quality such as real-time video a desired 29.97 fps is needed in the current implementation. We will use PCM audio samples only such that the underlying codec has a fixed algorithm and codes generated are for any processor that can handle approximately 30 fps. Design of codes (Witten et al., 1999.) has two parts: the first part is the time index and the second is the fixed part, which is the pointer to the bucket of corresponding values as shown in Figure 4.3. Using Golomb code (Gallager, 1978) to generate a range of 1-30 we can calculate the number of
bits for 2k
n
2k+ (k + 1)bits (4.15)
For PCM values we have a fixed step quantized 0-255 levels which needs 8 bits. Totaling the variable bit part and the constant part we get from equation (4.15) for
n=30,k=4
max= 8.75 + 8 = 16.75bits (4.16)
min= 1.125 + 8 = 9.175bits (4.17)
4.5.3
Lossy Compression for Constraint Portable Player Applica-
tions
Most of the codec algorithms use one of the prefix codes like the popular Huffman minimum redundancy codes. These codes perform efficiently for large amounts of binary data which is not applicable in our case. To match the current requirements the codec needs to limit the quantization step making it a fixed step quantized codec. To generate the corresponding 16-bit values for a dynamic range between 1-64 levels, we use 8-bit samples. This gives a selection from 0-256, which is used by the encoder and the decoder who shares the same settings and uses it to translate the value back to 16-bits. A comparison is shown in Figure 4.5 where the dynamic range scale for high data samples are adapted to damped data samples during mixing operation.
matching 16bit sample value=volume × 8bit samples ×256
(V OLUMELevels−1) (4.18)
As we have already addressed the matching of the input codec we need to provide a way for the decoder to lookup the corresponding 16-bit values. The input samples are limited to the range -128 0 +128 the lookup Table 4.4 needs to be an array of 255 16-bit integers.
[volume][8-bit sample+128] (4.19)
The offset bits which is the fixed part of the code allows to index from 0 to 255 into the lookup array as defined in integer array equation (4.19) for a fixed volume
Table 4.3: Golomb/Rice Codes generated by the codec output for easy indexing of frames 1-30.
Pilot Frame 2nd Frame 3nd Frame 4th Frame 5th Frame
0 01 100 101 1100 Samples 0—00X 01—00X 100—00X 101 —00X 1100 —00X 0—01X 01—01X 100—01X 101 —01X 1100 —01X 0—10X 01—10X 100—10X 101 —10X 1100 —10X 0—11X 01—11X 100—11X 101 —11X 1100 —11X .... .... .... n-1 3oth Frame .... .... .... .... 1111111111 —00X .... .... .... .... 1111111111 —01X .... .... .... .... 1111111111 —10X .... .... .... .... 1111111111 —11X
level to decode the 16 bit stereo sample. The sample and the corresponding decoded values are tabulated in Table 4.4. In this sample we use a distortion measure R(D) which is the lowest rate at which the output can be encoded while keeping distortion less than or equal to D. Re-writing equation (4.6) for lossy trans-coding we have
D=X Xd(xi, yj)P (xi)P ( yj xi) (4.20) In our case P (yi xi) = 1 512 Substituting in equation (4.20) H(X) =X 1 512log2 1 512 = 9bits/sample (4.21)
This satisfies equation (4.15) and (4.16)
By again using trans-repairing on lossy model we can optimize to the new distorted entropy, thereby increasing the trans-coding rate to be compatible with constrained bandwidths from an original 15 bits/sample to a mere 9 bit/sample. Further some of the content based media streams can use cost functions which are designed with scalar transformation using basis functions.