50 cad->
param.info_level = 0;
65 davs2_seq_info_t *headerset,
int ret_type,
AVFrame *
frame)
68 int bytes_per_sample = pic->bytes_per_sample;
77 if (!pic || ret_type == DAVS2_GOT_HEADER) {
78 avctx->
width = headerset->width;
79 avctx->
height = headerset->height;
80 avctx->
pix_fmt = headerset->output_bit_depth == 10 ?
89 if (headerset->frame_rate_id < 16)
115 for (plane = 0; plane < 3; ++plane) {
116 int size_line = pic->widths[plane] * bytes_per_sample;
119 if (!
frame->buf[plane]){
120 av_log(avctx,
AV_LOG_ERROR,
"Decoder error: allocation failure, can't dump frames.\n");
125 frame->linesize[plane] = size_line;
128 memcpy(
frame->data[plane] +
line * size_line,
129 pic->planes[plane] +
line * pic->strides[plane],
130 pic->widths[plane] * bytes_per_sample);
145 int ret = DAVS2_GOT_FRAME;
147 while (ret == DAVS2_GOT_FRAME) {
152 if (ret == DAVS2_ERROR) {
160 int ret = DAVS2_DEFAULT;
163 if (ret == DAVS2_ERROR) {
167 if (ret == DAVS2_GOT_FRAME) {
181 davs2_decoder_close(cad->
decoder);
192 int buf_size = avpkt->
size;
193 const uint8_t *buf_ptr = avpkt->
data;
194 int ret = DAVS2_DEFAULT;
201 cad->
packet.data = buf_ptr;
202 cad->
packet.len = buf_size;
209 if (ret == DAVS2_ERROR) {
216 if (ret != DAVS2_DEFAULT) {
221 return ret == 0 ? buf_size : ret;
225 .p.name =
"libdavs2",
237 .p.wrapper_name =
"libdavs2",
const FFCodec ff_libdavs2_decoder
static av_cold void close(AVCodecParserContext *s)
Libavcodec external API header.
const AVRational ff_avs2_frame_rate_tab[16]
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_AUTO_THREADS
Codec handles avctx->thread_count == 0 (auto) internally.
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_OTHER_THREADS
Codec supports multithreading through a method other than slice- or frame-level multithreading.
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
AVBufferRef * av_buffer_alloc(size_t size)
Allocate an AVBuffer of the given size using av_malloc().
#define AVERROR_EXTERNAL
Generic error in an external library.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_P
Predicted.
@ AV_PICTURE_TYPE_S
S(GMC)-VOP MPEG-4.
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
static atomic_int cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
#define AV_CPU_FLAG_AVX2
AVX2 functions: requires OS support even if YMM registers aren't used.
#define AV_CPU_FLAG_AVX
AVX functions: requires OS support even if YMM registers aren't used.
static av_cold int davs2_init(AVCodecContext *avctx)
static int davs2_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic, int *got_frame, davs2_seq_info_t *headerset, int ret_type, AVFrame *frame)
static int send_delayed_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame)
static void davs2_flush(AVCodecContext *avctx)
static av_cold int davs2_end(AVCodecContext *avctx)
#define AV_PIX_FMT_YUV420P10
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
int has_b_frames
Size of the frame reordering buffer in the decoder.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
davs2_picture_t out_frame
davs2_seq_info_t headerset