diff options
Diffstat (limited to 'libmpcodecs/img_format.h')
-rw-r--r-- | libmpcodecs/img_format.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/libmpcodecs/img_format.h b/libmpcodecs/img_format.h index 4c917b01e4..6bab56632d 100644 --- a/libmpcodecs/img_format.h +++ b/libmpcodecs/img_format.h @@ -71,8 +71,33 @@ #define IMGFMT_444P 0x50343434 #define IMGFMT_422P 0x50323234 #define IMGFMT_411P 0x50313134 +#define IMGFMT_440P 0x50303434 #define IMGFMT_HM12 0x32314D48 +// 4:2:0 planar with alpha +#define IMGFMT_420A 0x41303234 + +#define IMGFMT_444P16_LE 0x51343434 +#define IMGFMT_444P16_BE 0x34343451 +#define IMGFMT_422P16_LE 0x51323234 +#define IMGFMT_422P16_BE 0x34323251 +#define IMGFMT_420P16_LE 0x51303234 +#define IMGFMT_420P16_BE 0x34323051 +#if HAVE_BIGENDIAN +#define IMGFMT_444P16 IMGFMT_444P16_BE +#define IMGFMT_422P16 IMGFMT_422P16_BE +#define IMGFMT_420P16 IMGFMT_420P16_BE +#else +#define IMGFMT_444P16 IMGFMT_444P16_LE +#define IMGFMT_422P16 IMGFMT_422P16_LE +#define IMGFMT_420P16 IMGFMT_420P16_LE +#endif + +#define IMGFMT_IS_YUVP16_LE(fmt) (((fmt ^ IMGFMT_420P16_LE) & 0xff0000ff) == 0) +#define IMGFMT_IS_YUVP16_BE(fmt) (((fmt ^ IMGFMT_420P16_BE) & 0xff0000ff) == 0) +#define IMGFMT_IS_YUVP16_NE(fmt) (((fmt ^ IMGFMT_420P16 ) & 0xff0000ff) == 0) +#define IMGFMT_IS_YUVP16(fmt) (IMGFMT_IS_YUVP16_LE(fmt) || IMGFMT_IS_YUVP16_BE(fmt)) + /* Packed YUV Formats */ #define IMGFMT_IUYV 0x56595549 @@ -133,4 +158,11 @@ typedef struct { const char *vo_format_name(int format); +/** + * Calculates the scale shifts for the chroma planes for planar YUV + * + * \return bits-per-pixel for format if successful (i.e. format is 3 or 4-planes planar YUV), 0 otherwise + */ +int mp_get_chroma_shift(int format, int *x_shift, int *y_shift); + #endif /* MPLAYER_IMG_FORMAT_H */ |