26 #define PUT_COEFF(c) \
28 block[i] = (c) * quant[i];
32 n = (-get_bits_count(gb)) & (a - 1); \
33 if (n) {skip_bits(gb, n);}
48 const uint32_t *
quant) {
64 memset(block, 0, 64 *
sizeof(
DCTELEM));
108 const uint8_t *buf,
int buf_size) {
110 int w = c->
w / 16, h = c->
h / 16;
113 uint8_t *u = f->
data[1], *
v = f->
data[2];
115 for (y = 0; y < h; y++) {
116 for (x = 0; x < w; x++) {
117 #define BLOCK(quant, dst, stride) do { \
118 int res = get_block(&gb, block, c->scan, quant); \
122 c->dsp->idct_put(dst, stride, block); \
159 const uint32_t *lquant,
const uint32_t *cquant) {
162 for (i = 0; i < 64; i++) {
165 z = ((z << 3) | (z >> 3)) & 63;
const uint8_t ff_zigzag_direct[64]
int rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f, const uint8_t *buf, int buf_size)
decode one rtjpeg YUV420 frame
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
void 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
static int get_sbits(GetBitContext *s, int n)
#define BLOCK(quant, dst, stride)
static int get_bits_count(const GetBitContext *s)
bitstream reader API header.
uint8_t idct_permutation[64]
idct input permutation.
static int get_bits_left(GetBitContext *gb)
static int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *scan, const uint32_t *quant)
read one block from stream
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
#define ALIGN(a)
aligns the bitstream to the given power of two
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal and external API header