Dynamic bifurcation of the periodic swift-Hohenberg equation