36 int coded_mb_count = 0;
43 for (mb_y = 0; mb_y < s->
mb_height; mb_y++)
44 for (mb_x = 0; mb_x < s->
mb_width; mb_x++)
51 for (mb_y = 0; mb_y < s->
mb_height; mb_y++)
52 for (mb_x = 0; mb_x < s->
mb_width; mb_x++)
57 for (mb_y = 0; mb_y < s->
mb_height; mb_y++) {
61 for (mb_x = 0; mb_x < s->
mb_width; mb_x++)
65 for (mb_x = 0; mb_x < s->
mb_width; mb_x++)
72 for (mb_x = 0; mb_x < s->
mb_width; mb_x++) {
76 for (mb_y = 0; mb_y < s->
mb_height; mb_y++)
80 for (mb_y = 0; mb_y < s->
mb_height; mb_y++)
88 for (mb_y = 0; mb_y < s->
mb_height; mb_y++)
89 for (mb_x = 0; mb_x < s->
mb_width; mb_x++)
127 "fps:%d, br:%"PRId64
", qpbit:%d, abt_flag:%d, j_type_bit:%d, " 128 "tl_mv_flag:%d, mbrl_bit:%d, code:%d, loop_filter:%d, " 160 if (
get_bits(&gb, block) + 1 != 1<<block)
206 "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n",
253 "rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d mspel:%d " 254 "per_mb_abt:%d abt_type:%d cbp:%d ii:%d\n",
291 if ((((*mx_ptr) | (*my_ptr)) & 1) && s->
mspel)
303 int16_t *
A, *
B, *
C, *mot_val;
327 }
else if (type == 1) {
348 static const int sub_cbp_table[3] = { 2, 3, 1 };
397 for (i = 0; i < 6; i++)
424 "II-cbp illegal at %d %d\n", s->
mb_x, s->
mb_y);
429 for (i = 0; i < 6; i++) {
430 int val = ((code >> (5 -
i)) & 1);
436 cbp |= val << (5 -
i);
467 for (i = 0; i < 6; i++) {
470 "\nerror while decoding inter block: %d x %d (%d)\n",
479 ((cbp & 3) ? 1 : 0) + ((cbp & 0x3C) ? 2 : 0),
494 for (i = 0; i < 6; i++) {
497 "\nerror while decoding intra block: %d x %d (%d)\n",
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
static av_cold int wmv2_decode_init(AVCodecContext *avctx)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static av_always_inline int wmv2_get_cbp_table_index(MpegEncContext *s, int cbp_index)
static av_cold int wmv2_decode_end(AVCodecContext *avctx)
int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
int ff_msmpeg4_decode_init(AVCodecContext *avctx)
int16_t abt_block2[6][64]
static int wmv2_decode_inter_block(Wmv2Context *w, int16_t *block, int n, int cbp)
static av_cold int init(AVCodecContext *avctx)
static int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr)
static int decode_ext_header(Wmv2Context *w)
#define MB_NON_INTRA_VLC_BITS
av_cold int ff_intrax8_common_init(AVCodecContext *avctx, IntraX8Context *w, IDCTDSPContext *idsp, int16_t(*block)[64], int block_last_index[12], int mb_width, int mb_height)
Initialize IntraX8 frame decoder.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
The exact code depends on how similar the blocks are and how related they are to the block
#define FF_DEBUG_PICT_INFO
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
int no_rounding
apply no rounding to motion compensation (MPEG-4, msmpeg4, ...) for B-frames rounding mode is always ...
Picture current_picture
copy of the current picture structure.
int ff_msmpeg4_decode_motion(MpegEncContext *s, int *mx_ptr, int *my_ptr)
int ff_intrax8_decode_picture(IntraX8Context *w, Picture *pict, GetBitContext *gb, int *mb_x, int *mb_y, int dquant, int quant_offset, int loopfilter, int lowdelay)
Decode single IntraX8 frame.
const uint8_t * scantable
int mb_height
number of MBs horizontally & vertically
static int get_bits_left(GetBitContext *gb)
int ff_wmv2_decode_picture_header(MpegEncContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void ff_er_add_slice(ERContext *s, int startx, int starty, int endx, int endy, int status)
Add a slice.
int rl_chroma_table_index
int mb_skipped
MUST BE SET only during DECODING.
void(* clear_blocks)(int16_t *blocks)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
const char * name
Name of the codec implementation.
int low_delay
no reordering needed / has no B-frames
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define AV_CODEC_CAP_DRAW_HORIZ_BAND
Decoder can use draw_horiz_band callback.
av_cold void ff_intrax8_common_end(IntraX8Context *w)
Destroy IntraX8 frame structure.
static int parse_mb_skip(Wmv2Context *w)
int16_t(*[2] motion_val)[2]
Picture * current_picture_ptr
pointer to the current picture
ScanTable abt_scantable[2]
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
int block_last_index[12]
last non zero coefficient in block
#define FRAME_SKIPPED
Return value for header parsers if frame is not coded.
static int16_t * wmv2_pred_motion(Wmv2Context *w, int *px, int *py)
int block_index[6]
index to current MB in block based arrays with edges
static const float pred[4]
s EdgeDetect Foobar g libavfilter vf_edgedetect c libavfilter vf_foobar c edit libavfilter and add an entry for foobar following the pattern of the other filters edit libavfilter allfilters and add an entry for foobar following the pattern of the other filters configure make j< whatever > ffmpeg ffmpeg i you should get a foobar png with Lena edge detected That s your new playground is ready Some little details about what s going which in turn will define variables for the build system and the C
#define MV_TYPE_16X16
1 vector for the whole mb
int first_slice_line
used in MPEG-4 too to handle resync markers
Libavcodec external API header.
main external API structure.
int height
picture size. must be a multiple of 16
static unsigned int get_bits1(GetBitContext *s)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
#define MB_INTRA_VLC_BITS
int slice_height
in macroblocks
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
static enum AVPixelFormat pix_fmts[]
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
int mv[2][4][2]
motion vectors for a macroblock first coordinate : 0 = forward 1 = backward second " : depend...
int b8_stride
2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
struct AVCodecContext * avctx
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
common internal api header.
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 ...
VLC ff_mb_non_intra_vlc[4]
int ff_h263_decode_end(AVCodecContext *avctx)
static av_always_inline int diff(const uint32_t a, const uint32_t b)
av_cold void ff_wmv2_common_init(Wmv2Context *w)
int16_t(* block)[64]
points to one of the following blocks
static int decode012(GetBitContext *gb)
VLC_TYPE(* table)[2]
code, bits
int64_t bit_rate
wanted bit rate
int chroma_qscale
chroma QP
int ff_msmpeg4_decode_block(MpegEncContext *s, int16_t *block, int n, int coded, const uint8_t *scan_table)
#define INTER_INTRA_VLC_BITS
uint32_t * mb_type
types and macros are defined in mpegutils.h
ScanTable inter_scantable
if inter == intra then intra should be used to reduce the cache usage
int ff_msmpeg4_coded_block_pred(MpegEncContext *s, int n, uint8_t **coded_block_ptr)
int h263_aic_dir
AIC direction: 0 = left, 1 = top.
AVPixelFormat
Pixel format.
static double val(void *priv, double ch)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.