65 const int qscale = a->
qscale;
71 component = (n <= 3 ? 0 : n - 4 + 1);
76 block[0] = a->
last_dc[component] << 3;
89 }
else if (level != 0) {
93 "ac-tex damaged at %d %d\n", a->
mb_x, a->
mb_y);
97 level = (level * qscale * quant_matrix[j]) >> 3;
108 "ac-tex damaged at %d %d\n", a->
mb_x, a->
mb_y);
114 level = (level * qscale * quant_matrix[j]) >> 3;
115 level = (level - 1) | 1;
118 level = (level * qscale * quant_matrix[j]) >> 3;
119 level = (level - 1) | 1;
134 static const int block_index[6] = { 5, 4, 0, 1, 2, 3 };
138 for (i = 0; i < 6; i++) {
140 block_index[i])) < 0)
153 uint8_t *dest_y = frame->
data[0] + (mb_y * 16* linesize ) + mb_x * 16;
169 void *
data,
int *got_frame,
174 int buf_size = avpkt->
size;
static int decode_mb(MDECContext *a, int16_t block[6][64])
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
int coded_width
Bitstream width / height, may be different from width/height e.g.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int init_thread_copy(AVCodecContext *avctx)
av_cold void ff_mpeg12_init_vlcs(void)
void(* bswap16_buf)(uint16_t *dst, const uint16_t *src, int len)
static av_cold int init(AVCodecContext *avctx)
enum AVColorRange color_range
MPEG vs JPEG YUV range.
void(* clear_blocks)(int16_t *blocks)
#define DECLARE_ALIGNED(n, t, v)
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 int get_sbits(GetBitContext *s, int n)
Multithreading support functions.
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static int get_bits_count(const GetBitContext *s)
#define AV_CODEC_FLAG_GRAY
Only decode/encode grayscale.
static int get_bits_left(GetBitContext *gb)
#define UPDATE_CACHE(name, gb)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int flags
AV_CODEC_FLAG_*.
const char * name
Name of the codec implementation.
#define CLOSE_READER(name, gb)
static int decode_dc(GetBitContext *gb, int component)
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
#define GET_RL_VLC(level, run, name, gb, table, bits,max_depth, need_update)
#define SKIP_BITS(name, gb, num)
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
enum AVPictureType pict_type
Picture type of the frame.
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
int idct_algo
IDCT algorithm, see FF_IDCT_* below.
unsigned int bitstream_buffer_size
#define LAST_SKIP_BITS(name, gb, num)
uint8_t * bitstream_buffer
uint8_t idct_permutation[64]
IDCT input permutation.
RL_VLC_ELEM * rl_vlc[32]
decoding only
#define SHOW_UBITS(name, gb, num)
the normal 2^n-1 "JPEG" YUV ranges
void(* idct_put)(uint8_t *dest, int line_size, int16_t *block)
block -> idct -> clip to unsigned 8 bit -> dest.
Libavcodec external API header.
av_cold void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx)
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.
int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
main external API structure.
#define OPEN_READER(name, gb)
static av_cold int decode_end(AVCodecContext *avctx)
static void skip_bits(GetBitContext *s, int n)
static int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n)
const uint16_t ff_mpeg1_default_intra_matrix[256]
const uint8_t ff_zigzag_direct[64]
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
#define SHOW_SBITS(name, gb, num)
av_cold void ff_bswapdsp_init(BswapDSPContext *c)
static av_always_inline int diff(const uint32_t a, const uint32_t b)
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)
int key_frame
1 -> keyframe, 0-> not
static void idct_put(MDECContext *a, AVFrame *frame, int mb_x, int mb_y)
static av_cold int decode_init(AVCodecContext *avctx)
This structure stores compressed data.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.