Go to the documentation of this file.
43 int src_linesize,
int height,
int nlines)
52 const int src_linesizes[4],
62 for (
i = 0;
i <
desc->nb_components;
i++)
63 planes_nb =
FFMAX(planes_nb,
desc->comp[
i].plane + 1);
65 for (
i = 0;
i < planes_nb;
i++) {
67 if (
i == 1 ||
i == 2) {
71 src_linesizes[
i],
h, nlines);
75 dst_data[1] = src_data[1];
99 s->frames_per_jpeg = 0;
106 if (!
s->picture[1]) {
111 s->jpg.picture_ptr =
s->picture[0];
116 if (
s->frames_per_jpeg <= 0) {
131 s->avctx->refcounted_frames = 1;
132 s->avctx->flags = avctx->
flags;
150 AVFrame* mjpeg_data =
s->picture[0];
151 int i, cur_frame = 0,
ret = 0;
153 cur_frame = avpkt->
pts %
s->frames_per_jpeg;
157 cur_frame +=
s->frames_per_jpeg;
164 s->mjpeg_data_size = 0;
167 }
else if (!
s->mjpeg_data_size)
173 if (mjpeg_data->
height % (
s->frames_per_jpeg <<
desc->log2_chroma_h)) {
179 *data_size =
s->mjpeg_data_size;
192 s->picture[1]->extended_data =
NULL;
193 s->picture[1]->width = avctx->
width;
194 s->picture[1]->height = avctx->
height;
195 s->picture[1]->format = avctx->
pix_fmt;
199 s->picture[1]->linesize[
i] = mjpeg_data->
linesize[
i];
int avcodec_close(AVCodecContext *avctx)
Close a given AVCodecContext and free all the data associated with it (but not the AVCodecContext its...
AVPixelFormat
Pixel format.
static av_cold int init(AVCodecContext *avctx)
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
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
static int smvjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
int flags
AV_CODEC_FLAG_*.
AVCodec ff_smvjpeg_decoder
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
#define AV_CEIL_RSHIFT(a, b)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static enum AVPixelFormat pix_fmt
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
const char * av_default_item_name(void *ptr)
Return the context name.
int ff_codec_open2_recursive(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Call avcodec_open2 recursively by decrementing counter, unlocking mutex, calling the function and the...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static av_cold int smvjpeg_decode_init(AVCodecContext *avctx)
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
#define AV_NUM_DATA_POINTERS
static void smv_img_pnt(uint8_t *dst_data[4], uint8_t *src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height, int nlines)
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
attribute_deprecated int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const AVPacket *avpkt)
Decode the video frame of size avpkt->size from avpkt->data into picture.
static const AVClass smvjpegdec_class
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
int idct_algo
IDCT algorithm, see FF_IDCT_* below.
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
main external API structure.
static void smv_img_pnt_plane(uint8_t **dst, uint8_t *src, int src_linesize, int height, int nlines)
#define AVERROR_DECODER_NOT_FOUND
Decoder not found.
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.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
This structure stores compressed data.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
int width
picture width / height.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
static av_cold int smvjpeg_decode_end(AVCodecContext *avctx)