* @param pic SubPicture object containing info about the caption
* @param pal base palette
* @return decoded palette
*/
public static Palette decodePalette(SubPictureDVD pic, Palette pal) {
Palette miniPal = new Palette(4, true);
for (int i=0; i < 4; i++) {
int a = (pic.getAlpha()[i] * 0xff) / 0xf;
if (a >= configuration.getAlphaCrop()) {
miniPal.setRGB(i, pal.getR()[pic.getPal()[i]]&0xff, pal.getG()[pic.getPal()[i]]&0xff, pal.getB()[pic.getPal()[i]]&0xff);
miniPal.setAlpha(i, a);
} else {
miniPal.setARGB(i, 0);
}
}
return miniPal;
}