29 #include "libavutil/opt.h"
30 #include "libavutil/imgutils.h"
43 int src_linesize,
int height,
int nlines)
47 src += (nlines) * src_linesize * height;
52 const int src_linesizes[4],
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];
132 int i, cur_frame = 0,
ret = 0;
204 .priv_class = &smvjpegdec_class,
AVCodec ff_smvjpeg_decoder
This structure describes decoded (raw) audio or video data.
#define LIBAVUTIL_VERSION_INT
static av_cold int init(AVCodecContext *avctx)
void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
uint8_t ** extended_data
pointers to the data planes/channels.
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
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 av_cold int smvjpeg_decode_init(AVCodecContext *avctx)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
const char * av_default_item_name(void *ctx)
Return the context name.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
static int smvjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
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.
int av_frame_ref(AVFrame *dst, AVFrame *src)
Setup a new reference to the data described by a given frame.
#define FF_CEIL_RSHIFT(a, b)
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
enum AVPixelFormat pix_fmt
#define AV_NUM_DATA_POINTERS
#define AV_PIX_FMT_FLAG_PSEUDOPAL
The pixel format is "pseudo-paletted".
static void smv_img_pnt(uint8_t *dst_data[4], uint8_t *src_data[4], const int src_linesizes[4], enum PixelFormat pix_fmt, int width, int height, int nlines)
int width
width and height of the video frame
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
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.
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. ...
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
void av_dict_free(AVDictionary **m)
Free all the memory allocated for an AVDictionary struct and all keys and values. ...
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Libavcodec external API header.
uint8_t nb_components
The number of components each pixel has, (1-4)
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
int width
picture width / height.
int idct_algo
IDCT algorithm, see FF_IDCT_* below.
int refcounted_frames
If non-zero, the decoded audio and video frames returned from avcodec_decode_video2() and avcodec_dec...
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
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)
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
BYTE int const BYTE int int int height
Describe the class of an AVClass context structure.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
uint16_t plane
which of the 4 planes contains the component
common internal api header.
static void smv_img_pnt_plane(uint8_t **dst, uint8_t *src, int src_linesize, int height, int nlines)
static const AVClass smvjpegdec_class
#define AVERROR_INVALIDDATA
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
int ff_codec_close_recursive(AVCodecContext *avctx)
Call avcodec_close recursively, counterpart to avcodec_open2_recursive.
static av_cold int smvjpeg_decode_end(AVCodecContext *avctx)
This structure stores compressed data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...