Go to the documentation of this file.
60 uint8_t *dst,
int stride,
int n)
64 if (
s->block_last_index[n] >= 0) {
65 switch (
w->abt_type_table[n]) {
72 s->bdsp.clear_block(
w->abt_block2[n]);
77 s->bdsp.clear_block(
w->abt_block2[n]);
86 uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr)
105 int coded_mb_count = 0;
107 uint32_t *
const mb_type =
s->current_picture_ptr->mb_type;
110 switch (
w->skip_type) {
112 for (mb_y = 0; mb_y <
s->mb_height; mb_y++)
113 for (mb_x = 0; mb_x <
s->mb_width; mb_x++)
114 mb_type[mb_y *
s->mb_stride + mb_x] =
120 for (mb_y = 0; mb_y <
s->mb_height; mb_y++)
121 for (mb_x = 0; mb_x <
s->mb_width; mb_x++)
122 mb_type[mb_y *
s->mb_stride + mb_x] =
126 for (mb_y = 0; mb_y <
s->mb_height; mb_y++) {
130 for (mb_x = 0; mb_x <
s->mb_width; mb_x++)
131 mb_type[mb_y *
s->mb_stride + mb_x] =
134 for (mb_x = 0; mb_x <
s->mb_width; mb_x++)
135 mb_type[mb_y *
s->mb_stride + mb_x] =
141 for (mb_x = 0; mb_x <
s->mb_width; mb_x++) {
145 for (mb_y = 0; mb_y <
s->mb_height; mb_y++)
146 mb_type[mb_y *
s->mb_stride + mb_x] =
149 for (mb_y = 0; mb_y <
s->mb_height; mb_y++)
150 mb_type[mb_y *
s->mb_stride + mb_x] =
157 for (mb_y = 0; mb_y <
s->mb_height; mb_y++)
158 for (mb_x = 0; mb_x <
s->mb_width; mb_x++)
159 coded_mb_count += !
IS_SKIP(mb_type[mb_y *
s->mb_stride + mb_x]);
174 if (
s->avctx->extradata_size < 4)
192 s->slice_height =
s->mb_height /
code;
196 "fps:%d, br:%"PRId64
", qpbit:%d, abt_flag:%d, j_type_bit:%d, "
197 "tl_mv_flag:%d, mbrl_bit:%d, code:%d, loop_filter:%d, "
199 fps,
s->bit_rate,
w->mspel_bit,
w->abt_flag,
w->j_type_bit,
200 w->top_left_mv_flag,
w->per_mb_rl_bit,
code,
s->loop_filter,
210 if (
s->picture_number == 0)
218 s->chroma_qscale =
s->qscale =
get_bits(&
s->gb, 5);
251 if (
w->per_mb_rl_bit)
254 s->per_mb_rl_table = 0;
256 if (!
s->per_mb_rl_table) {
271 s->inter_intra_pred = 0;
275 "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n",
276 s->qscale,
s->rl_chroma_table_index,
s->rl_table_index,
277 s->dc_table_index,
s->per_mb_rl_table,
w->j_type);
301 if (
w->per_mb_rl_bit)
304 s->per_mb_rl_table = 0;
306 if (!
s->per_mb_rl_table) {
308 s->rl_chroma_table_index =
s->rl_table_index;
317 s->inter_intra_pred = 0;
322 "rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d mspel:%d "
323 "per_mb_abt:%d abt_type:%d cbp:%d ii:%d\n",
324 s->rl_table_index,
s->rl_chroma_table_index,
325 s->dc_table_index,
s->mv_table_index,
326 s->per_mb_rl_table,
s->qscale,
s->mspel,
327 w->per_mb_abt,
w->abt_type,
w->cbp_table_index,
328 s->inter_intra_pred);
331 s->esc3_level_length = 0;
332 s->esc3_run_length = 0;
337 &
s->gb, &
s->mb_x, &
s->mb_y,
338 2 *
s->qscale, (
s->qscale - 1) | 1,
339 s->loop_filter,
s->low_delay);
342 (
w->s.mb_x >> 1) - 1, (
w->s.mb_y >> 1) - 1,
356 if ((((*mx_ptr) | (*my_ptr)) & 1) &&
s->mspel)
359 w->common.hshift = 0;
366 int16_t *
A, *
B, *
C, *mot_val;
369 xy =
s->block_index[0];
371 mot_val =
s->current_picture.motion_val[0][xy];
373 A =
s->current_picture.motion_val[0][xy - 1];
374 B =
s->current_picture.motion_val[0][xy -
wrap];
375 C =
s->current_picture.motion_val[0][xy + 2 -
wrap];
377 if (
s->mb_x && !
s->first_slice_line && !
s->mspel &&
w->top_left_mv_flag)
390 }
else if (
type == 1) {
395 if (
s->first_slice_line) {
411 static const int sub_cbp_table[3] = { 2, 3, 1 };
415 s->block_last_index[n] = -1;
419 if (
w->per_block_abt)
421 w->abt_type_table[n] =
w->abt_type;
425 const uint8_t *scantable =
w->abt_scantable[
w->abt_type - 1].scantable;
438 s->block_last_index[n] = 63;
443 s->inter_scantable.permutated);
459 if (
IS_SKIP(
s->current_picture.mb_type[
s->mb_y *
s->mb_stride +
s->mb_x])) {
462 for (
i = 0;
i < 6;
i++)
463 s->block_last_index[
i] = -1;
469 w->common.hshift = 0;
477 s->mb_intra = (~
code & 0x40) >> 6;
487 for (
i = 0;
i < 6;
i++) {
494 cbp |=
val << (5 -
i);
503 s->bdsp.clear_blocks(
s->block[0]);
504 if (
s->per_mb_rl_table) {
506 s->rl_chroma_table_index =
s->rl_table_index;
509 if (
w->abt_flag &&
w->per_mb_abt) {
511 if (!
w->per_block_abt)
514 w->per_block_abt = 0;
524 for (
i = 0;
i < 6;
i++) {
527 "\nerror while decoding inter block: %d x %d (%d)\n",
528 s->mb_x,
s->mb_y,
i);
534 ff_dlog(
s->avctx,
"%d%d ",
s->inter_intra_pred, cbp);
535 ff_dlog(
s->avctx,
"I at %d %d %d %06X\n",
s->mb_x,
s->mb_y,
536 ((cbp & 3) ? 1 : 0) + ((cbp & 0x3C) ? 2 : 0),
539 if (
s->inter_intra_pred) {
543 s->ac_pred,
s->h263_aic_dir,
s->mb_x,
s->mb_y);
545 if (
s->per_mb_rl_table && cbp) {
547 s->rl_chroma_table_index =
s->rl_table_index;
550 s->bdsp.clear_blocks(
s->block[0]);
551 for (
i = 0;
i < 6;
i++) {
554 "\nerror while decoding intra block: %d x %d (%d)\n",
555 s->mb_x,
s->mb_y,
i);
570 s->private_ctx = &
w->common;
582 w->s.block,
w->s.block_last_index,
583 w->s.mb_width,
w->s.mb_height);
#define MV_TYPE_16X16
1 vector for the whole mb
AVPixelFormat
Pixel format.
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
static int get_bits_left(GetBitContext *gb)
static int wmv2_decode_inter_block(WMV2DecContext *w, int16_t *block, int n, int cbp)
int16_t abt_block2[6][64]
const FFCodec ff_wmv2_decoder
void ff_simple_idct84_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
static int16_t * wmv2_pred_motion(WMV2DecContext *w, int *px, int *py)
void ff_er_add_slice(ERContext *s, int startx, int starty, int endx, int endy, int status)
Add a slice.
void ff_wmv2_add_mb(MpegEncContext *s, int16_t block1[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static av_cold int wmv2_decode_end(AVCodecContext *avctx)
#define FF_DEBUG_PICT_INFO
int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
AVCodec p
The public AVCodec.
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.
VLC ff_mb_non_intra_vlc[4]
void ff_msmpeg4_decode_motion(MpegEncContext *s, int *mx_ptr, int *my_ptr)
static double val(void *priv, double ch)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
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 AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
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.
int ff_wmv2_decode_picture_header(MpegEncContext *s)
static av_always_inline int wmv2_get_cbp_table_index(MpegEncContext *s, int cbp_index)
#define FF_CODEC_DECODE_CB(func)
void ff_simple_idct48_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static int decode012(GetBitContext *gb)
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
ScanTable abt_scantable[2]
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
#define FRAME_SKIPPED
Return value for header parsers if frame is not coded.
static int parse_mb_skip(WMV2DecContext *w)
av_cold void ff_intrax8_common_end(IntraX8Context *w)
Destroy IntraX8 frame structure.
static int decode_ext_header(WMV2DecContext *w)
@ AV_PICTURE_TYPE_I
Intra.
static unsigned int get_bits1(GetBitContext *s)
#define INTER_INTRA_VLC_BITS
int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, int *got_frame, AVPacket *avpkt)
static av_always_inline int get_vlc2(GetBitContext *s, const VLCElem *table, int bits, int max_depth)
Parse a vlc code.
av_cold int ff_h263_decode_end(AVCodecContext *avctx)
static void wmv2_add_block(WMV2DecContext *w, int16_t *block1, uint8_t *dst, int stride, int n)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define MB_NON_INTRA_VLC_BITS
#define AV_CODEC_FLAG_GRAY
Only decode/encode grayscale.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
const uint8_t ff_wmv2_scantableB[64]
const uint8_t ff_wmv2_scantableA[64]
static void wmv2_decode_motion(WMV2DecContext *w, int *mx_ptr, int *my_ptr)
#define DECLARE_ALIGNED(n, t, v)
#define i(width, name, range_min, range_max)
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
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
av_cold void ff_init_scantable(const uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
int ff_msmpeg4_decode_block(MpegEncContext *s, int16_t *block, int n, int coded, const uint8_t *scan_table)
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
const char * name
Name of the codec implementation.
static const float pred[4]
main external API structure.
#define MB_INTRA_VLC_BITS
static av_cold int wmv2_decode_init(AVCodecContext *avctx)
@ AV_PICTURE_TYPE_P
Predicted.
static av_always_inline int diff(const uint32_t a, const uint32_t b)
int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
#define AV_CODEC_CAP_DRAW_HORIZ_BAND
Decoder can use draw_horiz_band callback.
The exact code depends on how similar the blocks are and how related they are to the block
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx)
static int16_t block1[64]
av_cold void ff_wmv2_common_init(MpegEncContext *s)
int ff_msmpeg4_coded_block_pred(MpegEncContext *s, int n, uint8_t **coded_block_ptr)