Handle 4:4:0 (transposed 4:2:2 subsampling)

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@503 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2011-03-04 13:04:24 +00:00
parent a3f68b4d2a
commit d0a813632b
2 changed files with 33 additions and 12 deletions

View File

@@ -37,11 +37,32 @@ final public class TJ {
// Chrominance subsampling options
final public static int
NUMSAMPOPT = 4,
NUMSAMPOPT = 5,
SAMP_444 = 0,
SAMP_422 = 1,
SAMP_420 = 2,
SAMP_GRAY = 3;
SAMP_GRAY = 3,
SAMP_440 = 4;
final private static int mcuWidth[] = {
8, 16, 16, 8, 8
};
public static int getMCUWidth(int subsamp) throws Exception {
if(subsamp < 0 || subsamp >= NUMSAMPOPT)
throw new Exception("Invalid subsampling type");
return mcuWidth[subsamp];
}
final private static int mcuHeight[] = {
8, 8, 16, 8, 16
};
public static int getMCUHeight(int subsamp) throws Exception {
if(subsamp < 0 || subsamp >= NUMSAMPOPT)
throw new Exception("Invalid subsampling type");
return mcuHeight[subsamp];
}
// Bitmap pixel formats
final public static int