Generalized spectral factorization problem for discrete time polynomial matrices via quadratic difference forms