[FFmpeg-devel] dia, dia_size and the rest

vmrsss vmrsss
Fri Jan 23 16:47:44 CET 2009


Hello.

I have tried to use me_method hex with mpeg2video and got:

> [mpeg2video @ 0x101005800]me_method is only allowed to be set to  
> zero and epzs; for hex,umh,full and others see dia_size

I suppose there are precise rules on which video codecs support which  
motion estimation algorithms. What are they?

I have looked for documentation or exchanges on this list about epzs/ 
dia, there is almost none (except one from 2004). In  
motion_estimation_template.c I found this relevant branching.

>   if(c->dia_size==-1)             ==> funny_diamond_search
>   else if(c->dia_size<-1)       ==> sab_diamond_search
>   else if(c->dia_size<2)        ==> small_diamond_search
>   else if(c->dia_size>1024) ==> full_search
>   else if(c->dia_size>768)    ==> umh_search
>   else if(c->dia_size>512)    ==> hex_search
>   else if(c->dia_size>256)    ==> l2s_dia_search
>   else                                        ==> var_diamond_search

Can anybody explain schematically the differences between the  
"funny_", "sab_", "ls2_" and "var_" algorithms are and how the values  
of dia_size affect them?

A few more questions: with abs( dia_size ) > 4 I get

> [mpeg2video @ 0x101005800]ME_MAP size may be a little small for the  
> selected diamond size

Is this something to worry about? ME_MAP is the constant 64 (so this  
is not easily dealt with from the command line). In fact,

with -dia_size -65

> mpeg2video @ 0x101005800]ME_MAP size is too small for SAB diamond
> Video encoding failed

Also, with -dia_size 7 and -cmp satd (as well as with other  
combinations) I get:

> [mpeg2video @ 0x101005800]ME_MAP size may be a little small for the  
> selected diamond size
> Assertion failed: (map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] ==  
> key), function hpel_motion_search, file libavcodec/ 
> motion_est_template.c, line 168.
> Abort trap


Is this something to worry about? Below is my full ouput.

Thanks.

> ffmpeg -i test.mp4 -an -vcodec mpeg2video -me_method epzs -dia_size  
> 7 -cmp satd test.m2v
> FFmpeg version SVN-r16719, Copyright (c) 2000-2009 Fabrice Bellard,  
> et al.
>  configuration: --arch=x86_64 --cpu=core2 --cc=gcc-4.2 -arch x86_64  
> --disable-shared --enable-nonfree --disable-vhook --disable-ffserver  
> --disable-gprof --disable-debug --enable-gpl --enable-libx264 -- 
> enable-libxvid --enable-libdirac --enable-libschroedinger --enable- 
> libfaac --enable-libmp3lame --enable-pthreads --enable-swscale -- 
> enable-postproc
>  libavutil     49.14. 0 / 49.14. 0
>  libavcodec    52.11. 0 / 52.11. 0
>  libavformat   52.25. 0 / 52.25. 0
>  libavdevice   52. 1. 0 / 52. 1. 0
>  libswscale     0. 6. 1 /  0. 6. 1
>  libpostproc   51. 2. 0 / 51. 2. 0
>  built on Jan 22 2009 13:17:49, gcc: 4.2.1 (Apple Inc. build 5566)
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
>  Duration: 00:21:44.36, start: 0.000000, bitrate: 516 kb/s
>    Stream #0.0(eng): Video: h264, yuv420p, 480x272, 25.00 tb(r)
>    Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16
> Output #0, mpeg2video, to 'test.m2v':
>    Stream #0.0(eng): Video: mpeg2video, yuv420p, 480x272, q=2-31,  
> 200 kb/s, 25.00 tb(c)
> Stream mapping:
>  Stream #0.0 -> #0.0
> Press [q] to stop encoding
> [mpeg2video @ 0x101005800]ME_MAP size may be a little small for the  
> selected diamond size
> Assertion failed: (map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] ==  
> key), function hpel_motion_search, file libavcodec/ 
> motion_est_template.c, line 168.
>




More information about the ffmpeg-devel mailing list