FFmpeg
Functions | Variables
apv_decode.c File Reference
#include <stdatomic.h>
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/mastering_display_metadata.h"
#include "libavutil/mem_internal.h"
#include "libavutil/pixdesc.h"
#include "libavutil/thread.h"
#include "apv.h"
#include "apv_decode.h"
#include "avcodec.h"
#include "cbs_apv.h"
#include "codec_internal.h"
#include "decode.h"
#include "internal.h"
#include "thread.h"
#include "hwconfig.h"
#include "hwaccel_internal.h"
#include "config_components.h"

Go to the source code of this file.

Functions

static enum AVPixelFormat get_pixel_format (AVCodecContext *avctx, enum AVPixelFormat pix_fmt)
 
static int apv_decode_check_format (AVCodecContext *avctx, const APVRawFrameHeader *header)
 
static av_cold void apv_entropy_build_decode_lut (void)
 
static av_cold int apv_decode_init (AVCodecContext *avctx)
 
static av_cold void apv_decode_flush (AVCodecContext *avctx)
 
static av_cold int apv_decode_close (AVCodecContext *avctx)
 
static int apv_decode_block (AVCodecContext *avctx, void *output, ptrdiff_t pitch, GetBitContext *gbc, APVEntropyState *entropy_state, int bit_depth, int qp_shift, const uint16_t *qmatrix)
 
static int apv_decode_tile_component (AVCodecContext *avctx, void *data, int job, int thread)
 
static void apv_derive_tile_info (APVDerivedTileInfo *ti, const APVRawFrameHeader *fh)
 
static int apv_decode (AVCodecContext *avctx, AVFrame *output, APVRawFrame *input)
 
static int apv_decode_metadata (AVCodecContext *avctx, AVFrame *frame, const APVRawMetadata *md)
 
static int apv_receive_frame_internal (AVCodecContext *avctx, AVFrame *frame)
 
static int apv_receive_frame (AVCodecContext *avctx, AVFrame *frame)
 

Variables

static enum AVPixelFormat apv_format_table [5][4]
 
APVVLCLUT ff_apv_decode_lut
 
static const CodedBitstreamUnitType apv_decompose_unit_types []
 
static AVOnce apv_entropy_once = AV_ONCE_INIT
 
const FFCodec ff_apv_decoder
 

Function Documentation

◆ get_pixel_format()

static enum AVPixelFormat get_pixel_format ( AVCodecContext avctx,
enum AVPixelFormat  pix_fmt 
)
static

Definition at line 50 of file apv_decode.c.

Referenced by apv_decode_check_format().

◆ apv_decode_check_format()

static int apv_decode_check_format ( AVCodecContext avctx,
const APVRawFrameHeader header 
)
static

Definition at line 64 of file apv_decode.c.

Referenced by apv_decode().

◆ apv_entropy_build_decode_lut()

static av_cold void apv_entropy_build_decode_lut ( void  )
static

Definition at line 133 of file apv_decode.c.

Referenced by apv_decode_init().

◆ apv_decode_init()

static av_cold int apv_decode_init ( AVCodecContext avctx)
static

Definition at line 138 of file apv_decode.c.

◆ apv_decode_flush()

static av_cold void apv_decode_flush ( AVCodecContext avctx)
static

Definition at line 166 of file apv_decode.c.

◆ apv_decode_close()

static av_cold int apv_decode_close ( AVCodecContext avctx)
static

Definition at line 176 of file apv_decode.c.

◆ apv_decode_block()

static int apv_decode_block ( AVCodecContext avctx,
void *  output,
ptrdiff_t  pitch,
GetBitContext gbc,
APVEntropyState entropy_state,
int  bit_depth,
int  qp_shift,
const uint16_t *  qmatrix 
)
static

Definition at line 186 of file apv_decode.c.

Referenced by apv_decode_tile_component().

◆ apv_decode_tile_component()

static int apv_decode_tile_component ( AVCodecContext avctx,
void *  data,
int  job,
int  thread 
)
static

Definition at line 212 of file apv_decode.c.

Referenced by apv_decode().

◆ apv_derive_tile_info()

static void apv_derive_tile_info ( APVDerivedTileInfo ti,
const APVRawFrameHeader fh 
)
static

Definition at line 331 of file apv_decode.c.

Referenced by apv_decode().

◆ apv_decode()

