37 #include <libdirac_decoder/dirac_parser.h>
58 for (idx = 0; idx < num_formats; ++idx)
77 void *
data,
int *data_size,
80 const uint8_t *buf = avpkt->
data;
81 int buf_size = avpkt->
size;
93 dirac_buffer(p_dirac_params->
p_decoder, buf, buf + buf_size);
94 if ((buf[4] & 0x08) == 0x08 && (buf[4] & 0x03))
107 dirac_sourceparams_t *src_params = &p_dirac_params->
p_decoder->src_params;
110 0, avccontext) < 0) {
112 src_params->width, src_params->height);
117 avccontext->
height = src_params->height;
118 avccontext->
width = src_params->width;
123 "Dirac chroma format %d not supported currently\n",
128 avccontext->
time_base.
den = src_params->frame_rate.numerator;
129 avccontext->
time_base.
num = src_params->frame_rate.denominator;
145 buffer[2] = buffer[1] +
146 pic.
linesize[1] * src_params->chroma_height;
152 case STATE_SEQUENCE_END:
155 case STATE_PICTURE_AVAIL:
178 dirac_decoder_close(p_dirac_params->
p_decoder);
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
int linesize[AV_NUM_DATA_POINTERS]
number of bytes per line
unsigned char * p_out_frame_buf
buffer to hold decoded frame
dirac_decoder_t * p_decoder
decoder handle
AVCodec ff_libdirac_decoder
contains a single frame returned from Dirac
four components are given, that's all.
static av_cold int libdirac_decode_init(AVCodecContext *avccontext)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height)
Calculate the size in bytes that a picture of the given width and height would occupy if stored in th...
static int init(AVCodecParserContext *s)
dirac_chroma_t dirac_pix_fmt
int has_b_frames
Size of the frame reordering buffer in the decoder.
data structures common to libdirac encoder and decoder
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static const struct @27 dirac_pixel_format_map[]
Table providing a Dirac chroma format to Libav pixel format mapping.
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
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...
int width
picture width / height.
static enum PixelFormat get_chroma_format(dirac_chroma_t dirac_pix_fmt)
returns Libav chroma format
main external API structure.
static void close(AVCodecParserContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
struct AVPicture AVPicture
four components are given, that's all.
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
int avpicture_fill(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt, int width, int height)
Fill in the AVPicture fields.
static int dirac_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
struct DiracDecoderParams DiracDecoderParams
contains a single frame returned from Dirac
static av_cold void flush(AVCodecContext *avctx)
Flush (reset) the frame ID after seeking.
static void libdirac_flush(AVCodecContext *avccontext)
static av_cold int libdirac_decode_close(AVCodecContext *avccontext)
static int libdirac_decode_frame(AVCodecContext *avccontext, void *data, int *data_size, AVPacket *avpkt)
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...