pnm: add high-bitdepth PGMYUV support for both encoder and decoder