83 int buf_size = avpkt->
size;
84 int y,
ret, true_height;
89 true_height = buf_size / (2*avctx->
width);
103 for(y = 0; y < avctx->
height-1; y+=2) {
106 buf += 2*avctx->
width;
109 buf += (true_height - avctx->
height)*avctx->
width*2;
110 for(y = 0; y < avctx->
height; y++) {
112 buf += 2*avctx->
width;
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static av_cold int init(AVCodecContext *avctx)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
MJPEG encoder and decoder.
MJpegDecodeContext mjpeg_ctx
static av_cold int end(AVCodecContext *avctx)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
int lowres
low resolution decoding, 1-> 1/2 size, 2->1/4 size
int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const char * name
Name of the codec implementation.
Libavcodec external API header.
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
BYTE int const BYTE int int int height
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
common internal api header.
int key_frame
1 -> keyframe, 0-> not
This structure stores compressed data.