[x264-devel] "mv cost test failed; x264 has been miscompiled" problem

Jason Garrett-Glaser darkshikari at gmail.com
Fri Jan 29 07:03:41 CET 2010


On Thu, Jan 28, 2010 at 9:57 PM, Kevin.Liu <kevin.liu at innosofts.com> wrote:
> Hi all,
>
>   I have embedded the x264 library (2008-01-26) to ffmpeg (2008-01-28) and

I doubt these are the actual dates of the packages--as the errors you
noted did not exist at the time.

> migrated to wince (armv4i),but I can not open the x264 coder with the error
> “broken ffmpeg default setting detected”. I found the error message in the
> file “encoder.c “ of x264.
>
>
>
>     /* Detect default ffmpeg settings and terminate with an error. */
>
>     {
>
>         int score = 0;
>
>         score += h->param.analyse.i_me_range == 0;
>
>         score += h->param.rc.i_qp_step == 3;
>
>         score += h->param.i_keyint_max == 12;
>
>         score += h->param.rc.i_qp_min == 2;
>
>         score += h->param.rc.i_qp_max == 31;
>
>         score += h->param.rc.f_qcompress == 0.5;
>
>         score += fabs(h->param.rc.f_ip_factor - 1.25) < 0.01;
>
>         score += fabs(h->param.rc.f_pb_factor - 1.25) < 0.01;
>
>         score += h->param.analyse.inter == 0 &&
> h->param.analyse.i_subpel_refine == 8;
>
>         if( score >= 5 )
>
>         {
>
>             x264_log( h, X264_LOG_ERROR, "broken ffmpeg default settings
> detected\n" );
>
>             x264_log( h, X264_LOG_ERROR, "use an encoding preset (vpre)\n"
> );
>
>             return -1;
>
>         }
>
> }
>
>
>
> it seems that some param were not set correctly with ffmpeg default setting
> . So I changed the params to this which is included in the ffmpeg-preset
> file:
>
>
>
> h->param.analyse.i_me_range == 16;
>
>         h->param.rc.i_qp_step == 4;
>
>         h->param.i_keyint_max == 10;
>
>         h->param.rc.i_qp_min == 10;
>
>         h->param.rc.i_qp_max == 51;
>
>         h->param.rc.f_qcompress == 0.6;
>
>         h->param.rc.f_ip_factor=1/0.71;
>
>
>
>      and the error has gone

That's not what you're supposed to do.  You're supposed to copy
_everything_ in the preset file of your choice (normal, default, or
hq, in order of faster to slower).  The heuristic in x264 exists
solely to warn you when you forgot to do that.


 ,but another error came out “mv cost test
> failed; x264 has been miscompiled”. The error is also in function ‘
> x264_encoder_open ‘ the file “encoder.c”
>
>
>
>  if( h->cost_mv[1][2013] != 24 )
>
>     {
>
>         x264_log( h, X264_LOG_ERROR, "MV cost test failed: x264 has been
> miscompiled!\n" );
>
>         goto fail;
>
>     }
>
> I am not familiar with the h264 encode , so I do not what should I do next.
> Is this show that my params are wrong again or something also ?

However you have built and linked x264, it has been miscompiled and,
if not for that check, would generate invalid output.

Try disabling -ffast-math.

Dark Shikari


More information about the x264-devel mailing list