Go to the documentation of this file.
   34     const uint8_t *buf       = avpkt->
data;
 
   35     const uint8_t *buf_end   = avpkt->
data + avpkt->
size;
 
   36     unsigned int w, 
h, depth, 
type, maptype, maplength, x, y, 
len, alen;
 
   38     uint8_t *ptr, *ptr2 = 
NULL;
 
   39     const uint8_t *bufstart = buf;
 
   80     if (maplength > 768) {
 
  116     len  = (depth * 
w + 7) >> 3;
 
  123     if (buf_end - buf < (uint64_t)maplength + (
len * 
h) * 3 / 256)
 
  131     if (depth > 8 && maplength) {
 
  132         av_log(avctx, 
AV_LOG_WARNING, 
"useless colormap found or file is corrupted, trying to recover\n");
 
  134     } 
else if (maplength) {
 
  135         unsigned int len = maplength / 3;
 
  143         for (x = 0; x < 
len; x++, ptr += 4)
 
  144             *(uint32_t *)ptr = (0xFF
U<<24) + (buf[x]<<16) + (buf[
len+x]<<8) + buf[
len+
len+x];
 
  149     if (maplength && depth < 8) {
 
  153         stride = (
w + 15 >> 3) * depth;
 
  161         uint8_t *end = ptr + (ptrdiff_t)
h * 
stride;
 
  164         while (ptr != end && buf < buf_end) {
 
  166             if (buf_end - buf < 1) {
 
  188         for (y = 0; y < 
h; y++) {
 
  189             if (buf_end - buf < alen)
 
  191             memcpy(ptr, buf, 
len);
 
  197         uint8_t *ptr_free = ptr2;
 
  199         for (y=0; y<
h; y++) {
 
  200             for (x = 0; x < (
w + 7 >> 3) * depth; x++) {
 
  202                     ptr[8*x]   = ptr2[x] >> 7;
 
  203                     ptr[8*x+1] = ptr2[x] >> 6 & 1;
 
  204                     ptr[8*x+2] = ptr2[x] >> 5 & 1;
 
  205                     ptr[8*x+3] = ptr2[x] >> 4 & 1;
 
  206                     ptr[8*x+4] = ptr2[x] >> 3 & 1;
 
  207                     ptr[8*x+5] = ptr2[x] >> 2 & 1;
 
  208                     ptr[8*x+6] = ptr2[x] >> 1 & 1;
 
  209                     ptr[8*x+7] = ptr2[x]      & 1;
 
  211                     ptr[2*x]   = ptr2[x] >> 4;
 
  212                     ptr[2*x+1] = ptr2[x] & 0xF;
 
  215             ptr  += 
p->linesize[0];
 
  216             ptr2 += (
w + 15 >> 3) * depth;
 
  223     return buf - bufstart;
 
  
#define AV_LOG_WARNING
Something somehow does not look correct.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int sunrast_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
This structure describes decoded (raw) audio or video data.
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
#define RMT_RAW
the data layout of this map type is unknown
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
AVCodec p
The public AVCodec.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_CODEC_DECODE_CB(func)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
const FFCodec ff_sunrast_decoder
#define CODEC_LONG_NAME(str)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
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_RB32
#define av_malloc_array(a, b)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
@ AV_PIX_FMT_0BGR
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
main external API structure.
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
#define avpriv_request_sample(...)
This structure stores compressed data.
@ AV_PIX_FMT_0RGB
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
#define AVERROR_INVALIDDATA
Invalid data found when processing input.