PREDICTING ENERGY CONSUMPTION OF MPEG VIDEO ...

9 downloads 0 Views 59KB Size Report
One of the principal concerns of wireless computing is the limited battery life of mobile devices. To address the concern, application- aware adaptation has ...
PREDICTING ENERGY CONSUMPTION OF MPEG VIDEO PLAYBACK ON HANDHELDS Srijan Chakraborty and David K. Y. Yau Department of Computer Sciences, Purdue University, West Lafayette, IN 47907 ABSTRACT One of the principal concerns of wireless computing is the limited battery life of mobile devices. To address the concern, applicationaware adaptation has emerged as one of the effective strategies for controlling energy usage. But for adaptation to be effective, we must be able to predict the energy requirement of running applications, in an application-specific manner. This paper reports a set of experiments performed to understand the energy usage pattern of handheld devices while decoding and displaying MPEG compressed video in software. Experiments are designed to bring forth parameters that can be used to predict the energy requirement for MPEG playback. Based on our experimental results, we find that it is possible to construct simple polynomial models of energy usage with good least square fit (R value of 0.92 and higher). These models can be used to predict application energy requirement under various combinations of controllable video parameters.

1. INTRODUCTION Wireless computing has become a vast area of research with the proliferation of wireless networks and small portable devices. One of the principal challenges of mobile computing is the need to reduce the energy consumption of these devices, thereby increasing the lifetime of the batteries that power them. With advances in battery technology and low-power circuit design, the battery life of an average mobile device has increased significantly. But this alone cannot solve the energy problem. Various other strategies are being investigated – involving both lower and higher levels of the system. Runtime adaptation of communication parameters during active data transfer can save overall energy consumption in mobile devices [2]. It is argued that adaptation performed by a collaborative partnership between the operating system and the individual applications works best [3, 4, 5]. This brings us to the problem of predicting the energy requirement of an application for various combinations of adaptation parameters. Our aim is to discover the parameters that can be dynamically controlled and, based on those parameters, construct simple polynomial models for predicting the energy requirement for MPEG playback. We concentrate on handheld devices (the Compaq iPAQ H3650), and carry out experiments on these devices to profile their energy usage pattern for playback of different MPEG video sequences. Our initial experimental results are highly promising and show that the energy requirement can be modeled with an R value of 0.92 or higher. Research was supported in part by the Indiana 21st Century Resarch and Technology Fund; D. Yau was additionally supported in part by the National Science Foundation under grant numbers EIA-9806741 and CCR9875742 (CAREER). Contact author: D. Yau ([email protected]).

1.1. Organization of the paper The balance of the paper is organized as follows. In section 2, we briefly survey existing work. Section 3 presents our experimental setup. In Section 4, we report our experimental results and their analysis. Using the results, Section 5 develops predictive models for energy consumption on the iPAQ. Section 6 concludes. 2. RELATED WORK Much work has been done recently on increasing the energy efficiency of handheld devices. In [5], a framework is presented for dynamic adaptation of application-specific parameters to reduce the energy consumption of mobile devices. This requires predicting the future energy usage for an application. In [5], the prediction of future energy demand is based on measurements of past usage. A predictive model for MPEG execution time is presented in [6]. Their goal is to enable QoS-aware scheduling of computation resources for predictable performance, and they exploit MPEG video information such as frame type in the prediction. However, it is increasingly important to manage energy as a limited system resource, in addition to more traditional computation resources such as CPU time. For example, in [1], the authors propose a systematic reexamination of all aspects of OS design and implementation from the point of view of energy efficiency rather than the more traditional metric of maximizing performance. They mention how techniques like disk spin-down, voltage scaling, adaptive placement of memory blocks, energy-aware routing can be employed in OS design to reduce the power usage by mobile devices. 3. EXPERIMENTAL SETUP We use the Compaq iPAQ 3650 handheld, running Familiar Linux2.4.3, for our experiments. The iPAQ has a 206 MHz Intel StrongARM SA1110 processor and 32 MBytes of RAM. Its wireless connection is through a Lucent Orinoco (WaveLan) Golden 11Mb/s PCMCIA card. In our experiments, we maintain the typical wireless LAN environment in which many wireless devices use the same access point(s) for communication at the same time. We measure the energy consumed on the iPAQ while an application executes. A digital multimeter is used to measure the electrical current drawn by the iPAQ. To get an accurate measurement of the current actually consumed by the handheld device, we disconnect the batteries from the iPAQ and use an external DC power supply. A Windows terminal is connected to the multimeter. We run a program in the Windows terminal written using Agilent SICL (Standard Instrument Control Library) to store the DC current readings taken by the multimeter in a file, while the target application is running. Figure 1 shows a sketch of our experimen-

