FFmpeg
Data Structures | Functions | Variables
nuv.c File Reference
#include <stddef.h>
#include <limits.h>
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/lzo.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "jpegquanttables.h"
#include "rtjpeg.h"

Go to the source code of this file.

Data Structures

struct  NuvContext
 

Functions

static void copy_frame (AVFrame *f, const uint8_t *src, int width, int height)
 copy frame data from buffer to AVFrame, handling stride. More...
 
static int get_quant (AVCodecContext *avctx, NuvContext *c, const uint8_t *buf, int size)
 extract quantization tables from codec data into our context More...
 
static void get_quant_quality (NuvContext *c, int quality)
 set quantization tables from a quality value More...
 
static int codec_reinit (AVCodecContext *avctx, int width, int height, int quality)
 
static int decode_frame (AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
 
static av_cold int decode_init (AVCodecContext *avctx)
 
static av_cold int decode_end (AVCodecContext *avctx)
 

Variables

const FFCodec ff_nuv_decoder
 

Function Documentation

◆ copy_frame()

static void copy_frame ( AVFrame f,
const uint8_t *  src,
int  width,
int  height 
)
static

copy frame data from buffer to AVFrame, handling stride.

Parameters
fdestination AVFrame
srcsource buffer, does not use any line-stride
widthwidth of the video frame
heightheight of the video frame

Definition at line 53 of file nuv.c.

Referenced by decode_frame().

◆ get_quant()

static int get_quant ( AVCodecContext avctx,
NuvContext c,
const uint8_t *  buf,
int  size 
)
static

extract quantization tables from codec data into our context

Definition at line 66 of file nuv.c.

Referenced by decode_frame(), and decode_init().

◆ get_quant_quality()

static void get_quant_quality ( NuvContext c,
int  quality 
)
static

set quantization tables from a quality value

Definition at line 84 of file nuv.c.

Referenced by codec_reinit().

◆ codec_reinit()

static int codec_reinit ( AVCodecContext avctx,
int  width,
int  height,
int  quality 
)
static

Definition at line 94 of file nuv.c.

Referenced by decode_frame(), and decode_init().

◆ decode_frame()

static int decode_frame ( AVCodecContext avctx,
AVFrame picture,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 131 of file nuv.c.

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 306 of file nuv.c.

◆ decode_end()

static av_cold int decode_end ( AVCodecContext avctx)
static

Definition at line 334 of file nuv.c.

Variable Documentation

◆ ff_nuv_decoder

const FFCodec ff_nuv_decoder
Initial value:
= {
.p.name = "nuv",
CODEC_LONG_NAME("NuppelVideo/RTJPEG"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_NUV,
.priv_data_size = sizeof(NuvContext),
.close = decode_end,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 344 of file nuv.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_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
Definition: nuv.c:131
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:306
AV_CODEC_ID_NUV
@ AV_CODEC_ID_NUV
Definition: codec_id.h:136
NuvContext
Definition: nuv.c:35
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
decode_end
static av_cold int decode_end(AVCodecContext *avctx)
Definition: nuv.c:334
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: nuv.c:306