Commit c1c00e6c authored by Loren Merritt's avatar Loren Merritt
Browse files

fix an arithmetic overflow that disabled SEA threshold after finding a mv with SAD < mvcost.

parent 1c72e719
...@@ -498,7 +498,7 @@ me_hex2: ...@@ -498,7 +498,7 @@ me_hex2:
int ycost = p_cost_mvy[my<<2]; int ycost = p_cost_mvy[my<<2];
bsad -= ycost; bsad -= ycost;
xn = h->pixf.ads[i_pixel]( enc_dc, sums_base + min_x + my * stride, delta, xn = h->pixf.ads[i_pixel]( enc_dc, sums_base + min_x + my * stride, delta,
cost_fpel_mvx+min_x, xs, width, bsad*17/16 ); cost_fpel_mvx+min_x, xs, width, X264_MAX(bsad,0)*17/16 );
for( i=0; i<xn-2; i+=3 ) for( i=0; i<xn-2; i+=3 )
{ {
uint8_t *ref = p_fref+min_x+my*stride; uint8_t *ref = p_fref+min_x+my*stride;
...@@ -569,7 +569,7 @@ me_hex2: ...@@ -569,7 +569,7 @@ me_hex2:
{ {
bcost -= p_cost_mvy[my<<2]; bcost -= p_cost_mvy[my<<2];
xn = h->pixf.ads[i_pixel]( enc_dc, sums_base + min_x + my * stride, delta, xn = h->pixf.ads[i_pixel]( enc_dc, sums_base + min_x + my * stride, delta,
cost_fpel_mvx+min_x, xs, width, bcost ); cost_fpel_mvx+min_x, xs, width, X264_MAX(bcost,0) );
for( i=0; i<xn-2; i+=3 ) for( i=0; i<xn-2; i+=3 )
COST_MV_X3_ABS( min_x+xs[i],my, min_x+xs[i+1],my, min_x+xs[i+2],my ); COST_MV_X3_ABS( min_x+xs[i],my, min_x+xs[i+1],my, min_x+xs[i+2],my );
bcost += p_cost_mvy[my<<2]; bcost += p_cost_mvy[my<<2];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment