diff options
author | dcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db> | 2013-08-18 10:19:00 +0000 |
---|---|---|
committer | dcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db> | 2013-08-18 10:19:00 +0000 |
commit | 6d7d4a356dd7fa11d11b278e95a0718169455716 (patch) | |
tree | 0aec39fc4c6d8ff5b040b4e501f606e141f8168f /turbojpeg.h | |
parent | a7e7c1e4a250958dd3f023cac32f686b4caee7d9 (diff) |
Add 4:1:1 subsampling support in the TurboJPEG C API
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1014 632fc199-4ca6-4c93-a231-07263d6284db
Diffstat (limited to 'turbojpeg.h')
-rw-r--r-- | turbojpeg.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/turbojpeg.h b/turbojpeg.h index 66be1d8..668a50a 100644 --- a/turbojpeg.h +++ b/turbojpeg.h @@ -49,7 +49,7 @@ /** * The number of chrominance subsampling options */ -#define TJ_NUMSAMP 5 +#define TJ_NUMSAMP 6 /** * Chrominance subsampling options. @@ -87,7 +87,18 @@ enum TJSAMP * chrominance component for every 1x2 block of pixels in the source image. * Note that 4:4:0 subsampling is not fully accelerated in libjpeg-turbo. */ - TJSAMP_440 + TJSAMP_440, + /** + * 4:1:1 chrominance subsampling. The JPEG or YUV image will contain one + * chrominance component for every 4x1 block of pixels in the source image. + * JPEG images compressed with 4:1:1 subsampling will be almost exactly the + * same size as those compressed with 4:2:0 subsampling, and in the + * aggregate, both subsampling methods produce approximately the same + * perceptual quality. However, 4:1:1 is better able to reproduce sharp + * horizontal features. Note that 4:1:1 subsampling is not fully accelerated + * in libjpeg-turbo. + */ + TJSAMP_411 }; /** @@ -96,9 +107,10 @@ enum TJSAMP * - 8x8 for no subsampling or grayscale * - 16x8 for 4:2:2 * - 8x16 for 4:4:0 - * - 16x16 for 4:2:0 + * - 16x16 for 4:2:0 + * - 32x8 for 4:1:1 */ -static const int tjMCUWidth[TJ_NUMSAMP] = {8, 16, 16, 8, 8}; +static const int tjMCUWidth[TJ_NUMSAMP] = {8, 16, 16, 8, 8, 32}; /** * MCU block height (in pixels) for a given level of chrominance subsampling. @@ -106,9 +118,10 @@ static const int tjMCUWidth[TJ_NUMSAMP] = {8, 16, 16, 8, 8}; * - 8x8 for no subsampling or grayscale * - 16x8 for 4:2:2 * - 8x16 for 4:4:0 - * - 16x16 for 4:2:0 + * - 16x16 for 4:2:0 + * - 32x8 for 4:1:1 */ -static const int tjMCUHeight[TJ_NUMSAMP] = {8, 8, 16, 8, 16}; +static const int tjMCUHeight[TJ_NUMSAMP] = {8, 8, 16, 8, 16, 8}; /** |