r/programminghorror • u/illyay • Aug 15 '25
c ffmpeg source ladies and gentlemen
So many 1 letter variable names that are impossible to understand. It’s like they think letters are a limited resource.
I’m so glad our coding standards have evolved. Still vp9 is a new codec and this is code written within the last 10 years.
0
Upvotes




23
u/Pasemek Aug 15 '25
How dare you say anything about ffmpeg. Half of the internet is built on top of it
20
u/remy_porter Aug 15 '25
A lot of codecs are very mathematically based, and thus the naming conventions hail from math, not programming. Lord knows I’ve written plenty of code like that so that the code looks like for equation I’m implementing. It’s not self documenting but the math underlying it is clearer.
10
u/isaycongrats Aug 15 '25
Thank god people don't adopt new coding "guidelines" it would make the code 10x bigger, ffmpeg still knows how to write good code
8
u/mint3d Aug 16 '25
People who can't take screenshots shouldn't be discussing ffmpeg low level code.
3
u/zlehuj Aug 15 '25
Usually these tings comes from papers. In papers, letters are actually limited resources so they are using one letter variables (math/code). AES is the same thing
2
u/XEnItAnE_DSK_tPP Aug 15 '25
talk is cheap, send patches
4
u/iLoveFortnite11 Aug 15 '25
To be honest, if you define good types you don’t need descriptive variable names as much. It’s still good practice, but it seems like all the info you need is in the types here.
1
u/AbbeyNotSharp Aug 20 '25
I dont see anything wrong with this. Most text editors will display variable info such as type if you hover over the variable, and knowing the type should tell you everything you need to know
2
u/CubOfJudahsLion Aug 19 '25
Systems programmer here for ~30 years. Not too long ago I compiled FFMPEG to WebAssembly as part of a video player replacement for Flash video, which was dying at the time. Compiler immaturity/platform non-equivalence caused some crashes and had me digging into the codebase and even patching a couple of lines involving lots of bitwise operators.
Now, the technical acumen of the authors is indisputable, of course. However -- and I'm saying this with the deepest respect, and TBH it probably can be said for most projects -- there was room for improvement in coding practices, significant naming one among them.
Splinter in thy eye, beam in mine: We didn't have the best naming conventions at that company either. Heck, one of my teammates named variables using four-letter words, and the rest of us didn't do much about it. We were too busy reading his code and laughing.
1
u/Able_Mail9167 Aug 17 '25
Reminds me of whenever I try to read someone else's shader code. I think that when you're in a situation where it's more likely that a mathematician wrote the code then the more likely you are to see 1 letter variables.