FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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.
 
static int get_quant (AVCodecContext *avctx, NuvContext *c, const uint8_t *buf, int size)
 extract quantization tables from codec data into our context
 
static void get_quant_quality (NuvContext *c, int quality)
 set quantization tables from a quality value
 
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

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().

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 86 of file nuv.c.

Referenced by decode_frame(), and decode_init().

static void get_quant_quality ( NuvContext c,
int  quality 
)
static

set quantization tables from a quality value

Definition at line 104 of file nuv.c.

Referenced by codec_reinit().

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

Definition at line 114 of file nuv.c.

Referenced by decode_frame(), and decode_init().

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

Definition at line 151 of file nuv.c.

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 303 of file nuv.c.

static av_cold int decode_end ( AVCodecContext avctx)
static

Definition at line 331 of file nuv.c.

Variable Documentation

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().

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().

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 = CODEC_CAP_DR1,
}

Definition at line 341 of file nuv.c.