← Firmware research← 韌體研究

What the RWZM resizer doesRWZM 縮圖電路做了什麼

After the sensor there is a second machine that shrinks the picture the rest of the way. Every mode except OG3K and OG2K goes through it. It turns out to matter more than the binning does — because it shrinks without smoothing first, and because it does not treat every row the same way.感光元件後面還有第二台機器,負責把畫面縮到剩下的尺寸。除了 OG3K 和 OG2K 以外,所有模式都會經過它。它的影響其實比像素合併還大 —— 因為它縮圖之前不先做平滑,而且它不是每一列都用同樣的方式處理。

Where this stage sits這一關在哪裡

The sensor cannot produce the final frame size on its own. Whatever it hands over, a separate circuit — the firmware calls it RWZM — shrinks the rest of the way.感光元件自己做不出最終的畫面尺寸。不管它交出什麼,都有一個獨立的電路 —— 韌體裡叫 RWZM —— 把剩下的尺寸縮完。

mode模式sensor stage感光元件那一關then RWZM然後 RWZM
OG3KOG3K÷2÷2none — straight to the card沒有 —— 直接寫卡
OG2KOG2K÷3÷3none沒有
UHDUHDnone沒有shrinks by 25/16縮 25/16
FHDFHD÷2÷2then shrinks by 25/16 again再縮 25/16

So FHD goes through both stages, UHD goes through this one alone, and the two open gate modes never touch it. That is the split that decides most of the picture quality on this camera.所以 FHD 兩關都走,UHD 只走這一關,而兩個 open gate 模式完全不碰它。這台相機大部分的畫質差異,就是這條界線決定的。

Problem one: it shrinks without smoothing first問題一:它縮圖之前不先平滑

When you make a picture smaller you are throwing away sample points. Anything finer than the new spacing cannot be recorded — but it does not politely disappear. It comes back as a different, coarser pattern that was never in front of the lens: a fabric weave turns into wide stripes, a brick wall into wavy bands, a fine grid grows colour fringes.把一張圖縮小,等於在丟掉取樣點。比新間距還細的東西是記錄不下來的 —— 但它不會乖乖消失。它會變成一個完全不同、比較粗的圖案回到畫面上,而那個圖案根本不在鏡頭前:布料的織紋變成寬條紋、磚牆變成波浪、細格子長出彩色的邊。

The standard cure is to blur the picture slightly before shrinking, so the too-fine detail is gone before it can misbehave. This circuit does not do that. Every one of its sixteen recipes is a narrow two-point mix, and the width never changes no matter how much you are shrinking by.標準的解法是在縮之前先把畫面稍微模糊一點,讓太細的細節在搗亂之前就先消失。這個電路沒有做這件事。它十六套做法每一套都只是很窄的兩點混合,而且不管你要縮多少,寬度都不變。

The consequence is one sentence: whatever protection a mode has against false patterns, it gets entirely from the sensor stage. A mode that skips the sensor stage gets none.結論只有一句:一個模式對假花紋的抵抗力,全部來自感光元件那一關。跳過那一關的模式,一點都沒有。

Problem two: it does not treat every row the same問題二:它不是每一列都一樣處理

To land on sample positions that fall between the input pixels, the circuit keeps sixteen slightly different recipes and rotates through them. Row 1, row 2 and row 3 each get handled a little differently, and the cycle comes back around every sixteenth row.為了取到落在輸入像素之間的位置,這個電路準備了十六套略有不同的做法,輪流使用。第 1 列、第 2 列、第 3 列各自被處理得有一點點不一樣,而這個循環每十六列回來一次。

On most subjects nobody would notice. On fine detail the recipes disagree enough that the sixteen-row cycle prints itself onto the picture — and because every pixel in a row shares a recipe, it prints as horizontal banding. That is the “digital look” people report in FHD.一般題材根本不會有人發現。但在細緻的細節上,這十六套的差異大到會把那個十六列的循環印在畫面上 —— 而且因為同一列裡每個像素共用同一套做法,印出來就是橫向的條帶。那就是大家說 FHD「有數位感」的東西。

The rule worth remembering值得記住的那條規則

How many of the sixteen a mode actually uses depends on the shrink ratio — specifically, on the bottom number when you write it as a fraction. FHD shrinks by 25/16, and 16 on the bottom means all sixteen recipes are in play. Shrink by 3/2 and only two are ever used. Shrink by a whole number and only one is.一個模式實際會用到幾套,取決於縮圖比例 —— 更精確地說,取決於把它寫成分數時下面那個數字。FHD 縮的是 25/16,分母 16 代表十六套全開。縮 3/2 的話只會用到兩套;縮整數倍的話只會用到一套。

shrink by縮圖比例recipes used用到幾套repeats every重複週期banding?會不會起條帶
25/16 — FHD, UHD25/16 —— FHD、UHD1616 rows16 列yes會
8/58/555 rows5 列barely幾乎不會
3/23/222 rows2 列no — reads as grain不會 —— 看起來像顆粒
2, 3 — whole numbers2、3 —— 整數1——no不會

