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) 100 for (y = 0; y < avctx->
height; y++) {
101 for (x = 0; x < avctx->
width; x++) {
104 value = ((
AV_RB16(src + 6*x + 4) & 0xFFC0
U) >> 4)
105 | ((
AV_RB16(src + 6*x + 2) & 0xFFC0
U) << 6)
106 | ((
AV_RB16(src + 6*x + 0) & 0xFFC0
U) << 16);
108 value = ((
AV_RL16(src + 6*x + 4) & 0xFFC0
U) >> 4)
109 | ((
AV_RL16(src + 6*x + 2) & 0xFFC0
U) << 6)
110 | ((
AV_RL16(src + 6*x + 0) & 0xFFC0
U) << 16);
125 for (y = 0; y < avctx->
height; y++) {
126 for (x = 0; x < avctx->
width; x++) {
129 value = (
AV_RB16(src[0] + 2*x) << 12)
131 | ((
unsigned)
AV_RB16(src[2] + 2*x) << 22);
133 value = (
AV_RL16(src[0] + 2*x) << 12)
135 | ((
unsigned)
AV_RL16(src[2] + 2*x) << 22);
140 for (i = 0; i < 3; i++)
148 const uint16_t *
src[3] = {(uint16_t*)pic->
data[0],
149 (uint16_t*)pic->
data[1],
150 (uint16_t*)pic->
data[2]};
152 pad = avctx->
width*6;
153 pad = (
FFALIGN(pad, 4) - pad) >> 1;
154 for (y = 0; y < avctx->
height; y++) {
155 for (x = 0; x < avctx->
width; x++) {
158 value[1] =
AV_RB16(src[0] + x) << 4;
159 value[2] =
AV_RB16(src[1] + x) << 4;
160 value[0] =
AV_RB16(src[2] + x) << 4;
162 value[1] =
AV_RL16(src[0] + x) << 4;
163 value[2] =
AV_RL16(src[1] + x) << 4;
164 value[0] =
AV_RL16(src[2] + x) << 4;
166 for (i = 0; i < 3; i++)
169 for (i = 0; i < pad; i++)
171 for (i = 0; i < 3; i++)
183 #define HEADER_SIZE 1664 188 len = avctx->
width*6;
190 need_align = size -
len;
196 need_align = size -
len;
208 memcpy (buf + 8,
"V1.0", 4);
213 write32(buf + 660, 0xFFFFFFFF);
239 size = (len + need_align) * avctx->
height;
241 memcpy(dst, src, len);
242 memset(dst + len, 0, need_align);
243 dst += len + need_align;
#define write32(p, value)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
int av_image_copy_to_buffer(uint8_t *dst, int dst_size, const uint8_t *const src_data[4], const int src_linesize[4], enum AVPixelFormat pix_fmt, int width, int height, int align)
Copy image data from an image into a buffer.
static void encode_rgb48_10bit(AVCodecContext *avctx, const AVFrame *pic, uint8_t *dst)
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.
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
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
Check AVPacket size and/or allocate data.
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
GLsizei GLboolean const GLfloat * value
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#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.
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
int flags
A combination of AV_PKT_FLAG values.
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
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.
static void encode_gbrp12(AVCodecContext *avctx, const AVFrame *pic, uint16_t *dst)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
#define AV_LOG_INFO
Standard information.
Libavcodec external API header.
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_gbrp10(AVCodecContext *avctx, const AVFrame *pic, uint8_t *dst)
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.
int depth
Number of bits in the component.
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...