qdm2: check that coding_method is valid before using it.