Two recipes carry almost as much error as sixteen do — 17% against 21% of picture contrast. The difference is that with two, the error flips sign on alternating rows, so it lands at the finest scale the picture has and reads as grain. With sixteen it repeats slowly enough to be seen as bands. The problem was never how much error. It was what shape the error came in.兩套做法帶的誤差幾乎和十六套一樣多 —— 佔畫面對比的 17% 對 21%。差別在於兩套的時候,誤差在相鄰列之間正負交替,落在畫面最細的尺度上,看起來是顆粒;十六套的時候,它重複得夠慢,看起來就是條帶。問題從來不是誤差有多少,是誤差排成什麼形狀。

How bad, in numbers到底有多糟,用數字講

Same reference frames, five different materials, every route the camera can take or could be made to take. Lower is better: the number is how much of the picture came out as something that was not there. Italic rows are not real routes — they are what a mathematically perfect shrink would score.同一組參考畫面、五種不同材質、相機做得到或可能做得到的每一條路線。數字越小越好:它代表畫面裡有多少東西變成了原本不存在的樣子。斜體列不是真的路線,是數學上完美的縮圖會拿到的分數。

route路線dense weave密織布料everyday material一般素材noise雜訊recipes用幾套
OG3K — sensor onlyOG3K —— 只走感光元件3.9%0.7%×0.55—
a perfect 2×2完美的 2×23.0%0.5%×0.50—
OG2K — sensor onlyOG2K —— 只走感光元件22.7%2.7%×0.43—
OG4K — full read, shrink 3/2OG4K —— 讀滿再縮 3/24.9%5.1%×0.572
UHD — full read, shrink 25/16UHD —— 讀滿再縮 25/167.1%4.8%×0.5616
FHD — ÷2, then 25/16FHD —— ÷2 再縮 25/1613.8%6.2%×0.3116
2K — full read, shrink 32K —— 讀滿再縮 3 倍34.1%4.7%×0.611

The everyday column splits the table in two, and not where the output size does. The two routes that never touch the resizer score 0.7% and 2.7%. Every route that touches it pays between 2.2% and 7.3%, whatever ratio it uses. A sensor merge applies the same recipe everywhere, so its mistakes are uniform and a little sharpening takes them back. The resizer uses a different recipe at every position, so its mistakes change from pixel to pixel — and that part is gone for good.「一般素材」那一欄把表切成兩半,而切的地方不是輸出尺寸。完全不碰縮圖電路的兩條是 0.7% 和 2.7%;碰到它的每一條都要付 2.2% 到 7.3%,不管用什麼比例。感光元件的合併在每個位置用同一套做法,所以它犯的錯是均勻的,稍微銳化就能拿回來。縮圖電路在每個位置用不同的做法,所以它犯的錯逐像素改變 —— 那一部分救不回來。

Six seconds, cut on the switch. Three of FHD, then three of OG2K, cropped to the white shirt so you can see the weave; the labels were burned in by the person who shot it. Under OG2K the weave is a fine, even crosshatch, which is what the cloth is. Under FHD it goes coarse and blotchy, and the pattern that appears is not the one in front of the lens.六秒,正好切在切換點上。前三秒 FHD、後三秒 OG2K,裁到白襯衫,讓你看得到織紋;標籤是拍攝的人自己燒進畫面的。OG2K 之下織紋是細而均勻的交叉紋,那就是這塊布本來的樣子;FHD 之下它變粗、變花,而且出現的圖案並不是鏡頭前那一個。

Grading the banding把橫向條帶打分

The banding can be graded on its own. Take a real frame, shrink it with the recipes a route actually uses, shrink it again with the average of those same recipes, and subtract. What is left is the banding by itself.橫向條帶可以單獨打分。拿一張真實畫面,用某條路線實際會用到的做法縮一次,再用那些做法自己的平均縮一次,兩者相減。剩下的就是條帶本身。

route路線recipes用幾套size of it有多大worst row vs best最重列比最輕列grade評分
OG3K, OG2K — no resizerOG3K、OG2K —— 不經過—0.00%1.0×A
shrink by a whole number縮整數倍10.00%1.0×A
OG4K — shrink 3/2OG4K —— 縮 3/2216.9%1.0×B
UHDUHD1619.9%8.9×D
FHDFHD1621.0%13–22×F

A control makes this readable: feed the same test a picture of pure random noise and both directions come out identical, 3.2 against 3.4. Feed it a real scene and rows vary by 13× while columns vary by under 3×. The lopsidedness comes from the subject, not the circuit — a real frame carries more fine detail across than down, so it is the row recipes that get provoked, and their mistakes arrive as full-width bands. On hard edges and lettering it reaches 36×.有個對照組讓這張表讀得懂:同一個測試餵純隨機雜訊進去,兩個方向的結果一模一樣,3.2 對 3.4。餵真實畫面進去,列之間差 13 倍,行之間不到 3 倍。這個不對稱來自題材,不是來自電路 —— 真實畫面橫向的細節比縱向多,所以被激發的是「列」那一組做法,而它的錯誤是整列寬的。在硬邊和文字上,這個比值到 36 倍。

Is FHD better in the dark?FHD 暗部比較好嗎?

