30 #include "libavutil/buffer.h"
31 #include "libavutil/common.h"
32 #include "libavutil/intreadwrite.h"
33 #include "libavutil/imgutils.h"
72 if (tags->
fourcc == fourcc)
144 int buf_size = avpkt->
size;
175 for (i = 0; 2 * i + 1 < buf_size; i++) {
176 dst[2 * i + 0] = buf[i] >> 4;
177 dst[2 * i + 1] = buf[i] & 15;
180 for (i = 0; 4 * i + 3 < buf_size; i++) {
181 dst[4 * i + 0] = buf[i] >> 6;
182 dst[4 * i + 1] = buf[i] >> 4 & 3;
183 dst[4 * i + 2] = buf[i] >> 2 & 3;
184 dst[4 * i + 3] = buf[i] & 3;
188 }
else if (need_copy) {
210 memcpy(context->
palette->
data, pal, AVPALETTE_SIZE);
227 flip(avctx, picture);
239 for (y = 0; y < avctx->
height; y++) {
240 for (x = 0; x < avctx->
width; x++)
241 line[2 * x + 1] ^= 0x80;
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
This structure describes decoded (raw) audio or video data.
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
AVCodec ff_rawvideo_decoder
int avpicture_fill(AVPicture *picture, uint8_t *ptr, enum AVPixelFormat pix_fmt, int width, int height)
Fill in the AVPicture fields.
packed RGB 8:8:8, 24bpp, RGBRGB...
int linesize[AV_NUM_DATA_POINTERS]
number of bytes per line
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
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.
static enum AVPixelFormat find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc)
four components are given, that's all.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt)
int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
Set various frame properties from the codec context / packet data.
const PixelFormatTag ff_raw_pix_fmt_tags[]
const char * name
Name of the codec implementation.
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
static const PixelFormatTag pix_fmt_bps_avi[]
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 ...
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
uint8_t * data[AV_NUM_DATA_POINTERS]
#define AV_PIX_FMT_FLAG_PSEUDOPAL
The pixel format is "pseudo-paletted".
static const uint8_t frame_size[4]
#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. ...
static const PixelFormatTag pix_fmt_bps_mov[]
Libavcodec external API header.
AVPixelFormat
Pixel format.
enum AVPictureType pict_type
Picture type of the frame.
uint8_t * data
The data buffer.
uint8_t * av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
int width
picture width / height.
static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
8 bit with PIX_FMT_RGB32 palette
AVBufferRef * av_buffer_alloc(int size)
Allocate an AVBuffer of the given size using av_malloc().
#define AV_PIX_FMT_RGB555
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
main external API structure.
static void close(AVCodecParserContext *s)
packed RGB 8:8:8, 24bpp, BGRBGR...
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
static av_cold int raw_close_decoder(AVCodecContext *avctx)
#define AV_PIX_FMT_RGB444
int palette_has_changed
Tell user application that palette has changed from previous frame.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
#define MKTAG(a, b, c, d)
A reference to a data buffer.
#define FFSWAP(type, a, b)
common internal api header.
static void flip(AVCodecContext *avctx, AVPicture *picture)
static av_cold int raw_init_decoder(AVCodecContext *avctx)
static av_cold int init(AVCodecParserContext *s)
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
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.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.