View Full Version : Encoding 422 source as 444 makes it smaller?
I'm getting this odd result and was wondering about it.
Is this a free win or what am I missing, incomparable crf?
sample (http://archive.org/download/Lufia2SourceQualityTest2ByMahiru/mahiru-lufia2-qualitytest-source2.zip)
mah.avsavisource("mahiru-lufia2-qualitytest-source2.avi")
assumetff
separatefields
crop(54,8,616,224)
assumeframebased
encode.batx264_10 --tune touhou --preset veryslow --crf 17 mah.avs -o t444_10.mp4 --sar 4:9 --output-csp i444
1.21MB for the 422
1.14MB for the 444
CRF means "constant throughout the video, by x264's measure of quality". It does not mean "constant regardless of what settings you use, the laws of physics in the universe you're in, or whether or not your glasses are on."
Since different settings may change x264's definition of quality, x264 can't possibly guarantee identical quality across all settings.
So why not set a same lower bitrate (both 2pass, others are the same) for 422-input with 422/444-output visual quality & encoding speed testing?
Comparing ssim at similar bitrates gives the results I was expecting.
Thanks for the suggestion.
k256-c422-s15.042_261.mp4
k256-c444-s14.699_260.mp4
k384-c422-s17.577_387.mp4
k384-c444-s17.301_390.mp4
k512-c422-s19.400_515.mp4
k512-c444-s19.057_517.mp4
k640-c422-s20.718_640.mp4
k640-c444-s20.365_645.mp4
@echo off
set PATH=C:\my\lib
IF [%1]==[] ECHO drag+drop .avi or .avs & PAUSE & GOTO :EOF
FOR /L %%B in (256,128,640) do (
FOR %%A in (422 444) do (
call :encode_video %1 %%A %%B
))
GOTO :EOF
:encode_video
REM %1 - filename
REM %2 - chroma sub
REM %3 - target bitrate
SETLOCAL ENABLEDELAYEDEXPANSION
set flags="%~nx1" -o "%~n1.mp4" --ssim --tune ssim --sar 4:9 --preset veryslow
set flags_2=%flags% --output-csp i%2 --bitrate %3
echo %flags_2%
ECHO Beginning x264 first pass...
x264_10 %flags_2% --pass 1
ECHO Beginning x264 second pass...
x264_10 %flags_2% --pass 2 2>&1 | mtee x264_%3pass.log
FOR /F "tokens=7 delims=. " %%G IN ('TYPE x264_%3pass.log ^| FIND "encoded"') DO (
set KBPS=%%G
)
FOR /F "tokens=3 delims=(." %%H IN ('TYPE x264_%3pass.log ^| FIND "SSIM"') DO (
set SSIMa=%%H
)
FOR /F "tokens=3 delims=.d" %%I IN ('TYPE x264_%3pass.log ^| FIND "SSIM"') DO (
set SSIMb=%%I
)
rename "%~n1.mp4" "k%3-c%2-s%SSIMa%.%SSIMb%_%KBPS%.mp4"
GOTO :EOF
Dark Shikari
10th May 2012, 01:12
SSIM only counts luma quality.
4:4:4 in x264 has a hacky chroma QP offset applied to try to make the chroma quality similar to 4:2:0 by default, but at a higher resolution, for perceptual reasons. This might make it smaller than 4:2:2.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.