47 cad->
param.info_level = 0;
65 int bytes_per_sample = pic->bytes_per_sample;
74 if (!pic || ret_type == DAVS2_GOT_HEADER) {
75 avctx->
width = headerset->width;
76 avctx->
height = headerset->height;
77 avctx->
pix_fmt = headerset->output_bit_depth == 10 ?
105 for (plane = 0; plane < 3; ++plane) {
106 int size_line = pic->widths[plane] * bytes_per_sample;
109 if (!frame->
buf[plane]){
110 av_log(avctx,
AV_LOG_ERROR,
"Decoder error: allocation failure, can't dump frames.\n");
117 for (line = 0; line < pic->lines[plane]; ++line)
118 memcpy(frame->
data[plane] + line * size_line,
119 pic->planes[plane] + line * pic->strides[plane],
120 pic->widths[plane] * bytes_per_sample);
135 int ret = DAVS2_GOT_FRAME;
137 while (ret == DAVS2_GOT_FRAME) {
142 if (ret == DAVS2_ERROR) {
150 int ret = DAVS2_DEFAULT;
153 if (ret == DAVS2_ERROR) {
157 if (ret == DAVS2_GOT_FRAME) {
170 davs2_decoder_close(cad->
decoder);
181 int buf_size = avpkt->
size;
184 int ret = DAVS2_DEFAULT;
191 cad->
packet.data = buf_ptr;
192 cad->
packet.len = buf_size;
199 if (ret == DAVS2_ERROR) {
206 if (ret != DAVS2_DEFAULT) {
211 return ret == 0 ? buf_size : ret;
227 .wrapper_name =
"libdavs2",
#define AV_CPU_FLAG_AVX
AVX functions: requires OS support even if YMM registers aren't used.
This structure describes decoded (raw) audio or video data.
static void flush(AVCodecContext *avctx)
davs2_picture_t out_frame
#define AV_LOG_WARNING
Something somehow does not look correct.
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
static av_cold int init(AVCodecContext *avctx)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static atomic_int cpu_flags
#define AV_CODEC_CAP_AUTO_THREADS
Codec supports avctx->thread_count == 0 (auto).
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static int send_delayed_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame)
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
AVCodec ff_libdavs2_decoder
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
#define AV_LOG_VERBOSE
Detailed information.
#define AV_CPU_FLAG_AVX2
AVX2 functions: requires OS support even if YMM registers aren't used.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold int davs2_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.
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
static av_cold int davs2_init(AVCodecContext *avctx)
int thread_count
thread count is used to decide how many independent tasks should be passed to execute() ...
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
Libavcodec external API header.
AVBufferRef * av_buffer_alloc(int size)
Allocate an AVBuffer of the given size using av_malloc().
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
uint8_t * data
The data buffer.
#define AV_PIX_FMT_YUV420P10
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 void davs2_flush(AVCodecContext *avctx)
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
static enum AVPixelFormat pix_fmts[]
davs2_seq_info_t headerset
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVRational av_d2q(double d, int max)
Convert a double precision floating point number to a rational.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static int davs2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
#define AVERROR_EXTERNAL
Generic error in an external library.
AVPixelFormat
Pixel format.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...