FFmpeg
Loading...
Searching...
No Matches
prores_raw.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem_internal.h"
#include "libavutil/mem.h"
#include "libavutil/raw_color_params.h"
#include "libavutil/rational.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)
 
#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 uint16_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

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 31 of file prores_raw.c.

◆ TODCCODEBOOK

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

Definition at line 102 of file prores_raw.c.

Referenced by decode_comp().

◆ DC_CB_MAX

#define DC_CB_MAX   12

Definition at line 104 of file prores_raw.c.

Referenced by decode_comp().

◆ AC_CB_MAX

#define AC_CB_MAX   94

Definition at line 109 of file prores_raw.c.

Referenced by decode_comp().

◆ RN_CB_MAX

#define RN_CB_MAX   27

Definition at line 121 of file prores_raw.c.

Referenced by decode_comp().

◆ LN_CB_MAX

#define LN_CB_MAX   14

Definition at line 127 of file prores_raw.c.

Referenced by decode_comp().

Function Documentation

◆ decode_init()

static av_cold int decode_init ( AVCodecContext * avctx)
static

Definition at line 47 of file prores_raw.c.

◆ get_value()

static uint16_t get_value ( GetBitContext * gb,
int16_t codebook )
static

Definition at line 70 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 132 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

Any data between last tile and frame end is vendor-specific metadata: [psim record] 4 be32 size + "psim" + pascal string + payload <more records, if any>, or: [eomd] 4 be32 size=8 + "eomd" fourcc (end of metadata) [padding] zero-fill to next-frame alignment

Known records (feel free to extend): com.panasonic.Semi-Pro.optical_correction (IEEE doubles): R - radial polynomial? + padding: [ k0, k1, k2, k3, pad0, pad1 ] G, B: same Trailer: optical center in normalized frame coords: [ x, y ]

Definition at line 331 of file prores_raw.c.

◆ decode_end()

static av_cold int decode_end ( AVCodecContext * avctx)
static

Definition at line 597 of file prores_raw.c.

Variable Documentation

◆ ff_prores_raw_dc_cb

const uint8_t ff_prores_raw_dc_cb[DC_CB_MAX+1]
Initial value:
= {
0x010, 0x021, 0x032, 0x033, 0x033, 0x033, 0x044, 0x044, 0x044, 0x044, 0x044, 0x044, 0x076,
}

Definition at line 105 of file prores_raw.c.

Referenced by decode_comp().

◆ ff_prores_raw_ac_cb

const int16_t ff_prores_raw_ac_cb[AC_CB_MAX+1]
Initial value:
= {
0x000, 0x211, 0x111, 0x111, 0x222, 0x222, 0x222, 0x122, 0x122, 0x122,
0x233, 0x233, 0x233, 0x233, 0x233, 0x233, 0x233, 0x233, 0x133, 0x133,
0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244,
0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244,
0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355,
0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355,
0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355,
0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x166,
}

Definition at line 110 of file prores_raw.c.

Referenced by decode_comp().

◆ ff_prores_raw_rn_cb

const int16_t ff_prores_raw_rn_cb[RN_CB_MAX+1]
Initial value:
= {
0x200, 0x100, 0x000, 0x000, 0x211, 0x211, 0x111, 0x111, 0x011, 0x011, 0x021, 0x021, 0x222, 0x022,
0x022, 0x022, 0x022, 0x022, 0x022, 0x022, 0x022, 0x022, 0x022, 0x022, 0x022, 0x032, 0x032, 0x044
}

Definition at line 122 of file prores_raw.c.

Referenced by decode_comp().

◆ ff_prores_raw_ln_cb

const int16_t ff_prores_raw_ln_cb[LN_CB_MAX+1]
Initial value:
= {
0x100, 0x111, 0x222, 0x222, 0x122, 0x122, 0x433, 0x433, 0x233, 0x233, 0x233, 0x233, 0x233, 0x233, 0x033,
}

Definition at line 128 of file prores_raw.c.

Referenced by decode_comp().

◆ ff_prores_raw_decoder

const FFCodec ff_prores_raw_decoder
Initial value:
= {
.p.name = "prores_raw",
CODEC_LONG_NAME("Apple ProRes RAW"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(ProResRAWContext),
UPDATE_THREAD_CONTEXT(update_thread_context),
.p.capabilities = AV_CODEC_CAP_DR1 |
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP |
.hw_configs = (const AVCodecHWConfigInternal *const []) {
},
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
#define UPDATE_THREAD_CONTEXT(func)
#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...
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define NULL
Definition coverity.c:32
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Definition codec.h:102
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition codec.h:98
@ AV_CODEC_ID_PRORES_RAW
Definition codec_id.h:324
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold int decode_init(AVCodecContext *avctx)
Definition 4xm.c:998
static av_cold int decode_end(AVCodecContext *avctx)
Definition 4xm.c:980
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
Definition 4xm.c:837

Definition at line 618 of file prores_raw.c.