frame rate (frames/s) Power Supply HP IB Cable

Multimeter

Console for Collecting data

iPAQ

Figure 1: Experimental Setup.

tal setup. In our experiments, the WaveLan network interface is always powered on. This corresponds to a realistic situation in which a user wishes to stay connected to the network, for receiving incoming messages. For the playback application, we use the mpeg play software MPEG video player developed at the University of California at Berkeley (Version 2.3; March 1996). We choose a variety of MPEG video sequences with different frame type patterns, display sizes, frame sizes, and capture bit rates. Table 1 lists the video sequences used in our experiments, together with a brief decription for each. Except video-1, all the other video sequences are captured using a hardware MPEG encoder card from two different movies called “Bounce” and “Legendary Life”, respectively. Video sequence video-1 video 2 video-3 video-4 video-5 video-6 video-7 video-8

Description A rotating torus Beginning of Legendary Life Beginning of Bounce A person talking on a phone (from Bounce) Captured from Bounce Captured from Legendary Life Two persons talking (from Legendary Life) Captured from Bounce

Table 1: List of video sequences used for the experiments.

1.9 2 2.8 2.9 3 3.6 3.7 3.8 4 4.5 4.6 4.7 4.8 5 5.2 5.3 5.6 5.7 5.8 5.9 6.3

energy used (Joules) video-2 2176 2040 1710 1715 1490 1351 1259 1263 -

video-3 2412 1806 1652 1647 1512 1510 1524 1353 1350 1335

energy rate (Joules/ ) 

video-2 0.76 0.95 0.95 1.11 1.20 1.32 1.33 -

video-3 0.89 1 1.23 1.22 1.37 1.37 1.38 1.50 1.50 1.49

video-6 0.89 1.04 1.20 1.21 1.42 1.42 1.74 1.70 1.70 -

Table 2: Energy consumption as a function of frame rate. (Energy used results for video-6 are omitted due to limited space.)

consumption (1335 Joules) at 6.3 frames/s. The reason is that in the experiments, the frame rate reduction is achieved by introducing sleep delay between successive frames, and not by dropping frames. Hence, the time required for completing a video sequence increases as we decrease the frame rate, which results in increase in the total energy consumption. Notice, however, that the energy consumption rate decreases significantly as the frame rate decreases. For example, video-2 played at 2 frames/s consumes energy at a rate of 0.89 J/ , which is only 60% of the energy rate (1.49 J/ ) at 6.3 frames/s. Therefore, in an adaptive execution environment in which frame rate reduction is achieved by dropping selective frames (i.e., temporal scaling of the video), the total energy usage will decrease with a reduced frame rate.

4. EXPERIMENTAL RESULTS In this section, we present our measurement results. We will then use these results to develop predictive models for energy consumption in Section 5. We classify the experimental results according to the MPEG video parameter being controlled. 4.1. Frame rate The first set of experiments is carried out to see how the frame rate of MPEG video can affect energy consumption. We play the video sequences at different frame rates and capture the current readings in a data file. We compute the energy consumed based on these readings. Table 2 shows the results. In the table, is the time interval between successive sample readings taken by the multimeter. The table clearly shows that decreasing the frame rate significantly increases the total power consumption. For example, video2 played at 2 frames/s consumes 2412 Joules, 1.8 times the energy