static int apv_decode ( AVCodecContext avctx,
AVFrame output,
APVRawFrame input 
)
static

Definition at line 357 of file apv_decode.c.

Referenced by apv_receive_frame_internal().

◆ apv_decode_metadata()

static int apv_decode_metadata ( AVCodecContext avctx,
AVFrame frame,
const APVRawMetadata md 
)
static

Definition at line 438 of file apv_decode.c.

Referenced by apv_receive_frame_internal().

◆ apv_receive_frame_internal()

static int apv_receive_frame_internal ( AVCodecContext avctx,
AVFrame frame 
)
static

Definition at line 503 of file apv_decode.c.

Referenced by apv_receive_frame().

◆ apv_receive_frame()

static int apv_receive_frame ( AVCodecContext avctx,
AVFrame frame 
)
static

Definition at line 564 of file apv_decode.c.

Variable Documentation

◆ apv_format_table

enum AVPixelFormat apv_format_table[5][4]
static

◆ ff_apv_decode_lut

APVVLCLUT ff_apv_decode_lut

Definition at line 48 of file apv_decode.c.

Referenced by apv_decode_tile_component(), and apv_entropy_build_decode_lut().

◆ apv_decompose_unit_types

const CodedBitstreamUnitType apv_decompose_unit_types[]
static
Initial value:

Definition at line 126 of file apv_decode.c.

Referenced by apv_decode_init().

◆ apv_entropy_once

AVOnce apv_entropy_once = AV_ONCE_INIT
static

Definition at line 131 of file apv_decode.c.

Referenced by apv_decode_init().

◆ ff_apv_decoder

const FFCodec ff_apv_decoder
Initial value:

Definition at line 606 of file apv_decode.c.

APVDecodeContext
Definition: apv_decode.h:98
apv_receive_frame
static int apv_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Definition: apv_decode.c:564
close
static av_cold void close(AVCodecParserContext *s)
Definition: apv_parser.c:197
AV_PIX_FMT_YUVA444P16
#define AV_PIX_FMT_YUVA444P16
Definition: pixfmt.h:597
apv_decode_init
static av_cold int apv_decode_init(AVCodecContext *avctx)
Definition: apv_decode.c:138
AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:522
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:542
AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:551
AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:552
AV_PIX_FMT_YUVA444P12
#define AV_PIX_FMT_YUVA444P12
Definition: pixfmt.h:594
AV_PIX_FMT_GRAY14
#define AV_PIX_FMT_GRAY14
Definition: pixfmt.h:521
apv_decode_flush
static av_cold void apv_decode_flush(AVCodecContext *avctx)
Definition: apv_decode.c:166
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:332
AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:519
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:95
NULL
#define NULL
Definition: coverity.c:32
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts.c:553
UPDATE_THREAD_CONTEXT
#define UPDATE_THREAD_CONTEXT(func)
Definition: codec_internal.h:341
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:540
APV_PBU_PRIMARY_FRAME
@ APV_PBU_PRIMARY_FRAME
Definition: apv.h:27
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:551
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
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:544
FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
The decoder extracts and fills its parameters even if the frame is skipped due to the skip_frame sett...
Definition: codec_internal.h:55
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:546
AVCodecHWConfigInternal
Definition: hwconfig.h:25
AV_CODEC_CAP_SLICE_THREADS
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Definition: codec.h:99
AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:592
apv_decode_close
static av_cold int apv_decode_close(AVCodecContext *avctx)
Definition: apv_decode.c:176
APV_PBU_METADATA
@ APV_PBU_METADATA
Definition: apv.h:33
AV_CODEC_ID_APV
@ AV_CODEC_ID_APV
Definition: codec_id.h:332
AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV422P14
Definition: pixfmt.h:548
FF_CODEC_RECEIVE_FRAME_CB
#define FF_CODEC_RECEIVE_FRAME_CB(func)
Definition: codec_internal.h:355
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
update_thread_context
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call have update_thread_context() run it in the next thread. Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little speed gain at this point but it should work. Use ff_thread_get_buffer()(or ff_progress_frame_get_buffer() in case you have inter-frame dependencies and use the ProgressFrame API) to allocate frame buffers. Call ff_progress_frame_report() after some part of the current picture has decoded. A good place to put this is where draw_horiz_band() is called - add this if it isn 't called anywhere
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUV444P14
Definition: pixfmt.h:549
AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:520