'Setup decoder contexts'

def _decoder(self, rawmode, layer, tile=None):

    args = None
    if ((rawmode == 'RGB') and (self._planar_configuration == 2)):
        rawmode = rawmode[layer]
    compression = self._compression
    if (compression == 'raw'):
        args = (rawmode, 0, 1)
    elif (compression == 'jpeg'):
        args = (rawmode, '')
        if (JPEGTABLES in self.tag_v2):
            (self.tile_prefix,) = self.tag_v2[JPEGTABLES]
    elif (compression == 'packbits'):
        args = rawmode
    elif (compression == 'tiff_lzw'):
        args = rawmode
        if (PREDICTOR in self.tag_v2):
            self.decoderconfig = (self.tag_v2[PREDICTOR],)
    return args
