22 #include "libavutil/common.h"
23 #include "libavutil/intreadwrite.h"
24 #include "libavutil/imgutils.h"
33 unsigned int offset, w, h, y,
stride, bytes_per_pixel;
37 if (buf_end - buf < 14)
42 bytes_per_pixel =
AV_RL16(buf+12) >> 3;
44 if (bytes_per_pixel != 2) {
51 if (buf_end - buf < offset)
71 for (y = 0; y < h && buf_end - buf >= w * bytes_per_pixel; y++) {
74 for (x=0; x<w*bytes_per_pixel; x+=bytes_per_pixel)
77 memcpy(ptr, buf, w*bytes_per_pixel);
80 buf += w*bytes_per_pixel;
90 return offset + w*h*bytes_per_pixel;
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
#define AV_LOG_WARNING
Something somehow does not look correct.
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.
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.
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
const char * name
Name of the codec implementation.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#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. ...
Libavcodec external API header.
static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
enum AVPictureType pict_type
Picture type of the frame.
#define AVERROR_PATCHWELCOME
Not yet implemented in Libav, patches welcome.
#define AV_PIX_FMT_RGB555
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
common internal api header.
This structure stores compressed data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.