78 #define write16(p, value) \
80 if (s->big_endian) AV_WB16(p, value); \
81 else AV_WL16(p, value); \
84 #define write32(p, value) \
86 if (s->big_endian) AV_WB32(p, value); \
87 else AV_WL32(p, value); \
96 for (y = 0; y < avctx->
height; y++) {
97 for (x = 0; x < avctx->
width; x++) {
100 value = ((
AV_RB16(src + 6*x + 4) & 0xFFC0
U) >> 4)
101 | ((
AV_RB16(src + 6*x + 2) & 0xFFC0
U) << 6)
102 | ((
AV_RB16(src + 6*x + 0) & 0xFFC0
U) << 16);
104 value = ((
AV_RL16(src + 6*x + 4) & 0xFFC0
U) >> 4)
105 | ((
AV_RL16(src + 6*x + 2) & 0xFFC0
U) << 6)
106 | ((
AV_RL16(src + 6*x + 0) & 0xFFC0
U) << 16);
121 for (y = 0; y < avctx->
height; y++) {
122 for (x = 0; x < avctx->
width; x++) {
125 value = (
AV_RB16(src[0] + 2*x) << 12)
127 | ((
unsigned)
AV_RB16(src[2] + 2*x) << 22);
129 value = (
AV_RL16(src[0] + 2*x) << 12)
131 | ((
unsigned)
AV_RL16(src[2] + 2*x) << 22);
136 for (i = 0; i < 3; i++)
144 const uint16_t *
src[3] = {(uint16_t*)pic->
data[0],
145 (uint16_t*)pic->
data[1],
146 (uint16_t*)pic->
data[2]};
148 pad = avctx->
width*6;
149 pad = (
FFALIGN(pad, 4) - pad) >> 1;
150 for (y = 0; y < avctx->
height; y++) {
151 for (x = 0; x < avctx->
width; x++) {
154 value[1] =
AV_RB16(src[0] + x) << 4;
155 value[2] =
AV_RB16(src[1] + x) << 4;
156 value[0] =
AV_RB16(src[2] + x) << 4;
158 value[1] =
AV_RL16(src[0] + x) << 4;
159 value[2] =
AV_RL16(src[1] + x) << 4;
160 value[0] =
AV_RL16(src[2] + x) << 4;
162 for (i = 0; i < 3; i++)
165 for (i = 0; i < pad; i++)
167 for (i = 0; i < 3; i++)
179 #define HEADER_SIZE 1664
184 len = avctx->
width*6;
186 need_align = size -
len;
192 need_align = size -
len;
204 memcpy (buf + 8,
"V1.0", 4);
209 write32(buf + 660, 0xFFFFFFFF);
235 size = (len + need_align) * avctx->
height;
237 memcpy(dst, src, len);
238 memset(dst + len, 0, need_align);
239 dst += len + need_align;
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
Check AVPacket size and/or allocate data.
#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 CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
#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. ...
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)
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 void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, uint8_t *dst)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
common internal and external API header
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...