function [nflag] = fir_wm_test(half_sum,org_h)
new_DEh = 2 * org_h;
new_1DEh = new_DEh + 1;
if (half_sum <= 255) & (half_sum >= 128)  
    if (abs(new_DEh) <= 2*(255-half_sum)) & (abs(new_1DEh) <= 2*(255-half_sum))
        nflag = -1;
    else
        half_DEh = floor(org_h/2);        
        [nflag] = Wm_test(half_sum,org_h);
    end
elseif (half_sum <= 127) & (half_sum >= 0)  
    if (abs(new_DEh) <= (2*half_sum+1)) & (abs(new_1DEh) <= (2*half_sum+1))
        nflag = -1;
    else
        half_DEh = floor(org_h/2);   
        [nflag] = Wm_test(half_sum,org_h);
    end
end