FFmpeg
Macros | Functions | Variables
prores_raw.c File Reference
#include "libavutil/intreadwrite.h"
#include "libavutil/mem_internal.h"
#include "libavutil/mem.h"
#include "config_components.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "idctdsp.h"
#include "proresdata.h"
#include "thread.h"
#include "hwconfig.h"
#include "hwaccel_internal.h"
#include "prores_raw.h"

Go to the source code of this file.

Macros

#define CACHED_BITSTREAM_READER   !ARCH_X86_32
 
#define TODCCODEBOOK(x)   ((x + 1) >> 1)
 
#define DC_CB_MAX   12
 
#define AC_CB_MAX   94
 
#define RN_CB_MAX   27
 
#define LN_CB_MAX   14
 

Functions

static av_cold int decode_init (AVCodecContext *avctx)
 
static int16_t get_value (GetBitContext *gb, int16_t codebook)
 
static int decode_comp (AVCodecContext *avctx, TileContext *tile, AVFrame *frame, const uint8_t *data, int size, int component, int16_t *qmat)
 
static int decode_tile (AVCodecContext *avctx, TileContext *tile, AVFrame *frame)
 
static int decode_tiles (AVCodecContext *avctx, void *arg, int n, int thread_nb)
 
static enum AVPixelFormat get_pixel_format (AVCodecContext *avctx, enum AVPixelFormat pix_fmt)
 
static int decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 
static av_cold int decode_end (AVCodecContext *avctx)
 

Variables

static const uint8_t align_tile_w [16]
 
const uint8_t ff_prores_raw_dc_cb [DC_CB_MAX+1]
 
const int16_t ff_prores_raw_ac_cb [AC_CB_MAX+1]
 
const int16_t ff_prores_raw_rn_cb [RN_CB_MAX+1]
 
const int16_t ff_prores_raw_ln_cb [LN_CB_MAX+1]
 
const FFCodec ff_prores_raw_decoder
 

Macro Definition Documentation

◆ CACHED_BITSTREAM_READER

#define CACHED_BITSTREAM_READER   !ARCH_X86_32

Definition at line 27 of file prores_raw.c.

◆ TODCCODEBOOK

#define TODCCODEBOOK (   x)    ((x + 1) >> 1)

Definition at line 96 of file prores_raw.c.

◆ DC_CB_MAX

#define DC_CB_MAX   12

Definition at line 102 of file prores_raw.c.

◆ AC_CB_MAX

#define AC_CB_MAX   94

Definition at line 107 of file prores_raw.c.

◆ RN_CB_MAX

#define RN_CB_MAX   27

Definition at line 119 of file prores_raw.c.

◆ LN_CB_MAX

#define LN_CB_MAX   14

Definition at line 125 of file prores_raw.c.

Function Documentation

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 43 of file prores_raw.c.

◆ get_value()

static int16_t get_value ( GetBitContext gb,
int16_t  codebook 
)
static

Definition at line 66 of file prores_raw.c.

Referenced by decode_comp().

◆ decode_comp()

static int decode_comp ( AVCodecContext avctx,
TileContext tile,
AVFrame frame,
const uint8_t *  data,
int  size,
int  component,
int16_t *  qmat 
)
static

Definition at line 130 of file prores_raw.c.

Referenced by decode_tile().

◆ decode_tile()

static int decode_tile ( AVCodecContext avctx,
TileContext tile,
AVFrame frame 
)
static

Definition at line 249 of file prores_raw.c.

Referenced by decode_tiles().

◆ decode_tiles()

static int decode_tiles ( AVCodecContext avctx,
void *  arg,
int  n,
int  thread_nb 
)
static

Definition at line 304 of file prores_raw.c.

Referenced by decode_frame().

◆ get_pixel_format()

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

Definition at line 314 of file prores_raw.c.

Referenced by decode_frame().

◆ decode_frame()

static int decode_frame ( AVCodecContext avctx,
AVFrame frame,
int *  got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 328 of file prores_raw.c.

◆ decode_end()

static av_cold int decode_end ( AVCodecContext avctx)
static

Definition at line 496 of file prores_raw.c.

Variable Documentation

◆ align_tile_w

const uint8_t align_tile_w[16]
static
Initial value:
= {
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
}

Definition at line 98 of file prores_raw.c.

Referenced by decode_frame().

◆ ff_prores_raw_dc_cb

const uint8_t ff_prores_raw_dc_cb[DC_CB_MAX+1]
Initial value:
= {
16, 33, 50, 51, 51, 51, 68, 68, 68, 68, 68, 68, 118,
}

Definition at line 103 of file prores_raw.c.

Referenced by decode_comp(), and vk_decode_prores_raw_init().

◆ ff_prores_raw_ac_cb

const int16_t ff_prores_raw_ac_cb[AC_CB_MAX+1]
Initial value:
= {
0, 529, 273, 273, 546, 546, 546, 290, 290, 290, 563, 563,
563, 563, 563, 563, 563, 563, 307, 307, 580, 580, 580, 580,
580, 580, 580, 580, 580, 580, 580, 580, 580, 580, 580, 580,
580, 580, 580, 580, 580, 580, 853, 853, 853, 853, 853, 853,
853, 853, 853, 853, 853, 853, 853, 853, 853, 853, 853, 853,
853, 853, 853, 853, 853, 853, 853, 853, 853, 853, 853, 853,
853, 853, 853, 853, 853, 853, 853, 853, 853, 853, 853, 853,
853, 853, 853, 853, 853, 853, 853, 853, 853, 853, 358
}

Definition at line 108 of file prores_raw.c.

Referenced by decode_comp(), and vk_decode_prores_raw_init().

◆ ff_prores_raw_rn_cb

const int16_t ff_prores_raw_rn_cb[RN_CB_MAX+1]
Initial value:
= {
512, 256, 0, 0, 529, 529, 273, 273, 17, 17, 33, 33, 546,
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 50, 50, 68,
}

Definition at line 120 of file prores_raw.c.

Referenced by decode_comp(), and vk_decode_prores_raw_init().

◆ ff_prores_raw_ln_cb

const int16_t ff_prores_raw_ln_cb[LN_CB_MAX+1]
Initial value:
= {
256, 273, 546, 546, 290, 290, 1075, 1075, 563, 563, 563, 563, 563, 563, 51
}

Definition at line 126 of file prores_raw.c.

Referenced by decode_comp(), and vk_decode_prores_raw_init().

◆ ff_prores_raw_decoder

const FFCodec ff_prores_raw_decoder
Initial value:

Definition at line 516 of file prores_raw.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
decode_end
static av_cold int decode_end(AVCodecContext *avctx)
Definition: prores_raw.c:496
close
static av_cold void close(AVCodecParserContext *s)
Definition: apv_parser.c:135
AV_CODEC_ID_PRORES_RAW
@ AV_CODEC_ID_PRORES_RAW
Definition: codec_id.h:333
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: prores_raw.c:43
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:341
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:326
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
ProResRAWContext
Definition: prores_raw.h:36
UPDATE_THREAD_CONTEXT
#define UPDATE_THREAD_CONTEXT(func)
Definition: codec_internal.h:335
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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
decode_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: prores_raw.c:328
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:54
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
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