Upscaling Question

So primarily use Windows and an older app named Tencoder to upsample media files to 1080p or higher.

As CPU’s have gotten stronger it takes less and less time to upscale.

I have not really noticed much if any difference between using a 7950X or a 7800X3D CPU to do these jobs.

Do these apps even use extra L3 cache or do the apps have to be coded to use this feature of the CPU ?

Seems like really any recent gen CPU from both Intel and AMD can just brute force this and you would probably only see a very modest gain in time reduction but who knows.

Any thoughts on this one ?

older app named Tencoder to upsample media files

The first thing is that you should stop doing this right now. I didn’t dig through the code to find what upscaler that would be using but 8 years ago there were almost certainly no algorithms that could produce a meaningfully better result than what modern CPUs and GPUs can do in real time.

You’re just making your files bigger and harder to play back, and burning a bunch of electricity decoding and reencoding video, in a format from 8 years ago, giving it another generation of compression artifacts.

Except for adding/removing audio tracks and cutting at keyframes in some formats, any transform or filter you apply to a video file is like dubbing a cassette tape. What comes out the other end is worse.

It’s been years since I watched much local video of any kind, but a cursory search suggests mpv’s real-time upscalers are state-of-the-practice. You don’t create a 1080p file. You just fullscreen the video and watch at 1080p (or whatever the resolution of your screen is).

Now, to your question, I would assume that most of the CPU time of this operation is going to re-encoding the video.

CPU is very fast, very stupid machine that does exactly what the code says. Code says things like “add,” “multiply,” “skip next instruction if result of last arithmetic was zero”.

Code says exactly what to do, but not how long to take to do it. Here is design freedom of x86-compatible CPU. Often code is written to use a lot of the same numbers over and over again. “Spatio-temporal locality”. So, CPU designers make cache to hold recently used numbers and have them ready really fast. Holding more numbers is slower than fewer, so later CPU designers change name of cache to “L1”, and 2nd, bigger slower cache, and call “L2”. Years later, happens again and called “L3”.

Also, CPU designers learn to guess which numbers code will use next, like if they go “0 1 2 3 4 5” or “0 4 8 12 16”, and get numbers ready in cache ahead of time. Called “prefetch”.

Finally, CPU designers think, “surely, programmers will want to make their code run fast, so we will add instruction to ask CPU how big cache is! Then they can know not to use too many numbers.” Called CPUID. This is the beginning and the end of how apps can be coded to use caches. That’s all there is. And the vast, vast majority of apps do not use it.

The X3D CPUs, with their huge L3 caches, run games well because game code (apparently) tends to use a very large amount of numbers, in patterns that are hard to guess.

Video encoders, however, almost certainly do use CPUID, and are written with cache locality in mind. They get an enormous amount of attention from extremely skilled programmers, because they consume hundreds of millions, perhaps billions, of dollars of CPU time.

Up until (metaphorically) Last Tuesday, 96 MiB L3 caches did not exist, and very nearly none of the computers on which those dollars are spent have them. And if the potential buyers thought about it, they’d notice that the cache die uses about as much silicon as adding a whole 'nother 8 cores. Usually, they’d rather have the cores.

Also, you can pull up the Phoronix review of the 9800X3D and see how it performs in video encoding compared to the 9700X (105W edition). TL;DR: it’s faster, but not dramatically so, and the improvements are concentrated in the less-well-optimized AOM AV1 encoder, and the higher presets of SVT-AV1 (which have relatively poor quality and encode many times faster than real time).

Thanks for the reply and feedback, an interesting read.

I will check out that Realtime upscaler you linked.

I figured that Phoronix would do some 9800X3D testing so some more reading there too.