It looks like it. FHD averages about twice as many sensor cells per output pixel as OG2K, which is half a stop, and in real footage it does measure quieter. But averaging more cells is also what makes a picture soft, and a soft picture looks less noisy whether or not it collected more light. So: blur the sharper mode until its texture matches FHD’s, then compare.看起來是。FHD 每個輸出像素平均到的格子數大約是 OG2K 的兩倍,也就是半級,而在實拍上它確實量起來比較安靜。但「平均更多格子」同時也是讓畫面變軟的原因,而軟的畫面看起來就是比較不吵,不管它有沒有真的多收到光。所以:把比較銳的那個模式模糊到紋理跟 FHD 一樣,再比。

texture紋理noise雜訊vs FHD相對 FHD
OG2K, untouchedOG2K,原樣16.7%7.14×1.25
OG2K, blurred to match FHDOG2K,模糊到跟 FHD 一樣14.0%5.77×1.01
FHD, as shotFHD,原樣14.3%5.71—

Matched for sharpness they are level. A second scene, shot at ISO 800, says it harder: take the OG3K frame, shrink it properly to FHD’s size with a filter that does smooth first, and you get the same noise with more than twice the texture — no blurring needed at all. FHD’s half stop is the blur, not the light. You can have the same trade from a sharper mode whenever you want it, and stop before it costs you the detail.銳利度對齊之後兩者持平。另一個 ISO 800 的場景講得更重:拿 OG3K 的畫面,用一個會先平滑的濾波器正確縮到 FHD 的尺寸,得到的是一樣的雜訊、兩倍以上的紋理 —— 連模糊都不用。FHD 那半級是模糊,不是光。同樣的交換你隨時可以自己做,而且可以在還沒賠掉細節之前停手。

So what should you shoot?所以該拍哪個

you are shooting你在拍的是take選why理由
anything, if the size suits you任何東西,只要尺寸合用OG3KOG3Knever touches the resizer; the cleanest route measured完全不碰縮圖電路,量過最乾淨的一條
2K — fabric, skin, foliage2K —— 布料、皮膚、植物OG2KOG2K2.3× cleaner than FHD on everyday material, and no banding一般素材上比 FHD 乾淨 2.3 倍,而且沒有條帶
2K — fine repeating texture2K —— 細密的重複花紋FHDFHDits ÷2 stage is exactly the right filter for once它的 ÷2 那一關剛好是對的濾波器
4K4Kfull read, shrink 3/2讀滿,縮 3/2beats UHD on false patterns, and only two recipes假花紋贏現行 UHD,而且只用兩套做法
2K — in the dark2K —— 暗部still OG2K還是 OG2KFHD’s advantage is blur; soften it yourself insteadFHD 的優勢是模糊,不如自己去軟化

And for anyone building a new recording mode: pick a shrink ratio whose bottom number is five or less — 3/2, 5/2, 8/5, 12/5, or a whole number. It costs nothing, and the banding never appears. That is the one thing on this page that can be applied without measuring anything else.如果你在做新的錄製模式:挑一個分母小於等於 5 的縮圖比例 —— 3/2、5/2、8/5、12/5,或整數。這不花任何代價,而條帶就不會出現。這是這一頁唯一一條不用再量任何東西就能直接用的規則。

Where this comes from這些是怎麼來的

The sixteen recipes were solved from seven stills shot and released by Jose — one frame per mode of the same scene, on one body and one firmware. Nothing else went into them.那十六套做法,是從 Jose 拍攝並公開的七張靜態照片解出來的 —— 一個模式一張,同場景,同一台機身、同一版韌體。裡面沒有放進別的東西。

The footage used to check the results is separate, and is not Jose’s. The sailor-uniform clip above, the clothing pair, the star chart and the night test were all shot by this project. They are used only to confirm or contradict what the seven stills predict. Twice they contradicted it, and the page was changed.用來檢查結果的實拍素材是另一回事,而且不是 Jose 的。上面那段水手服、衣物那一對、星圖和夜景測試,全部是本專案自己拍的。它們只用來確認或推翻那七張照片的預測。有兩次它們推翻了,頁面就改了。

Still open: the sixteen recipes were only ever solved at one shrink ratio, 25/16. Everything here about 3/2 and the whole numbers assumes the same sixteen are used at every ratio. 3/2 needs only two of them and both were measured directly, so that is the least risky assumption on the page — but it is still an assumption. One clip recorded through 3/2 would settle it.還沒解:那十六套做法只在一個縮圖比例上解過,就是 25/16。這裡所有關於 3/2 和整數倍的說法,都假設每個比例用的是同一組十六套。3/2 只需要其中兩套,而那兩套都是直接量到的,所以這是全頁風險最小的假設 —— 但它仍然是假設。錄一段走 3/2 的片子就能定案。

The stage before this one — what the sensor itself does — is a separate page: What the IMX410’s binning actually does. The full technical version of both, with every table, is here.這一關之前那一關 —— 感光元件自己做了什麼 —— 在另一頁:IMX410 的像素合併到底做了什麼。兩者的完整技術版、所有表格,在這裡。