|
FFmpeg
|
#include <stdint.h>#include <stdlib.h>#include <oapv/oapv.h>#include "libavutil/avassert.h"#include "libavutil/intreadwrite.h"#include "libavutil/imgutils.h"#include "libavutil/internal.h"#include "libavutil/mem.h"#include "libavutil/opt.h"#include "libavutil/pixdesc.h"#include "libavutil/pixfmt.h"#include "libavutil/mastering_display_metadata.h"#include "avcodec.h"#include "apv.h"#include "codec_internal.h"#include "encode.h"#include "profiles.h"Go to the source code of this file.
Data Structures | |
| struct | ApvEncContext |
| The structure stores all the states associated with the instance of APV encoder. More... | |
Macros | |
| #define | MAX_BS_BUF (128 * 1024 * 1024) |
| #define | MAX_NUM_FRMS (1) |
| #define | FRM_IDX (0) |
| #define | MAX_NUM_CC (OAPV_MAX_CC) |
| #define | MAX_METADATA_PAYLOADS (8) |
| #define | OFFSET(x) |
| #define | VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
Functions | |
| static int64_t | rescale_rational (AVRational a, int b) |
| static int | apv_imgb_release (oapv_imgb_t *imgb) |
| static int | apv_imgb_addref (oapv_imgb_t *imgb) |
| static int | apv_imgb_getref (oapv_imgb_t *imgb) |
| static int | get_color_format (enum AVPixelFormat pix_fmt) |
| Convert FFmpeg pixel format (AVPixelFormat) into APV pre-defined color format. | |
| static int | get_chroma_format_idc (enum AVPixelFormat pix_fmt) |
| static int | get_min_profile (enum AVPixelFormat pix_fmt) |
| static int | profile_is_compatible (enum AVPixelFormat pix_fmt, int profile) |
| static int | validate_profile (AVCodecContext *avctx, int profile) |
| static oapv_imgb_t * | apv_imgb_create (AVCodecContext *avctx) |
| static int | apv_metadata_add_payload (const AVCodecContext *avctx, ApvEncContext *apv, uint32_t group_id, uint32_t type, const void *data, uint32_t size) |
| static int | get_conf (AVCodecContext *avctx, oapve_cdesc_t *cdsc) |
| Populate the liboapv configuration from AVCodecContext and encoder options. | |
| static int | handle_side_data (AVCodecContext *avctx, ApvEncContext *apv) |
| static av_cold int | liboapve_init (AVCodecContext *avctx) |
| Initialize APV codec Create an encoder instance and allocate all the needed resources. | |
| static int | liboapve_encode (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet) |
| Encode raw data frame into APV packet. | |
| static av_cold int | liboapve_close (AVCodecContext *avctx) |
| Destroy the encoder and release all the allocated resources. | |
Variables | |
| static const AVOption | liboapv_options [] |
| static const AVClass | liboapve_class |
| static const FFCodecDefault | liboapve_defaults [] |
| const FFCodec | ff_liboapv_encoder |
| #define MAX_BS_BUF (128 * 1024 * 1024) |
Definition at line 45 of file liboapvenc.c.
Referenced by get_conf(), get_conf(), liboapve_init(), and libxeve_init().
| #define MAX_NUM_FRMS (1) |
Definition at line 46 of file liboapvenc.c.
Referenced by get_conf().
| #define FRM_IDX (0) |
Definition at line 47 of file liboapvenc.c.
Referenced by get_conf(), liboapve_encode(), and liboapve_init().
| #define MAX_NUM_CC (OAPV_MAX_CC) |
Definition at line 48 of file liboapvenc.c.
| #define MAX_METADATA_PAYLOADS (8) |
Definition at line 50 of file liboapvenc.c.
Referenced by apv_metadata_add_payload().
| #define OFFSET | ( | x | ) |
Definition at line 660 of file liboapvenc.c.
| #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
Definition at line 661 of file liboapvenc.c.
|
inlinestatic |
Definition at line 52 of file liboapvenc.c.
Referenced by handle_side_data().
|
static |
Definition at line 84 of file liboapvenc.c.
Referenced by apv_imgb_create().
|
static |
Definition at line 96 of file liboapvenc.c.
Referenced by apv_imgb_create().
|
static |
Definition at line 102 of file liboapvenc.c.
Referenced by apv_imgb_create().
|
inlinestatic |
Convert FFmpeg pixel format (AVPixelFormat) into APV pre-defined color format.
Definition at line 112 of file liboapvenc.c.
Referenced by apv_imgb_create().
|
inlinestatic |
Definition at line 134 of file liboapvenc.c.
Referenced by profile_is_compatible().
|
inlinestatic |
Definition at line 153 of file liboapvenc.c.
Referenced by get_conf(), and validate_profile().
|
static |
Definition at line 175 of file liboapvenc.c.
Referenced by validate_profile().
|
static |
Definition at line 212 of file liboapvenc.c.
Referenced by get_conf().
|
static |
Definition at line 230 of file liboapvenc.c.
Referenced by liboapve_init().
|
static |
Definition at line 280 of file liboapvenc.c.
Referenced by handle_side_data().
|
static |
Populate the liboapv configuration from AVCodecContext and encoder options.
AVCodecContext fields are applied first, followed by liboapv private options and finally oapv-params. The APV profile defaults to the minimum profile implied by pix_fmt, and later overrides must remain compatible with that pixel format.
| [in] | avctx | codec context (AVCodecContext) |
| [out] | cdsc | contains all APV encoder encoder parameters that should be initialized before the encoder is use |
Definition at line 324 of file liboapvenc.c.
Referenced by liboapve_init().
|
static |
Definition at line 412 of file liboapvenc.c.
Referenced by liboapve_init().
|
static |
Initialize APV codec Create an encoder instance and allocate all the needed resources.
| avctx | codec context |
Definition at line 476 of file liboapvenc.c.
|
static |
Encode raw data frame into APV packet.
| [in] | avctx | codec context |
| [out] | avpkt | output AVPacket containing encoded data |
| [in] | frame | AVFrame containing the raw data to be encoded |
| [out] | got_packet | encoder sets to 0 or 1 to indicate that a non-empty packet was returned in pkt |
Definition at line 568 of file liboapvenc.c.
|
static |
Destroy the encoder and release all the allocated resources.
| avctx | codec context |
Definition at line 626 of file liboapvenc.c.
|
static |
Definition at line 663 of file liboapvenc.c.
|
static |
Definition at line 678 of file liboapvenc.c.
|
static |
Definition at line 685 of file liboapvenc.c.
| const FFCodec ff_liboapv_encoder |
Definition at line 690 of file liboapvenc.c.