63 3, 4, 19, 20, 35, 36, 51, 52
67 1, 4, 3, 6, 3, 6, 3, 6
71 1, 1, 1, 1, 2, 2, 3, 3
75 4, 5, 5, 4, 5, 4, 6, 4, 5, 6, 4, 4, 4, 4, 4, 2
79 3, 5, 4, 9, 3, 7, 2, 11, 2, 3, 5, 10, 4, 8, 6, 3
83 0, 1, 2, 3, 4, 16, 17, 18, 19, 20, 32, 33, 34, 35, 48, 50, 51, 52
87 1, 3, 3, 5, 6, 4, 7, 7, 8, 9, 4, 7, 7, 8, 6, 8, 7, 9
91 1, 3, 2, 3, 4, 3, 7, 5, 4, 4, 2, 6, 4, 3, 5, 5, 3, 2
95 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0x81, 0x82, 0x83,
96 0x84, 0x85, 0x86, 0x101, 0x102, 0x103, 0x104, 0x181, 0x182, 0x183, 0x201, 0x202,
97 0x203, 0x281, 0x282, 0x283, 0x301, 0x302, 0x303, 0x381, 0x382, 0x401, 0x402,
98 0x481, 0x482, 0x501, 0x502, 0x581, 0x601, 0x681, 0x701, 0x781, 0x801, 0x881,
99 0x901, 0x981, 0xA01, 0xA81, 0xB01, 0xB81, 0xC01, 0xC81, 0xD01, 0x4001, 0x4002,
100 0x4003, 0x4081, 0x4082, 0x4101, 0x4181, 0x4201, 0x4281, 0x4301, 0x4381, 0x4401,
101 0x4481, 0x4501, 0x4581, 0x4601, 0x4681, 0x4701, 0x4781, 0x4801, 0x4881, 0x4901,
102 0x4981, 0x4A01, 0x4A81, 0x4B01, 0x4B81, 0x4C01, 0x4C81, 0x4D01, 0x4D81, 0x4E01,
103 0x4E81, 0x4F01, 0x4F81, 0x5001, 0x5081, 0x5101, 0x5181, 0x5201, 0x5281, 0x5301,
108 7, 2, 4, 6, 7, 8, 9, 9, 10, 10, 11, 11, 11, 3, 6, 8, 10, 11, 12, 4, 8,
109 10, 12, 5, 9, 10, 5, 9, 12, 5, 10, 12, 6, 10, 12, 6, 10, 6, 10, 6,
110 10, 7, 12, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 11, 11, 12, 12, 4, 9,
111 11, 6, 11, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9,
112 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12,
117 3, 2, 15, 21, 23, 31, 37, 36, 33, 32, 7, 6, 32, 6, 20, 30, 15, 33, 80,
118 14, 29, 14, 81, 13, 35, 13, 12, 34, 82, 11, 12, 83, 19, 11, 84, 18,
119 10, 17, 9, 16, 8, 22, 85, 21, 20, 28, 27, 33, 32, 31, 30, 29, 28,
120 27, 26, 34, 35, 86, 87, 7, 25, 5, 15, 4, 14, 13, 12, 19, 18, 17, 16,
121 26, 25, 24, 23, 22, 21, 20, 19, 24, 23, 22, 21, 20, 19, 18, 17, 7,
122 6, 5, 4, 36, 37, 38, 39, 88, 89, 90, 91, 92, 93, 94, 95
138 return x ? value : 15 -
value;
146 int i, last,
len, factor2;
148 for (i = !flag; i < 64; i++) {
159 factor2 = value & 0x7F;
160 last = (value >> 14) & 1;
161 len = (value >> 7) & 0x3F;
168 s->
block[
block][scantable[i]] = offset * (factor2 < 0 ? -1 : 1) + factor * factor2;
185 for (i = 0; i < 6; i++) {
193 s->
block[i][scantable[0]] = x;
196 if (cbp & (1 << (5 - i))) {
209 int ret, x, y,
offset = 0;
230 for (y = 0; y < avctx->
height; y += 16) {
231 for (x = 0; x < avctx->
width; x += 16) {
232 unsigned cbphi, cbplo;
239 ret =
decode_blocks(avctx, gb, cbplo | (cbphi << 2), 0, offset);
265 int ret, x, y,
offset = 0;
286 for (y = 0; y < avctx->
height; y += 16) {
287 for (x = 0; x < avctx->
width; x += 16) {
289 unsigned cbphi, cbplo;
296 prev->
data[1] + (y >> 1) * prev->
linesize[1] + (x >> 1),
299 prev->
data[2] + (y >> 1) * prev->
linesize[2] + (x >> 1),
308 intra_block = value & 0x07;
309 reverse = intra_block == 3;
316 ret =
decode_blocks(avctx, gb, cbplo | (cbphi << 2), 0, offset);
334 ret =
decode_blocks(avctx, gb, cbplo | (cbphi << 2), 1, offset);
342 prev->
data[1] + (y >> 1) * prev->
linesize[1] + (x >> 1),
345 prev->
data[2] + (y >> 1) * prev->
linesize[2] + (x >> 1),
376 if (avpkt->
size <= 32)
385 (uint32_t *)avpkt->
data,
386 (avpkt->
size + 3) >> 2);
394 scaled = avpkt->
data[8];
427 (avctx->
width != width || avctx->
height != height)) {
503 for (
int i = 0; i < 64; i++)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
void(* bswap_buf)(uint32_t *dst, const uint32_t *src, int w)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static const uint8_t blktype_bits[]
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static av_cold int init(AVCodecContext *avctx)
enum AVColorRange color_range
MPEG vs JPEG YUV range.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
Same behaviour av_fast_malloc but the buffer has additional AV_INPUT_BUFFER_PADDING_SIZE at the end w...
static void copy_block8(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride, int h)
static int get_sbits(GetBitContext *s, int n)
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static const uint16_t block_symbols[]
static int get_cbphi(GetBitContext *gb, int x)
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
static uint32_t reverse(uint32_t num, int bits)
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
static av_cold void imm4_init_static_data(void)
bitstream reader API header.
static const uint16_t table[]
static const uint8_t blktype_codes[]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const char * name
Name of the codec implementation.
static const uint8_t offset[127][2]
static int decode_inter(AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame, AVFrame *prev)
static const uint8_t cbplo_codes[]
static av_cold int decode_close(AVCodecContext *avctx)
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
GLsizei GLboolean const GLfloat * value
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
ScanTable intra_scantable
uint8_t idct_permutation[64]
IDCT input permutation.
#define FF_ARRAY_ELEMS(a)
the normal 2^n-1 "JPEG" YUV ranges
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size)
Libavcodec external API header.
static const uint8_t cbphi_codes[]
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits1(GetBitContext *s)
void(* idct_add)(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
static void skip_bits(GetBitContext *s, int n)
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static const int factor[16]
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static void copy_block16(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride, int h)
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static const uint8_t cbphi_bits[]
static const uint8_t block_codes[]
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
common internal api header.
void(* idct_put)(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
block -> idct -> clip to unsigned 8 bit -> dest.
static const uint8_t inter_cb[]
static const uint8_t cbplo_bits[]
av_cold void ff_bswapdsp_init(BswapDSPContext *c)
av_cold void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
static int ff_thread_once(char *control, void(*routine)(void))
VLC_TYPE(* table)[2]
code, bits
int key_frame
1 -> keyframe, 0-> not
static int decode_blocks(AVCodecContext *avctx, GetBitContext *gb, unsigned cbp, int flag, int offset)
static const uint8_t block_bits[]
static const uint8_t intra_cb[]
static int decode_block(AVCodecContext *avctx, GetBitContext *gb, int block, int factor, int flag, int offset)
static const uint8_t cbplo_symbols[]
This structure stores compressed data.
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
mode
Use these values in ebur128_init (or'ed).
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static const uint8_t blktype_symbols[]
static av_cold int decode_init(AVCodecContext *avctx)
static int decode_intra(AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame)