chromium/third_party/ffmpeg/libavutil/pixfmt.h

/*
 * copyright (c) 2006 Michael Niedermayer <[email protected]>
 *
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with FFmpeg; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#ifndef AVUTIL_PIXFMT_H
#define AVUTIL_PIXFMT_H

/**
 * @file
 * pixel format definitions
 */

#include "libavutil/avconfig.h"
#include "version.h"

#define AVPALETTE_SIZE
#define AVPALETTE_COUNT

/**
 * Maximum number of planes in any pixel format.
 * This should be used when a maximum is needed, but code should not
 * be written to require a maximum for no good reason.
 */
#define AV_VIDEO_MAX_PLANES

/**
 * Pixel format.
 *
 * @note
 * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
 * color is put together as:
 *  (A << 24) | (R << 16) | (G << 8) | B
 * This is stored as BGRA on little-endian CPU architectures and ARGB on
 * big-endian CPUs.
 *
 * @note
 * If the resolution is not a multiple of the chroma subsampling factor
 * then the chroma plane resolution must be rounded up.
 *
 * @par
 * When the pixel format is palettized RGB32 (AV_PIX_FMT_PAL8), the palettized
 * image data is stored in AVFrame.data[0]. The palette is transported in
 * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
 * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is
 * also endian-specific). Note also that the individual RGB32 palette
 * components stored in AVFrame.data[1] should be in the range 0..255.
 * This is important as many custom PAL8 video codecs that were designed
 * to run on the IBM VGA graphics adapter use 6-bit palette components.
 *
 * @par
 * For all the 8 bits per pixel formats, an RGB32 palette is in data[1] like
 * for pal8. This palette is filled in automatically by the function
 * allocating the picture.
 */
enum AVPixelFormat {};

#if AV_HAVE_BIGENDIAN
#define AV_PIX_FMT_NE
#else
#define AV_PIX_FMT_NE(be, le)
#endif

#define AV_PIX_FMT_RGB32
#define AV_PIX_FMT_RGB32_1
#define AV_PIX_FMT_BGR32
#define AV_PIX_FMT_BGR32_1
#define AV_PIX_FMT_0RGB32
#define AV_PIX_FMT_0BGR32

#define AV_PIX_FMT_GRAY9
#define AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GRAY14
#define AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_YA16
#define AV_PIX_FMT_RGB48
#define AV_PIX_FMT_RGB565
#define AV_PIX_FMT_RGB555
#define AV_PIX_FMT_RGB444
#define AV_PIX_FMT_RGBA64
#define AV_PIX_FMT_BGR48
#define AV_PIX_FMT_BGR565
#define AV_PIX_FMT_BGR555
#define AV_PIX_FMT_BGR444
#define AV_PIX_FMT_BGRA64

#define AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV440P10
#define AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV420P14
#define AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_YUV444P16

#define AV_PIX_FMT_GBRP9
#define AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_GBRP14
#define AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_GBRAP14
#define AV_PIX_FMT_GBRAP16

#define AV_PIX_FMT_BAYER_BGGR16
#define AV_PIX_FMT_BAYER_RGGB16
#define AV_PIX_FMT_BAYER_GBRG16
#define AV_PIX_FMT_BAYER_GRBG16

#define AV_PIX_FMT_GBRPF32
#define AV_PIX_FMT_GBRAPF32

#define AV_PIX_FMT_GRAYF32

#define AV_PIX_FMT_YUVA420P9
#define AV_PIX_FMT_YUVA422P9
#define AV_PIX_FMT_YUVA444P9
#define AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUVA422P10
#define AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUVA422P12
#define AV_PIX_FMT_YUVA444P12
#define AV_PIX_FMT_YUVA420P16
#define AV_PIX_FMT_YUVA422P16
#define AV_PIX_FMT_YUVA444P16

#define AV_PIX_FMT_XYZ12
#define AV_PIX_FMT_NV20
#define AV_PIX_FMT_AYUV64
#define AV_PIX_FMT_P010
#define AV_PIX_FMT_P012
#define AV_PIX_FMT_P016

#define AV_PIX_FMT_Y210
#define AV_PIX_FMT_Y212
#define AV_PIX_FMT_XV30
#define AV_PIX_FMT_XV36
#define AV_PIX_FMT_X2RGB10
#define AV_PIX_FMT_X2BGR10

#define AV_PIX_FMT_P210
#define AV_PIX_FMT_P410
#define AV_PIX_FMT_P212
#define AV_PIX_FMT_P412
#define AV_PIX_FMT_P216
#define AV_PIX_FMT_P416

#define AV_PIX_FMT_RGBAF16

#define AV_PIX_FMT_RGBF32
#define AV_PIX_FMT_RGBAF32

/**
  * Chromaticity coordinates of the source primaries.
  * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.1 and ITU-T H.273.
  */
enum AVColorPrimaries {};

/**
 * Color Transfer Characteristic.
 * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.2.
 */
enum AVColorTransferCharacteristic {};

/**
 * YUV colorspace type.
 * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.3.
 */
enum AVColorSpace {};

/**
 * Visual content value range.
 *
 * These values are based on definitions that can be found in multiple
 * specifications, such as ITU-T BT.709 (3.4 - Quantization of RGB, luminance
 * and colour-difference signals), ITU-T BT.2020 (Table 5 - Digital
 * Representation) as well as ITU-T BT.2100 (Table 9 - Digital 10- and 12-bit
 * integer representation). At the time of writing, the BT.2100 one is
 * recommended, as it also defines the full range representation.
 *
 * Common definitions:
 *   - For RGB and luma planes such as Y in YCbCr and I in ICtCp,
 *     'E' is the original value in range of 0.0 to 1.0.
 *   - For chroma planes such as Cb,Cr and Ct,Cp, 'E' is the original
 *     value in range of -0.5 to 0.5.
 *   - 'n' is the output bit depth.
 *   - For additional definitions such as rounding and clipping to valid n
 *     bit unsigned integer range, please refer to BT.2100 (Table 9).
 */
enum AVColorRange {};

/**
 * Location of chroma samples.
 *
 * Illustration showing the location of the first (top left) chroma sample of the
 * image, the left shows only luma, the right
 * shows the location of the chroma sample, the 2 could be imagined to overlay
 * each other but are drawn separately due to limitations of ASCII
 *
 *                1st 2nd       1st 2nd horizontal luma sample positions
 *                 v   v         v   v
 *                 ______        ______
 *1st luma line > |X   X ...    |3 4 X ...     X are luma samples,
 *                |             |1 2           1-6 are possible chroma positions
 *2nd luma line > |X   X ...    |5 6 X ...     0 is undefined/unknown position
 */
enum AVChromaLocation {};

#endif /* AVUTIL_PIXFMT_H */