beginning dc encoding part