FFmpeg
Data Structures | Macros | Functions | Variables
libxevd.c File Reference
#include <stddef.h>
#include <xevd.h>
#include "libavutil/internal.h"
#include "libavutil/common.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "libavutil/imgutils.h"
#include "libavutil/cpu.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "profiles.h"
#include "decode.h"

Go to the source code of this file.

Data Structures

struct  XevdContext
 The structure stores all the states associated with the instance of Xeve MPEG-5 EVC decoder. More...
 

Macros

#define XEVD_PARAM_BAD_NAME   -1
 
#define XEVD_PARAM_BAD_VALUE   -2
 
#define EVC_NAL_HEADER_SIZE   2 /* byte */
 

Functions

static void get_conf (AVCodecContext *avctx, XEVD_CDSC *cdsc)
 The function populates the XEVD_CDSC structure. More...
 
static uint32_t read_nal_unit_length (const uint8_t *bs, int bs_size, AVCodecContext *avctx)
 Read NAL unit length. More...
 
static int export_stream_params (const XevdContext *xectx, AVCodecContext *avctx)
 
static int libxevd_image_copy (struct AVCodecContext *avctx, XEVD_IMGB *imgb, struct AVFrame *frame)
 Copy image in imgb to frame. More...
 
static av_cold int libxevd_init (AVCodecContext *avctx)
 Initialize decoder Create a decoder instance and allocate all the needed resources. More...
 
static int libxevd_return_frame (AVCodecContext *avctx, AVFrame *frame, XEVD_IMGB *imgb, AVPacket **pkt_au)
 
static int libxevd_receive_frame (AVCodecContext *avctx, AVFrame *frame)
 Decode frame with decoupled packet/frame dataflow. More...
 
static av_cold int libxevd_close (AVCodecContext *avctx)
 Destroy decoder. More...
 

Variables

const FFCodec ff_libxevd_decoder
 

Macro Definition Documentation

◆ XEVD_PARAM_BAD_NAME

#define XEVD_PARAM_BAD_NAME   -1

Definition at line 40 of file libxevd.c.

◆ XEVD_PARAM_BAD_VALUE

#define XEVD_PARAM_BAD_VALUE   -2

Definition at line 41 of file libxevd.c.

◆ EVC_NAL_HEADER_SIZE

#define EVC_NAL_HEADER_SIZE   2 /* byte */

Definition at line 43 of file libxevd.c.

Function Documentation

◆ get_conf()

static void get_conf ( AVCodecContext avctx,
XEVD_CDSC *  cdsc 
)
static

The function populates the XEVD_CDSC structure.

XEVD_CDSC contains all decoder parameters that should be initialized before its use.

Parameters
[in]avctxcodec context
[out]cdsccontains all decoder parameters that should be initialized before its use

Definition at line 67 of file libxevd.c.

Referenced by libxevd_init().

◆ read_nal_unit_length()

static uint32_t read_nal_unit_length ( const uint8_t *  bs,
int  bs_size,
AVCodecContext avctx 
)
static

Read NAL unit length.

Parameters
bsinput data (bitstream)
Returns
the length of NAL unit on success, 0 value on failure

Definition at line 88 of file libxevd.c.

Referenced by libxevd_receive_frame().

◆ export_stream_params()

static int export_stream_params ( const XevdContext xectx,
AVCodecContext avctx 
)
static
Parameters
[in]xectxthe structure that stores all the state associated with the instance of Xeve MPEG-5 EVC decoder
[out]avctxcodec context
Returns
0 on success, negative value on failure

Definition at line 115 of file libxevd.c.

Referenced by libxevd_receive_frame().

◆ libxevd_image_copy()

static int libxevd_image_copy ( struct AVCodecContext avctx,
XEVD_IMGB *  imgb,
struct AVFrame frame 
)
static

Copy image in imgb to frame.

Parameters
avctxcodec context
[in]imgb
[out]frame
Returns
0 on success, negative value on failure

Definition at line 190 of file libxevd.c.

Referenced by libxevd_return_frame().

◆ libxevd_init()

static av_cold int libxevd_init ( AVCodecContext avctx)
static

Initialize decoder Create a decoder instance and allocate all the needed resources.

Parameters
avctxcodec context
Returns
0 on success, negative error code on failure

Definition at line 223 of file libxevd.c.

◆ libxevd_return_frame()

static int libxevd_return_frame ( AVCodecContext avctx,
AVFrame frame,
XEVD_IMGB *  imgb,
AVPacket **  pkt_au 
)
static

Definition at line 248 of file libxevd.c.

Referenced by libxevd_receive_frame().

◆ libxevd_receive_frame()

static int libxevd_receive_frame ( AVCodecContext avctx,
AVFrame frame 
)
static

Decode frame with decoupled packet/frame dataflow.

Parameters
avctxcodec context
[out]framedecoded frame
Returns
0 on success, negative error code on failure

Definition at line 315 of file libxevd.c.

◆ libxevd_close()

static av_cold int libxevd_close ( AVCodecContext avctx)
static

Destroy decoder.

Parameters
avctxcodec context
Returns
0 on success

Definition at line 453 of file libxevd.c.

Variable Documentation

◆ ff_libxevd_decoder

const FFCodec ff_libxevd_decoder
Initial value:
= {
.p.name = "evc",
CODEC_LONG_NAME("EVC / MPEG-5 Essential Video Coding (EVC)"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_EVC,
.init = libxevd_init,
.close = libxevd_close,
.priv_data_size = sizeof(XevdContext),
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
.p.wrapper_name = "libxevd",
}

Definition at line 467 of file libxevd.c.

FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:42
XevdContext
The structure stores all the states associated with the instance of Xeve MPEG-5 EVC decoder.
Definition: libxevd.c:48
FF_CODEC_CAP_NOT_INIT_THREADSAFE
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
Definition: codec_internal.h:34
AV_CODEC_ID_EVC
@ AV_CODEC_ID_EVC
Definition: codec_id.h:321
AV_CODEC_CAP_OTHER_THREADS
#define AV_CODEC_CAP_OTHER_THREADS
Codec supports multithreading through a method other than slice- or frame-level multithreading.
Definition: codec.h:124
ff_evc_profiles
const AVProfile ff_evc_profiles[]
Definition: profiles.c:198
libxevd_close
static av_cold int libxevd_close(AVCodecContext *avctx)
Destroy decoder.
Definition: libxevd.c:453
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:271
libxevd_init
static av_cold int libxevd_init(AVCodecContext *avctx)
Initialize decoder Create a decoder instance and allocate all the needed resources.
Definition: libxevd.c:223
libxevd_receive_frame
static int libxevd_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Decode frame with decoupled packet/frame dataflow.
Definition: libxevd.c:315
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
FF_CODEC_CAP_SETS_FRAME_PROPS
#define FF_CODEC_CAP_SETS_FRAME_PROPS
Codec handles output frame properties internally instead of letting the internal logic derive them fr...
Definition: codec_internal.h:77
FF_CODEC_RECEIVE_FRAME_CB
#define FF_CODEC_RECEIVE_FRAME_CB(func)
Definition: codec_internal.h:292
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:76
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_CODEC_CAP_AVOID_PROBING
#define AV_CODEC_CAP_AVOID_PROBING
Decoder is not a preferred choice for probing.
Definition: codec.h:138