4.2. Display size The display size of an MPEG movie (i.e., width height in pixels of the display window) is another parameter that can affect energy consumption. In a set of experiments, we play video-1 at different display sizes. Notice that only the display size is changed, but not the amount of video information processed. Hence, pixels are cropped if the display is too small, and individually enlarged if the display is larger than the original video frame. (We black out the screen background in hope of saving energy when the actual display is small.) Figure 2 shows the results for 4 different display sizes. From the figure, notice that the display size has little effect on the energy consumption rate. We conclude that energy use is dominated by the work to decode and process the original video information (which is not affected by the display size), rather than the work to make the pixels visible. 

capture bit rate (Mb/s)

0.45 Display size 50x50: Display size 100x100: Display size 150x150: Display size 200x200:

Current drawn (Amps)

0.35

0.3

0.25

0.2 0

5

10

15

20

25

30

35

sample number

Figure 2: Current consumption for different display sizes. Transition from high to low energy use for a graph corresponds to the termination time of the video sequence.

video-4 1052.56 2267.04 2831.63 3146.58 3176.30

0.4 1 2 2.99 4.02 4.99 6.01 7.04 8 9.03 9.99 12.04 15

0.4

energy used (Joules) video-7 653.58 980.08 1052.23 1387.44 1463.74 1775.91 1797.63 1920.22 1996.98 2052.46 -

video-8 747.57 1043.91 1166.01 1635.93 1779.85 1994.32 2066.08 2076.28 2056.68 1941.19 -

Table 4: Energy consumption as a function of capture bit rate. 10 I frame: P frame: B frame:

4.3. Capture size Next, we capture MPEG video at different frame sizes (i.e., the capture size). During playback, the display size is the same as the capture size encoded in the video stream. Capturing for a larger frame size increases the size of the video stream and the amount of video information processed. Hence, it increases energy use. Table 3 shows the results. capture (pixels )

size

19200 76800 84480 100800 115200 168960 172800 153600 230400 307200 345600

Energy used (Joules) video-2 436.25 1481.09 1830.31 2192.26 2171.47 3144.51

video-5 391.04 1184.25 2878.39 2773.71 2307.48 3200.81 3811.72 4074.90

video-6 1706.06 1836.62 2105.63 2967.74 3148.15 2782.37 3767.95 4477.85 4855.33

Table 3: Energy consumption as a function of capture size.

4.4. Capture bit rate We capture MPEG video at different bit rates. A higher bit rate increases the spatial resolution of the video and produces sharper pictures. To see the effect of capture bit rate on energy consumption, we play several video sequences with varied capture bit rates for each. Table 4 shows our experimental results. Notice that the higher video quality resulting from a higher capture bit rate comes at significant energy costs. For example, video-4 at 15 Mb/s consumes three times as much energy as the same video at one Mb/s. 4.5. Frame pattern Next we encode a movie clip with different frame patterns to find out the effect of frame type (I, P or B) on energy consumption. In

sum of currents drawn per frame (Amps)

9

8

7

6

5

4

3

2

1 0

5

10

15

20

25 30 sample number

35

40

45

50

Figure 3: Scatter plot showing relative energy usage of I, P and B frames. an experiment, we play a clip and, for the duration of the clip, sample the current usage at periodic intervals. Since sampling is periodic, the number of sample readings taken for a picture is roughly proportional to the time taken to decode and display the picture. The sum of these sample readings then gives the relative energy use by the picture. The scatter plot in Fig. 3 profiles the energy usage by each picture, marked according to its frame type. Notice that, generally, I pictures consume the most energy, followed by P pictures and then B pictures, which consume the least amount of energy. 5. ENERGY PREDICTION MODELS Based on our measurement results, we conclude that the following MPEG video parameters can significantly impact power consumption: (i) frame rate, (ii) capture size, and (iii) spatial resolution (i.e., capture bit rate). Moreover, the general effect is intuitive – e.g., increasing the frame rate increases power consumption. However, to assist in energy adaptation in a dynamic system environment, quantitative models of how energy use varies according to the controllable parameters are needed. To obtain the energy models, we run a regression modeling the energy consumption as a function of the three video parame-

