[MPlayer-users] about different swscalers

vdmsss vdm_sss at yahoo.co.uk
Tue Aug 21 12:07:14 CEST 2007


Hello. Apologies if this is something well known. Could somebody  
please explain to me the effect that different software scalers have  
on quality/bitrates. Look at the following two examples (full output  
at the bottom of this message):

Gaussian:
> mencoder -nosound -of rawvideo -sws 7 -vf scale=624:-10 -ovc x264 - 
> x264encopts crf=23 file.m2v -o file-s7.264 -frames 6000

Results in:
> Video stream:  819.957 kbit/s  (102494 B/s)  size: 24606907 bytes   
> 240.080 secs  6002 frames

Lanczos:
> mencoder -nosound -of rawvideo -sws 9 -vf scale=624:-10 -ovc x264 - 
> x264encopts crf=23 file.m2v -o file-s9.264 -frames 6000

Results in:
> Video stream: 1032.965 kbit/s  (129120 B/s)  size: 30999279 bytes   
> 240.080 secs  6002 frames

Is such a big difference expected? Where does it arise from? It must  
be that gaussian sheds quite a few details from the stream... More  
precisely, it appears to blur the image very badly. (Incidentally,  
both encodes proceed roughly at the same speed. Also, things are  
similar with other scalers, with gaussian and lanczos being at the  
extremes and the rest being in between, closer to lanczos than to  
gaussian.)

This discrepancy seems also to indicate that when working with  
bitrate=N (rather than crf=Q) one should take the scaler into  
account, eg not to throw wasted bits at the gaussian one. Or not?

Thanks

Full mencoder outputs:

> mencoder -nosound -of rawvideo -sws 7 -vf scale=624:-10 -ovc x264 - 
> x264encopts crf=23 file.m2v -o file-s7.264 -frames 6000

> MEncoder dev-SVN-r24007-4.0.1 (C) 2000-2007 MPlayer Team
> AltiVec found
> CPU: PowerPC
> 113 audio & 236 video codecs
> success: format: 0  data: 0x0 - 0x448a4ef5
> MPEG-ES file format detected.
> VIDEO:  MPEG2  720x576  (aspect 3)  25.000 fps  7568.0 kbps (946.0  
> kbyte/s)
> [V] filefmt:1  fourcc:0x10000002  size:720x576  fps:25.00   
> ftime:=0.0400
> Opening video filter: [expand osd=1]
> Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
> Opening video filter: [scale w=624 h=-10]
> ====================================================================== 
> ====
> Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
> VDec: vo config request - 720 x 576 (preferred colorspace: Mpeg PES)
> The selected video_out device is incompatible with this codec.
> Try appending the scale filter to your filter list,
> e.g. -vf spp,scale instead of -vf spp.
> VDecoder init failed :(
> Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2- 
> v0.4.0b
> Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1 or 2 (libmpeg2))
> ====================================================================== 
> ====
> VDec: vo config request - 720 x 576 (preferred colorspace: Planar  
> YV12)
> VDec: using Planar YV12 as output csp (no 0)
> Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
> SwScaler: reducing / aligning filtersize 11 -> 4
> SwScaler: reducing / aligning filtersize 11 -> 4
> SwScaler: reducing / aligning filtersize 15 -> 8
> SwScaler: reducing / aligning filtersize 15 -> 8
> [swscaler @ 0x600818]SwScaler: Gaussian scaler, from yuv420p to  
> yuv420p using AltiVec
> [swscaler @ 0x600818]SwScaler: using C scaler for horizontal scaling
> [swscaler @ 0x600818]SwScaler: using n-tap C scaler for vertical  
> scaling (YV12 like)
> [swscaler @ 0x600818]SwScaler: 720x576 -> 624x352
> x264 [info]: using SAR=625/624
> x264 [info]: using cpu capabilities: Altivec
> Pos: 240.1s   6002f ( 8%)  6.55fps Trem: 174min 292mb  A-V:0.000  
> [819:0]]
> Flushing video frames.
>
> Video stream:  819.957 kbit/s  (102494 B/s)  size: 24606907 bytes   
> 240.080 secs  6002 frames
> x264 [info]: slice I:76    Avg QP:21.93  size: 22602
> x264 [info]: slice P:5924  Avg QP:24.84  size:  3863
> x264 [info]: mb I  I16..4: 28.1%  0.0% 71.9%
> x264 [info]: mb P  I16..4:  5.1%  0.0%  3.4%  P16..4: 30.4% 17.3%   
> 4.8%  0.0%  0.0%    skip:39.1%
> x264 [info]: kb/s:820.1



> mencoder -nosound -of rawvideo -sws 9 -vf scale=624:-10 -ovc x264 - 
> x264encopts crf=23 file.m2v -o file-s9.264 -frames 6000

> MEncoder dev-SVN-r24007-4.0.1 (C) 2000-2007 MPlayer Team
> AltiVec found
> CPU: PowerPC
> 113 audio & 236 video codecs
> success: format: 0  data: 0x0 - 0x448a4ef5
> MPEG-ES file format detected.
> VIDEO:  MPEG2  720x576  (aspect 3)  25.000 fps  7568.0 kbps (946.0  
> kbyte/s)
> [V] filefmt:1  fourcc:0x10000002  size:720x576  fps:25.00   
> ftime:=0.0400
> Opening video filter: [expand osd=1]
> Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
> Opening video filter: [scale w=624 h=-10]
> ====================================================================== 
> ====
> Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
> VDec: vo config request - 720 x 576 (preferred colorspace: Mpeg PES)
> The selected video_out device is incompatible with this codec.
> Try appending the scale filter to your filter list,
> e.g. -vf spp,scale instead of -vf spp.
> VDecoder init failed :(
> Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2- 
> v0.4.0b
> Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1 or 2 (libmpeg2))
> ====================================================================== 
> ====
> VDec: vo config request - 720 x 576 (preferred colorspace: Planar  
> YV12)
> VDec: using Planar YV12 as output csp (no 0)
> Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
> SwScaler: reducing / aligning filtersize 8 -> 8
> SwScaler: reducing / aligning filtersize 8 -> 8
> SwScaler: reducing / aligning filtersize 11 -> 16
> SwScaler: reducing / aligning filtersize 11 -> 16
> [swscaler @ 0x600818]SwScaler: Lanczos scaler, from yuv420p to  
> yuv420p using AltiVec
> [swscaler @ 0x600818]SwScaler: using C scaler for horizontal scaling
> [swscaler @ 0x600818]SwScaler: using n-tap C scaler for vertical  
> scaling (YV12 like)
> [swscaler @ 0x600818]SwScaler: 720x576 -> 624x352
> x264 [info]: using SAR=625/624
> x264 [info]: using cpu capabilities: Altivec
> Pos: 240.1s   6002f ( 8%)  6.21fps Trem: 184min 368mb  A-V:0.000  
> [1032:0]
> Flushing video frames.
>
> Video stream: 1032.965 kbit/s  (129120 B/s)  size: 30999279 bytes   
> 240.080 secs  6002 frames
> x264 [info]: slice I:75    Avg QP:22.41  size: 26649
> x264 [info]: slice P:5925  Avg QP:25.32  size:  4894
> x264 [info]: mb I  I16..4: 28.1%  0.0% 71.9%
> x264 [info]: mb P  I16..4:  4.9%  0.0%  3.5%  P16..4: 30.7% 17.7%   
> 5.6%  0.0%  0.0%    skip:37.6%
> x264 [info]: kb/s:1033.2






More information about the MPlayer-users mailing list