Go to the documentation of this file.
36 int coded_mb_count = 0;
38 uint32_t *
const mb_type =
s->current_picture_ptr->mb_type;
41 switch (
w->skip_type) {
43 for (mb_y = 0; mb_y <
s->mb_height; mb_y++)
44 for (mb_x = 0; mb_x <
s->mb_width; mb_x++)
45 mb_type[mb_y *
s->mb_stride + 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++)
53 mb_type[mb_y *
s->mb_stride + 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++)
62 mb_type[mb_y *
s->mb_stride + mb_x] =
65 for (mb_x = 0; mb_x <
s->mb_width; mb_x++)
66 mb_type[mb_y *
s->mb_stride + 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++)
77 mb_type[mb_y *
s->mb_stride + mb_x] =
80 for (mb_y = 0; mb_y <
s->mb_height; mb_y++)
81 mb_type[mb_y *
s->mb_stride + mb_x] =
88 for (mb_y = 0; mb_y <
s->mb_height; mb_y++)
89 for (mb_x = 0; mb_x <
s->mb_width; mb_x++)
90 coded_mb_count += !
IS_SKIP(mb_type[mb_y *
s->mb_stride + mb_x]);
105 if (
s->avctx->extradata_size < 4)
123 s->slice_height =
s->mb_height /
code;
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, "
130 fps,
s->bit_rate,
w->mspel_bit,
w->abt_flag,
w->j_type_bit,
131 w->top_left_mv_flag,
w->per_mb_rl_bit,
code,
s->loop_filter,
141 if (
s->picture_number == 0)
149 s->chroma_qscale =
s->qscale =
get_bits(&
s->gb, 5);
182 if (
w->per_mb_rl_bit)
185 s->per_mb_rl_table = 0;
187 if (!
s->per_mb_rl_table) {
202 s->inter_intra_pred = 0;
206 "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n",
207 s->qscale,
s->rl_chroma_table_index,
s->rl_table_index,
208 s->dc_table_index,
s->per_mb_rl_table,
w->j_type);
232 if (
w->per_mb_rl_bit)
235 s->per_mb_rl_table = 0;
237 if (!
s->per_mb_rl_table) {
239 s->rl_chroma_table_index =
s->rl_table_index;
248 s->inter_intra_pred = 0;
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",
255 s->rl_table_index,
s->rl_chroma_table_index,
256 s->dc_table_index,
s->mv_table_index,
257 s->per_mb_rl_table,
s->qscale,
s->mspel,
258 w->per_mb_abt,
w->abt_type,
w->cbp_table_index,
259 s->inter_intra_pred);
262 s->esc3_level_length = 0;
263 s->esc3_run_length = 0;
268 &
s->gb, &
s->mb_x, &
s->mb_y,
269 2 *
s->qscale, (
s->qscale - 1) | 1,
270 s->loop_filter,
s->low_delay);
273 (
w->s.mb_x >> 1) - 1, (
w->s.mb_y >> 1) - 1,
291 if ((((*mx_ptr) | (*my_ptr)) & 1) &&
s->mspel)
303 int16_t *
A, *
B, *
C, *mot_val;
306 xy =
s->block_index[0];
308 mot_val =
s->current_picture.motion_val[0][xy];
310 A =
s->current_picture.motion_val[0][xy - 1];
311 B =
s->current_picture.motion_val[0][xy -
wrap];
312 C =
s->current_picture.motion_val[0][xy + 2 -
wrap];
314 if (
s->mb_x && !
s->first_slice_line && !
s->mspel &&
w->top_left_mv_flag)
327 }
else if (
type == 1) {
332 if (
s->first_slice_line) {
348 static const int sub_cbp_table[3] = { 2, 3, 1 };
352 s->block_last_index[n] = -1;
356 if (
w->per_block_abt)
358 w->abt_type_table[n] =
w->abt_type;
362 const uint8_t *scantable =
w->abt_scantable[
w->abt_type - 1].scantable;
375 s->block_last_index[n] = 63;
380 s->inter_scantable.permutated);
394 if (
IS_SKIP(
s->current_picture.mb_type[
s->mb_y *
s->mb_stride +
s->mb_x])) {
397 for (
i = 0;
i < 6;
i++)
398 s->block_last_index[
i] = -1;
414 s->mb_intra = (~
code & 0x40) >> 6;
424 "II-cbp illegal at %d %d\n",
s->mb_x,
s->mb_y);
429 for (
i = 0;
i < 6;
i++) {
436 cbp |=
val << (5 -
i);
445 s->bdsp.clear_blocks(
s->block[0]);
446 if (
s->per_mb_rl_table) {
448 s->rl_chroma_table_index =
s->rl_table_index;
451 if (
w->abt_flag &&
w->per_mb_abt) {
453 if (!
w->per_block_abt)
456 w->per_block_abt = 0;
467 for (
i = 0;
i < 6;
i++) {
470 "\nerror while decoding inter block: %d x %d (%d)\n",
471 s->mb_x,
s->mb_y,
i);
477 ff_dlog(
s->avctx,
"%d%d ",
s->inter_intra_pred, cbp);
478 ff_dlog(
s->avctx,
"I at %d %d %d %06X\n",
s->mb_x,
s->mb_y,
479 ((cbp & 3) ? 1 : 0) + ((cbp & 0x3C) ? 2 : 0),
482 if (
s->inter_intra_pred) {
486 s->ac_pred,
s->h263_aic_dir,
s->mb_x,
s->mb_y);
488 if (
s->per_mb_rl_table && cbp) {
490 s->rl_chroma_table_index =
s->rl_table_index;
493 s->bdsp.clear_blocks(
s->block[0]);
494 for (
i = 0;
i < 6;
i++) {
497 "\nerror while decoding intra block: %d x %d (%d)\n",
498 s->mb_x,
s->mb_y,
i);
518 w->s.block,
w->s.block_last_index,
519 w->s.mb_width,
w->s.mb_height);
static int wmv2_decode_inter_block(Wmv2Context *w, int16_t *block, int n, int cbp)
#define MV_TYPE_16X16
1 vector for the whole mb
AVPixelFormat
Pixel format.
int ff_msmpeg4_decode_init(AVCodecContext *avctx)
static av_cold int init(AVCodecContext *avctx)
static int get_bits_left(GetBitContext *gb)
int ff_msmpeg4_decode_block(MpegEncContext *s, int16_t *block, int n, int coded, const uint8_t *scan_table)
av_cold void ff_wmv2_common_init(Wmv2Context *w)
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
void ff_er_add_slice(ERContext *s, int startx, int starty, int endx, int endy, int status)
Add a slice.
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.
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.
static int decode_ext_header(Wmv2Context *w)
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
static int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr)
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.
#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.
int ff_wmv2_decode_picture_header(MpegEncContext *s)
static av_always_inline int wmv2_get_cbp_table_index(MpegEncContext *s, int cbp_index)
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static enum AVPixelFormat pix_fmts[]
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static int parse_mb_skip(Wmv2Context *w)
static int decode012(GetBitContext *gb)
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#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.
int ff_msmpeg4_decode_motion(MpegEncContext *s, int *mx_ptr, int *my_ptr)
av_cold void ff_intrax8_common_end(IntraX8Context *w)
Destroy IntraX8 frame structure.
@ AV_PICTURE_TYPE_I
Intra.
static unsigned int get_bits1(GetBitContext *s)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int16_t * wmv2_pred_motion(Wmv2Context *w, int *px, int *py)
#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.
int ff_h263_decode_end(AVCodecContext *avctx)
const char * name
Name of the codec implementation.
static const float pred[4]
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo ug o o w
main external API structure.
static av_cold int wmv2_decode_init(AVCodecContext *avctx)
@ AV_PICTURE_TYPE_P
Predicted.
#define MB_INTRA_VLC_BITS
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
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.
VLC ff_mb_non_intra_vlc[4]
VLC_TYPE(* table)[2]
code, bits
int ff_msmpeg4_coded_block_pred(MpegEncContext *s, int n, uint8_t **coded_block_ptr)
#define INTER_INTRA_VLC_BITS