FFmpeg
Data Structures | Functions | Variables
nuv.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include "libavutil/bswap.h"
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/lzo.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "idctdsp.h"
#include "internal.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, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int decode_init (AVCodecContext *avctx)
 
static av_cold int decode_end (AVCodecContext *avctx)
 

Variables

static const uint8_t fallback_lquant []
 
static const uint8_t fallback_cquant []
 
AVCodec 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 76 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 89 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 107 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 117 of file nuv.c.

Referenced by decode_frame(), and decode_init().

◆ decode_frame()

static int decode_frame ( AVCodecContext avctx,
void *  data,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 154 of file nuv.c.

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 325 of file nuv.c.

◆ decode_end()

static av_cold int decode_end ( AVCodecContext avctx)
static

Definition at line 353 of file nuv.c.

Variable Documentation

◆ fallback_lquant

const uint8_t fallback_lquant[]
static
Initial value:
= {
16, 11, 10, 16, 24, 40, 51, 61,
12, 12, 14, 19, 26, 58, 60, 55,
14, 13, 16, 24, 40, 57, 69, 56,
14, 17, 22, 29, 51, 87, 80, 62,
18, 22, 37, 56, 68, 109, 103, 77,
24, 35, 55, 64, 81, 104, 113, 92,
49, 64, 78, 87, 103, 121, 120, 101,
72, 92, 95, 98, 112, 100, 103, 99
}

Definition at line 47 of file nuv.c.

Referenced by get_quant_quality().

◆ fallback_cquant

const uint8_t fallback_cquant[]
static
Initial value:
= {
17, 18, 24, 47, 99, 99, 99, 99,
18, 21, 26, 66, 99, 99, 99, 99,
24, 26, 56, 99, 99, 99, 99, 99,
47, 66, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99
}

Definition at line 58 of file nuv.c.

Referenced by get_quant_quality().

◆ ff_nuv_decoder

AVCodec ff_nuv_decoder
Initial value:
= {
.name = "nuv",
.long_name = NULL_IF_CONFIG_SMALL("NuppelVideo/RTJPEG"),
.priv_data_size = sizeof(NuvContext),
.close = decode_end,
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 363 of file nuv.c.

init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
AV_CODEC_ID_NUV
@ AV_CODEC_ID_NUV
Definition: avcodec.h:302
NuvContext
Definition: nuv.c:36
decode_end
static av_cold int decode_end(AVCodecContext *avctx)
Definition: nuv.c:353
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:981
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
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: internal.h:48
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: nuv.c:325
decode_frame
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: nuv.c:154