[encoder] manage sub directory