FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
rawdec.c File Reference

Raw Video Decoder. More...

#include "avcodec.h"
#include "bswapdsp.h"
#include "get_bits.h"
#include "internal.h"
#include "raw.h"
#include "libavutil/avassert.h"
#include "libavutil/buffer.h"
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"

Go to the source code of this file.

Data Structures

struct  RawVideoContext
 

Macros

#define SCALE16(x, bits)   (((x) << (16 - (bits))) | ((x) >> (2 * (bits) - 16)))
 
#define MKSCALE16(name, r16, w16)
 Scale buffer to 16 bits per coded sample resolution. More...
 

Functions

static av_cold int raw_init_decoder (AVCodecContext *avctx)
 
static void flip (AVCodecContext *avctx, AVPicture *picture)
 
static int raw_decode (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int raw_close_decoder (AVCodecContext *avctx)
 

Variables

static const AVOption options []
 
static const AVClass rawdec_class
 
AVCodec ff_rawvideo_decoder
 

Detailed Description

Raw Video Decoder.

Definition in file rawdec.c.

Macro Definition Documentation

#define SCALE16 (   x,
  bits 
)    (((x) << (16 - (bits))) | ((x) >> (2 * (bits) - 16)))

Definition at line 124 of file rawdec.c.

#define MKSCALE16 (   name,
  r16,
  w16 
)
Value:
static void name(AVCodecContext *avctx, uint8_t * dst, const uint8_t *buf, int buf_size, int packed) \
{ \
int i; \
if (!packed) { \
for (i = 0; i + 1 < buf_size; i += 2) \
w16(dst + i, SCALE16(r16(buf + i), avctx->bits_per_coded_sample)); \
} else { \
GetBitContext gb; \
init_get_bits(&gb, buf, buf_size * 8); \
for (i = 0; i < avctx->width * avctx->height; i++) { \
int sample = get_bits(&gb, avctx->bits_per_coded_sample); \
w16(dst + i*2, SCALE16(sample, avctx->bits_per_coded_sample)); \
} \
} \
}
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:260
#define sample
#define SCALE16(x, bits)
Definition: rawdec.c:124
if()
Definition: avfilter.c:975
uint8_t
main external API structure.
Definition: avcodec.h:1252
void * buf
Definition: avisynth_c.h:553
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:410
for(j=16;j >0;--j)
const char * name
Definition: opengl_enc.c:103

Scale buffer to 16 bits per coded sample resolution.

Definition at line 129 of file rawdec.c.

Function Documentation

static av_cold int raw_init_decoder ( AVCodecContext avctx)
static

Definition at line 65 of file rawdec.c.

static void flip ( AVCodecContext avctx,
AVPicture picture 
)
static
static int raw_decode ( AVCodecContext avctx,
void data,
int *  got_frame,
AVPacket avpkt 
)
static

Definition at line 149 of file rawdec.c.

static av_cold int raw_close_decoder ( AVCodecContext avctx)
static

Definition at line 357 of file rawdec.c.

Variable Documentation

const AVOption options[]
static
Initial value:
={
{"top", "top field first", 0x42, AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_VIDEO_PARAM},
}
#define NULL
Definition: coverity.c:32
#define AV_OPT_FLAG_VIDEO_PARAM
Definition: opt.h:291
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
Definition: opt.h:286

Definition at line 54 of file rawdec.c.

const AVClass rawdec_class
static
Initial value:
= {
.class_name = "rawdec",
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:62
static const AVOption options[]
Definition: rawdec.c:54

Definition at line 59 of file rawdec.c.

AVCodec ff_rawvideo_decoder
Initial value:
= {
.name = "rawvideo",
.long_name = NULL_IF_CONFIG_SMALL("raw video"),
.priv_data_size = sizeof(RawVideoContext),
.priv_class = &rawdec_class,
.capabilities = CODEC_CAP_PARAM_CHANGE,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define CODEC_CAP_PARAM_CHANGE
Codec supports changed parameters at any point.
Definition: avcodec.h:879
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:175
static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: rawdec.c:149
static av_cold int raw_close_decoder(AVCodecContext *avctx)
Definition: rawdec.c:357
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
Definition: ccaption_dec.c:522
static av_cold int raw_init_decoder(AVCodecContext *avctx)
Definition: rawdec.c:65
static const AVClass rawdec_class
Definition: rawdec.c:59

Definition at line 365 of file rawdec.c.