22 #include "libavutil/common.h"
23 #include "libavutil/intreadwrite.h"
24 #include "libavutil/imgutils.h"
68 #define write16(p, value) \
70 if (s->big_endian) AV_WB16(p, value); \
71 else AV_WL16(p, value); \
74 #define write32(p, value) \
76 if (s->big_endian) AV_WB32(p, value); \
77 else AV_WL32(p, value); \
87 for (y = 0; y < avctx->
height; y++) {
88 for (x = 0; x < avctx->
width; x++) {
91 value = ((
AV_RB16(src + 6*x + 4) & 0xFFC0) >> 4)
92 | ((
AV_RB16(src + 6*x + 2) & 0xFFC0) << 6)
93 | ((
AV_RB16(src + 6*x + 0) & 0xFFC0) << 16);
95 value = ((
AV_RL16(src + 6*x + 4) & 0xFFC0) >> 4)
96 | ((
AV_RL16(src + 6*x + 2) & 0xFFC0) << 6)
97 | ((
AV_RL16(src + 6*x + 0) & 0xFFC0) << 16);
107 const AVFrame *frame,
int *got_packet)
113 #define HEADER_SIZE 1664
129 memcpy (buf + 8,
"V1.0", 4);
134 write32(buf + 660, 0xFFFFFFFF);
#define write32(p, value)
This structure describes decoded (raw) audio or video data.
packed RGB 8:8:8, 24bpp, RGBRGB...
int linesize[AV_NUM_DATA_POINTERS]
number of bytes per line
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...
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
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.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
four components are given, that's all.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
static av_cold int encode_close(AVCodecContext *avctx)
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
#define MKBETAG(a, b, c, d)
const char * name
Name of the codec implementation.
#define CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
uint8_t * data[AV_NUM_DATA_POINTERS]
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Libavcodec external API header.
AVPixelFormat
Pixel format.
int flags
A combination of AV_PKT_FLAG values.
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
int ff_alloc_packet(AVPacket *avpkt, int size)
Check AVPacket size and/or allocate data.
#define AV_LOG_INFO
Standard information.
main external API structure.
static void close(AVCodecParserContext *s)
static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, uint8_t *dst)
AVFrame * coded_frame
the picture in the bitstream
common internal api header.
#define write16(p, value)
static av_cold int init(AVCodecParserContext *s)
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
Calculate the size in bytes that a picture of the given width and height would occupy if stored in th...
int key_frame
1 -> keyframe, 0-> not
This structure stores compressed data.