64 #define write16(p, value) \
66 if (s->big_endian) AV_WB16(p, value); \
67 else AV_WL16(p, value); \
70 #define write32(p, value) \
72 if (s->big_endian) AV_WB32(p, value); \
73 else AV_WL32(p, value); \
80 const uint8_t *src = pic->
data[0];
83 for (y = 0; y < avctx->
height; y++) {
84 for (x = 0; x < avctx->
width; x++) {
87 value = ((
AV_RB16(src + 6*x + 4) & 0xFFC0) >> 4)
88 | ((
AV_RB16(src + 6*x + 2) & 0xFFC0) << 6)
89 | ((
AV_RB16(src + 6*x + 0) & 0xFFC0) << 16);
91 value = ((
AV_RL16(src + 6*x + 4) & 0xFFC0) >> 4)
92 | ((
AV_RL16(src + 6*x + 2) & 0xFFC0) << 6)
93 | ((
AV_RL16(src + 6*x + 0) & 0xFFC0) << 16);
103 int buf_size,
void *
data)
108 #define HEADER_SIZE 1664
117 memcpy (buf + 8,
"V1.0", 4);
121 write32(buf + 660, 0xFFFFFFFF);
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
#define write32(p, value)
AV_WL32 AV_WL24 AV_WL16 AV_WB32 AV_WB24 AV_RB16
int linesize[AV_NUM_DATA_POINTERS]
number of bytes per line
AVFrame * coded_frame
the picture in the bitstream
struct DPXContext DPXContext
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...
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
four components are given, that's all.
uint8_t * data[AV_NUM_DATA_POINTERS]
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
static int init(AVCodecParserContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
int width
picture width / height.
main external API structure.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, uint8_t *dst)
static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data)
#define write16(p, value)
#define MKBETAG(a, b, c, d)
packed RGB 8:8:8, 24bpp, RGBRGB...
int key_frame
1 -> keyframe, 0-> not
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
int avpicture_layout(const AVPicture *src, enum PixelFormat pix_fmt, int width, int height, unsigned char *dest, int dest_size)
Copy pixel data from an AVPicture into a buffer.