While Apple’s new Silicon chips, M1 and M2, have garnered widespread acclaim for their efficiency, they notably lack support for AV1 hardware decoding — a feature found in many modern System-on-Chip (SoC) designs. But does this omission have a noticeable impact on the battery life of Apple laptops?
I encountered this question when I noticed my MacBook’s battery draining much quicker than Apple’s official estimates, particularly when watching videos on YouTube. To investigate this discrepancy, I decided to conduct a series of measurements using the convenient powermetrics tool included with macOS.
What is AV1?
AV1 is the newest of a long series of video codecs that you may have heard of. Video codecs are responsible for compressing videos, making them smaller while trying to maintain visual quality. The most used video codecs were usually standardized by the Moving Picture Experts Group (MPEG ) and the International Telecommunication Union (ITU). By order of appearance :
- MPEG1 (1988) used by the VideoCD
- MPEG2 (1994) used in DVDs
- H264 (2003) used for 1080p videos served by BluRays, DTV and video streaming on the Internet
- H265 used for 4K videos
The algorithms forming these codecs were developed by private entities and are subject to patents and licensing fees. That does not pose too much trouble for electronic appliances. But the complexity of the licensing schemes for modern codecs, such as H265, and the volume of video streamed on the internet made major software vendors, led by Google, to form the Alliance for Open Media. It is a non-profit organization whose goal is to develop open, royalty-free technology for multimedia delivery.
AV1 is their first realization and is the successor of VP9, a prior royalty-free video codec developed solely by Google. Latest benchmarks show that AV1 can achieve comparable visual quality as H265 while requiring 15-20 % less bytes ; at the cost of being more resource intensive to encode and decode.
As it makes them economize bandwidth while being free to use, AV1 is now the privileged way to stream videos. That is why most modern SoCs come with some form of hardware support for AV1 decoding.
Otherwise, a software decoder is used as a fallback.
Impact of the AV1 software decoder on power-usage
In order to obtain measures that can be compared, I wrote an AppleScript that launches powermetrics, waits 15 seconds, and then directs the browser to play a specific YouTube video in 4K HDR and in fullscreen mode, accessible here.
I conducted the test across various web browsers. Notably, only Firefox on macOS natively supports AV1 and enables it by default. To ensure YouTube served VP9 videos to Firefox, I manually deactivated AV1 support.
All the scripts used for running the tests and generating graphical data from powermetrics logs are available on Github.
The following observations are directly related to the architecture of the M2 Pro:
- Efficiency Cluster: This cluster houses low-power cores designed to manage background tasks and activities that don’t require significant CPU resources.
- Performance Clusters: There are two performance clusters that contain the more power-hungry cores responsible for handling CPU-intensive tasks and responding to user interactions.
- GPU (Graphics Processing Unit): The GPU primarily handles display-related calculations but can also function as a highly parallel coprocessor, assisting with complex tasks.
It’s worth noting that all the CPU cores within a cluster operate at the same frequency.
To illustrate the video decoding performance effectively, the testing procedure involves a 30-second initial idle period. Subsequently, the script launches the video, and once playback is complete, the computer remains idle for another 30 seconds. This approach helps display the video decoding results clearly in time-based graphics.
The impact of the software decoding for the AV1 decoding is clearly visible. Both performance clusters consistently run above 3GHz without any interruption, and the efficiency cluster also maintains its maximum clock rate.
In the case of VP9 videos, which leverage the hardware decoder, the performance clusters are notably less stressed. Even the efficiency cluster doesn’t always operate at its highest speed. It’s interesting to observe that different web browsers seem to engage the performance clusters in distinct patterns. Chrome, for instance, at times even temporarily deactivates one of them.
The average frequency graph reflects that. Keep in mind that it takes into account the one minute period when the video is not played.
The difference is huge! VP9 video graphs are so low compared to AV1 that the moment the video plays is almost non-discernible from the moment the computer is idle!
It’s not unexpected to observe that a software decoder is less energy-efficient compared to a hardware counterpart. But now, we can say that playing an AV1 video consumes 10 times more energy than playing a VP9 one!
Concerning the difference between the browser, it is hard to conclude anything and it may be caused by the conditions of the test.
If you’re using Firefox on macOS and your Mac lacks AV1 hardware decoding support, you’ll notice a significant battery-saving opportunity by manually disabling AV1 video support. While AV1 hardware decoding was recently announced for the M3 chip, the M1, M2, and earlier Intel CPUs still rely on software decoding.
The community has made remarkable efforts to optimize AV1 decoders, going so far as to write them entirely in assembly language tailored for each CPU and SIMD variant. However, the CPU’s workload remains substantial and power-intensive. For Firefox users seeking to conserve battery life, disabling AV1 support is a recommended step. It’s worth noting that Safari and Chrome do not enable AV1 support by default.
Additionally, it’s important to keep in mind that platforms like YouTube and most streaming services use AV1 not to enhance video quality, but primarily to save on bandwidth.
In order to know if Firefox can use hardware decoding capabilities, write about:support in the address bar.
Codec support information on a M2 Pro
In order to disable AV1 support, write about:config and set the media.av1.enabled boolean to false.
Firefox configuration: disabling AV1 support