45 #define EA_PREAMBLE_SIZE 8
46 #define MADk_TAG MKTAG('M', 'A', 'D', 'k')
47 #define MADm_TAG MKTAG('M', 'A', 'D', 'm')
48 #define MADe_TAG MKTAG('M', 'A', 'D', 'e')
85 static inline void comp(
unsigned char *dst, ptrdiff_t dst_stride,
86 unsigned char *
src, ptrdiff_t src_stride,
int add)
96 int j,
int mv_x,
int mv_y,
int add)
119 int mb_x,
int mb_y,
int j)
137 const uint8_t *scantable =
s->scantable.permutated;
138 int16_t *quant_matrix =
s->quant_matrix;
154 }
else if (
level != 0) {
158 "ac-tex damaged at %d %d\n",
s->mb_x,
s->mb_y);
177 "ac-tex damaged at %d %d\n",
s->mb_x,
s->mb_y);
225 for (j=0; j<6; j++) {
226 if (mv_map & (1<<j)) {
228 if (
s->last_frame->data[0])
231 s->bdsp.clear_block(
s->block);
250 void *
data,
int *got_frame,
254 int buf_size = avpkt->
size;
264 chunk_type = bytestream2_get_le32(&gb);
269 bytestream2_get_le16(&gb), 1000, 1<<30);
271 width = bytestream2_get_le16(&gb);
272 height = bytestream2_get_le16(&gb);
298 if (inter && !
s->last_frame->data[0]) {
303 memset(
s->last_frame->data[0], 0,
s->last_frame->height *
304 s->last_frame->linesize[0]);
305 memset(
s->last_frame->data[1], 0x80,
s->last_frame->height / 2 *
306 s->last_frame->linesize[1]);
307 memset(
s->last_frame->data[2], 0x80,
s->last_frame->height / 2 *
308 s->last_frame->linesize[2]);
313 if (!
s->bitstream_buf)
315 s->bbdsp.bswap16_buf(
s->bitstream_buf, (
const uint16_t *)(buf +
bytestream2_tell(&gb)),
320 for (
s->mb_y=0;
s->mb_y < (avctx->
height+15)/16;
s->mb_y++)
321 for (
s->mb_x=0;
s->mb_x < (avctx->
width +15)/16;
s->mb_x++)
const uint16_t ff_inv_aanscales[64]
AAN (Arai, Agui and Nakajima) (I)DCT tables.
Libavcodec external API header.
static av_cold int init(AVCodecContext *avctx)
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
static av_always_inline int bytestream2_tell(GetByteContext *g)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static float add(float src0, float src1)
void ff_ea_idct_put_c(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
static void idct_put(MadContext *t, AVFrame *frame, int16_t *block, int mb_x, int mb_y, int j)
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
static int decode_motion(GetBitContext *gb)
static void calc_quant_matrix(MadContext *s, int qscale)
static int decode_block_intra(MadContext *s, int16_t *block)
static int decode_mb(MadContext *s, AVFrame *frame, int inter)
static av_cold int decode_init(AVCodecContext *avctx)
static av_cold int decode_end(AVCodecContext *avctx)
static void comp_block(MadContext *t, AVFrame *frame, int mb_x, int mb_y, int j, int mv_x, int mv_y, int add)
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
bitstream reader API header.
static int get_sbits(GetBitContext *s, int n)
#define CLOSE_READER(name, gb)
#define SHOW_UBITS(name, gb, num)
static unsigned int get_bits1(GetBitContext *s)
#define SHOW_SBITS(name, gb, num)
static int decode210(GetBitContext *gb)
#define OPEN_READER(name, gb)
#define SKIP_BITS(name, gb, num)
#define GET_RL_VLC(level, run, name, gb, table, bits, max_depth, need_update)
#define UPDATE_CACHE(name, gb)
#define LAST_SKIP_BITS(name, gb, num)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
#define AV_CODEC_FLAG_GRAY
Only decode/encode grayscale.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
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...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
av_cold void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
av_cold void ff_init_scantable_permutation(uint8_t *idct_permutation, enum idct_permutation_type perm_type)
av_cold void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx)
av_cold void ff_bswapdsp_init(BswapDSPContext *c)
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
const uint8_t ff_zigzag_direct[64]
av_cold void ff_mpeg12_init_vlcs(void)
const uint16_t ff_mpeg1_default_intra_matrix[256]
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
int flags
AV_CODEC_FLAG_*.
const char * name
Name of the codec implementation.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
This structure stores compressed data.
uint16_t quant_matrix[64]
unsigned int bitstream_buf_size
RL_VLC_ELEM * rl_vlc[32]
decoding only
static const uint8_t offset[127][2]