libavcodec/rtjpeg.c File Reference

#include "libavutil/common.h"
#include "get_bits.h"
#include "dsputil.h"
#include "rtjpeg.h"

Go to the source code of this file.

Defines

#define PUT_COEFF(c)
#define ALIGN(a)
 aligns the bitstream to the given power of two
#define BLOCK(quant, dst, stride)

Functions

static int get_block (GetBitContext *gb, DCTELEM *block, const uint8_t *scan, const uint32_t *quant)
 read one block from stream
int ff_rtjpeg_decode_frame_yuv420 (RTJpegContext *c, AVFrame *f, const uint8_t *buf, int buf_size)
 decode one rtjpeg YUV420 frame
void ff_rtjpeg_decode_init (RTJpegContext *c, DSPContext *dsp, int width, int height, const uint32_t *lquant, const uint32_t *cquant)
 initialize an RTJpegContext, may be called multiple times


Define Documentation

#define ALIGN (  ) 

Value:

n = (-get_bits_count(gb)) & (a - 1); \
    if (n) {skip_bits(gb, n);}
aligns the bitstream to the given power of two

Definition at line 31 of file rtjpeg.c.

Referenced by av_malloc(), get_block(), and realloc_audio().

#define BLOCK ( quant,
dst,
stride   ) 

Value:

do { \
    int res = get_block(&gb, block, c->scan, quant); \
    if (res < 0) \
        return res; \
    if (res > 0) \
        c->dsp->idct_put(dst, stride, block); \
} while (0)

Referenced by config(), ff_rtjpeg_decode_frame_yuv420(), filter(), and uninit().

#define PUT_COEFF ( c   ) 

Value:

i = scan[coeff--]; \
    block[i] = (c) * quant[i];

Definition at line 26 of file rtjpeg.c.

Referenced by get_block().


Function Documentation

int ff_rtjpeg_decode_frame_yuv420 ( RTJpegContext c,
AVFrame f,
const uint8_t buf,
int  buf_size 
)

decode one rtjpeg YUV420 frame

Parameters:
c context, must be initialized via ff_rtjpeg_decode_init
f AVFrame to place decoded frame into. If parts of the frame are not coded they are left unchanged, so consider initializing it
buf buffer containing input data
buf_size length of input data in bytes
Returns:
number of bytes consumed from the input buffer

Definition at line 107 of file rtjpeg.c.

Referenced by decode_frame().

void ff_rtjpeg_decode_init ( RTJpegContext c,
DSPContext dsp,
int  width,
int  height,
const uint32_t *  lquant,
const uint32_t *  cquant 
)

initialize an RTJpegContext, may be called multiple times

Parameters:
c context to initialize
dsp specifies the idct to use for decoding
width width of image, will be rounded down to the nearest multiple of 16 for decoding
height height of image, will be rounded down to the nearest multiple of 16 for decoding
lquant luma quantization table to use
cquant chroma quantization table to use

Definition at line 157 of file rtjpeg.c.

Referenced by codec_reinit(), and decode_frame().

static int get_block ( GetBitContext gb,
DCTELEM block,
const uint8_t scan,
const uint32_t *  quant 
) [inline, static]

read one block from stream

Parameters:
gb contains stream data
block where data is written to
scan array containing the mapping stream address -> block position
quant quantization factors
Returns:
0 means the block is not coded, < 0 means an error occurred.
Note: GetBitContext is used to make the code simpler, since all data is aligned this could be done faster in a different way, e.g. as it is done in MPlayer libmpcodecs/native/rtjpegn.c.

Definition at line 47 of file rtjpeg.c.


Generated on Fri Oct 26 02:47:58 2012 for FFmpeg by  doxygen 1.5.8