80 if (big_endian)
AV_WB16(p, value);
86 if (big_endian)
AV_WB32(p, value);
90 #define write16(p, value) write16_internal(s->big_endian, p, value)
91 #define write32(p, value) write32_internal(s->big_endian, p, value)
99 for (y = 0; y < avctx->
height; y++) {
100 for (x = 0; x < avctx->
width; x++) {
103 value = ((
AV_RB16(src + 6*x + 4) & 0xFFC0
U) >> 4)
104 | ((
AV_RB16(src + 6*x + 2) & 0xFFC0
U) << 6)
105 | ((
AV_RB16(src + 6*x + 0) & 0xFFC0
U) << 16);
107 value = ((
AV_RL16(src + 6*x + 4) & 0xFFC0
U) >> 4)
108 | ((
AV_RL16(src + 6*x + 2) & 0xFFC0
U) << 6)
109 | ((
AV_RL16(src + 6*x + 0) & 0xFFC0
U) << 16);
124 for (y = 0; y < avctx->
height; y++) {
125 for (x = 0; x < avctx->
width; x++) {
128 value = (
AV_RB16(src[0] + 2*x) << 12)
130 | ((
unsigned)
AV_RB16(src[2] + 2*x) << 22);
132 value = (
AV_RL16(src[0] + 2*x) << 12)
134 | ((
unsigned)
AV_RL16(src[2] + 2*x) << 22);
139 for (i = 0; i < 3; i++)
147 const uint16_t *
src[3] = {(uint16_t*)pic->
data[0],
148 (uint16_t*)pic->
data[1],
149 (uint16_t*)pic->
data[2]};
151 pad = avctx->
width*6;
152 pad = (
FFALIGN(pad, 4) - pad) >> 1;
153 for (y = 0; y < avctx->
height; y++) {
154 for (x = 0; x < avctx->
width; x++) {
157 value[1] =
AV_RB16(src[0] + x) << 4;
158 value[2] =
AV_RB16(src[1] + x) << 4;
159 value[0] =
AV_RB16(src[2] + x) << 4;
161 value[1] =
AV_RL16(src[0] + x) << 4;
162 value[2] =
AV_RL16(src[1] + x) << 4;
163 value[0] =
AV_RL16(src[2] + x) << 4;
165 for (i = 0; i < 3; i++)
168 for (i = 0; i < pad; i++)
170 for (i = 0; i < 3; i++)
179 int size, ret, need_align,
len;
182 #define HEADER_SIZE 1664
187 len = avctx->
width*6;
189 need_align = size -
len;
195 need_align = size -
len;
207 memcpy (buf + 8,
"V1.0", 4);
212 write32(buf + 660, 0xFFFFFFFF);
238 size = (len + need_align) * avctx->
height;
240 memcpy(dst, src, len);
241 memset(dst + len, 0, need_align);
242 dst += len + need_align;
#define write32(p, value)
int linesize[AV_NUM_DATA_POINTERS]
number of bytes per line
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
packed RGB 8:8:8, 24bpp, RGBRGB...
static av_cold int init(AVCodecContext *avctx)
static av_cold int encode_init(AVCodecContext *avctx)
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int avpicture_layout(const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height, unsigned char *dest, int dest_size)
Copy pixel data from an AVPicture into a buffer.
planar GBR 4:4:4 36bpp, little-endian
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
planar GBR 4:4:4 36bpp, big-endian
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
static void encode_gbrp10(AVCodecContext *avctx, const AVPicture *pic, uint8_t *dst)
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
uint8_t * data[AV_NUM_DATA_POINTERS]
pointers to the image data planes
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
static void encode_gbrp12(AVCodecContext *avctx, const AVPicture *pic, uint16_t *dst)
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
uint16_t depth_minus1
Number of bits in the component minus 1.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int flags
AV_CODEC_FLAG_*.
const char * name
Name of the codec implementation.
Libavcodec external API header.
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
int flags
A combination of AV_PKT_FLAG values.
uint8_t nb_components
The number of components each pixel has, (1-4)
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
int width
picture width / height.
GLsizei GLboolean const GLfloat * value
#define AV_LOG_INFO
Standard information.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
planar GBR 4:4:4 30bpp, big-endian
main external API structure.
static av_always_inline void write32_internal(int big_endian, void *p, int value)
static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, uint8_t *dst)
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
Check AVPacket size and/or allocate data.
static enum AVPixelFormat pix_fmts[]
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
common internal and external API header
static av_always_inline void write16_internal(int big_endian, void *p, int value)
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
#define write16(p, value)
#define AV_PIX_FMT_FLAG_BE
Pixel format is big-endian.
#define MKBETAG(a, b, c, d)
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
Y , 16bpp, little-endian.
AVPixelFormat
Pixel format.
This structure stores compressed data.
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
planar GBR 4:4:4 30bpp, little-endian
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...