4500

2400

4000

energy consumed for 100 frames (Joules)

energy consumption for 100 frames (Joules)

2200 3500

3000

2500

2000

1500

2000

1800

1600

1000 1400 500

0

0

0.5

1

1.5

2

2.5

3

1200 1.5

3.5

2

2.5

3

3.5

4

4.5

5

5.5

6

6.5

5

display area (square pixels)

x 10

frame rate (frames/ sec)

Figure 4: Polynomial energy model as a function of capture size. (An ’x’ refers to an actual data point).

Figure 5: Polynomial energy model as a function of frame rate.

3500







 

       

                 !"$#% # &#%      '#   #%(*)   #%(,+    - %.  where  and  vary with   and - means that the coefficient is negligible. The coefficient of determination for this fit is 0.99. 0/   

   1 #      #   2 where  0   and  varies with   The coefficient of determination for this

3000 energy consumed per 100 frames (Joules)

ters, respectively. For each set of data points obtained in Section 4, we compute best-fit polynomials (in the least square sense) of increasing degrees until the incremental improvement of using a higher-degree polynomial is insignificant. For example, we compute best-fit polynomials of degree zero to five for the capture size parameter and, for each fit, we calculate the sum of squared errors (SSE). The improvement in SSE from degree four to degree five is marginal, and thus, the degree-four polynomial is used. However, the coefficients for degrees two and higher are very close to zero. Based on the approach, we express (the energy consumption in Joules) as a function of (the frame rate in frames/s), (the capture size in pixels ) and (the capture bit rate in Mb/s), respectively: where Mb/s The coefficient of determination for this fit is 0.92.

2500

2000

1500

1000

500

0

5

10

15

capture bit rate (MB/s)



Figure 6: Polynomial energy model as a function of capture bit rate.



7. REFERENCES



fit is 0.95. Figures 4, 5 and 6 illustrate how well the data points fit the computed least-square polynomials, for capture size, frame rate, and capture bit rate, respectively. Notice that the coefficients of determination for all the polynomial fits are 0.92 or higher. This shows that we can make good prediction about the energy requirement of MPEG video playback. When used in an energy adaptation architecture, the models can lead to informed energy management of handheld devices. 6. CONCLUSION The ability to predict application energy requirement is important for any adaptive energy management strategy. Our experiments with an MPEG video playback application show that its energy consumption on a handheld can be expressed as a function of several parameters that can be individually controlled in an adaptive scheme. This allows us to make informed decisions in adapting to low remaining power situations, rather than through trial and error.

[1] A. Vahdat, A. Lebeck and C. S. Ellis, ‘Every Joule is Precious: The Case for Revisiting Operating System Design for Energy Efficiency’, 9th ACM SIGOPS European Workshop, September 2000. [2] R. Kravets, K. Schwan, and K. Calvert, ‘Power-aware communication for mobile computers’, In Sixth Int’l Workshop on Mobile Multimedia Communication, November 1999. [3] B. Noble, M. Price, and M. Satyanarayanan, ‘A Programming Interface for Application Aware Adaptation in Mobile Computing’, Proc. 2nd USENIX Symposium on Mobile and Location-Independent Computing, Ann Arbor, MI, April 1995. [4] M. Satyanarayanan, B. Noble, P. Kumar, and M. Price, ‘ApplicationAware Adaptation for Mobile Computing’, Operating Systems Reivew, 29(1), January 1995. [5] J. Flinn and M. Satyanarayanan, ‘Energy-Aware Adaptation for Mobile Applications’, Proc. 17th ACM SOSP, Kiawah Island Resort, SC, December 1999. [6] A. Bavier, B. Montz, and L. Peterson, ‘Predicting MPEG execution times’, Proc. ACM SIGMETRICS/PERFORMANCE, June 1998.