[Ffmpeg-devel] Motion Estimation in snow.c for Waevelet encoded frames (DWT)

Aniket Joshi aniketj
Fri Mar 30 18:05:55 CEST 2007


Hi,

I am trying to implement a new motion estimation algorithm for wavelet
encoded frames (DWT). The command I use for encoding the raw file is:
ffmpeg -t 60 -s 176x144 -i formulaone_64kbps_5fps.yuv -f rawvideo -pix_fmt
yuv420p -strict -2 -vcodec snow -b 600 -an -f mp4 play.mp4.

I have some queries about the motion search part:


   - Could you please tell me what exactly the cmp function defined at
   line 106 of motion_est.c does? Does it compare two macroblocks? -
   http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/motion__est_8c-source.html#l00106<http://cekirdek.pardus.org.tr/%7Eismail/ffmpeg-docs/motion__est_8c-source.html#l00106>


   - What does the " int best[2]={0, 0};" variable in function
   epzs_motion_search_internal (line 994 in motion_est_template.c) do? I see
   that it gets passed as argument to the diamond_search function which inturn
   passes it into small_diamond_search. I know best[0] stands for x-coordinate
   & best[1] for y, but these are coordinates of what? -
   http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/motion__est__template_8c-source.html#l00994<http://cekirdek.pardus.org.tr/%7Eismail/ffmpeg-docs/motion__est__template_8c-source.html#l00994>
   - In the same above function, what does the 'dmin' variable stand for?

   - In the same function, what does the 'penalty_factor' variable stand
   for? The penalty_factor & pre_penalty factor are declared in the
   MotionEstContext structure, but there's no explanation as to what do they
   mean? - http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/structMotionEstContext.html

   <http://cekirdek.pardus.org.tr/%7Eismail/ffmpeg-docs/structMotionEstContext.html>
   - What does the P[10][2] argument that is passed to the same function
   stand for? P[10][2] is first defined in encode_q_branch function in
   snow.c & then passed to the ff_epzs_motion_search function.
   - What does the varialble 'dia_size' used in the diamond_search
   function (defined on line 974 in mostion_est_template) stand for? Does it
   refer to the step-size required for the diamond search? Also, where is this
   value set?
   - In small_diamond_search, where is the actual difference between
   reference and current frame calculated? The ref_index & src_index values are
   always zero here.

It would be a big help if anyone could help me with these questions.

Thanks,

Aniket.




More information about the ffmpeg-devel mailing list