Fix ticket #116 on encoder crashes when AFFINE_MRG_MAX_NUM_CANDS is set to less than 5. Using constants AFFINE_MRG_MAX_NUM_CANDS and MRG_MAX_NUM_CANDS instead of fixed numbers in encoder checking. Regular merge has the same issue.