This "goes without saying" but it should still be said. To get maximum resolution on Youtube, etc, you need to crank up your cpu to its max speed. It's not just laptops, many desktop PC's also have speed-scaling. On some distros the default governor seems to be "ondemand". This is not as fast as it could be. The problem is that "ondemand" drops down to slowest speed, and only ramps up when a cpu is under high load, by which time Youtube, etc is already dropping frames.
The solution to that is to switch over to "performance" mode. On a Youtube roller coaster video that I use for benchmarking, a used Lenovo went from being able to handle 480p to handling 720p without stuttering or dropping frames. Of course, laptop battery drain will speed up, and it may also heat up. So switch to a lower-drain setting after doing the heavy-duty stuff.
The details for doing so vary from distro to distro. It also requires that...
- The cpu is modern enough to support speed scaling.
- Speed scaling support is compiled into the kernel or available as a kernel module.
- Your distro has tools for accessing the speed scaling interface.
If you have items 1 and 2, but not 3, I wrote a bash script (YES!!!) that can enumerate, and switch between all available speeds or governors. Gentoo does have this available, but these cpu utilities tend to have a "pointy clicky oowie gui" design which pulls in a ton of graphic library dependencies. My bash script rquires bash... period... end of story.