Go to the documentation of this file.
53 thr = ((thr >> 1) + 4 * m->
cum_prob[0]) / thr;
55 return FFMIN(thr, 0x3FFF);
114 for (
i =
val - 1;
i >= 0;
i--)
123 if (!
ctx->special_initial_cache)
124 for (
i = 0;
i <
ctx->cache_size;
i++)
135 for (
i = 0;
i < 15;
i++)
136 for (j = 0; j < 4; j++)
141 int full_model_syms,
int special_initial_cache)
145 ctx->cache_size = cache_size + 4;
146 ctx->num_syms = cache_size;
147 ctx->special_initial_cache = special_initial_cache;
152 for (
i = 0, idx = 0;
i < 4;
i++)
154 for (k = 0; k < 4; k++)
160 uint8_t *ngb,
int num_ngb,
int any_ngb)
167 if (val < pctx->num_syms) {
173 for (j = 0; j < num_ngb; j++)
174 if (pctx->
cache[
i] == ngb[j])
188 if (pctx->
cache[
i] == pix)
195 pctx->
cache[0] = pix;
213 memset(neighbours,
src[-1], 4);
229 if (
x >= 2 &&
src[-2] == neighbours[
LEFT])
235 ref_pix[0] = neighbours[0];
236 for (
i = 1;
i < 4;
i++) {
237 for (j = 0; j < nlen; j++)
238 if (ref_pix[j] == neighbours[
i])
241 ref_pix[nlen++] = neighbours[
i];
276 else if (neighbours[
TOP] == neighbours[
LEFT])
300 uint8_t *rgb_dst = rgb_pic +
x * 3 + y * rgb_stride;
304 for (j = 0; j <
height; j++) {
319 rgb_dst += rgb_stride;
331 for (j = y; j < y +
height; j++) {
332 memcpy(
c->rgb_pic + j *
c->rgb_stride +
x * 3,
333 c->last_rgb_pic + j *
c->rgb_stride +
x * 3,
335 memcpy(
c->pal_pic + j *
c->pal_stride +
x,
336 c->last_pal_pic + j *
c->pal_stride +
x,
344 if (
x +
c->mvX < 0 ||
x +
c->mvX +
width >
c->avctx->width ||
345 y +
c->mvY < 0 || y +
c->mvY +
height >
c->avctx->height ||
349 uint8_t *dst =
c->pal_pic +
x + y *
c->pal_stride;
350 uint8_t *rgb_dst =
c->rgb_pic +
x * 3 + y *
c->rgb_stride;
356 if (
c->last_rgb_pic) {
357 src =
c->last_pal_pic +
x + y *
c->pal_stride;
358 rgb_src =
c->last_rgb_pic +
x * 3 + y *
c->rgb_stride;
360 src =
c->pal_pic +
x + y *
c->pal_stride;
361 rgb_src =
c->rgb_pic +
x * 3 + y *
c->rgb_stride;
363 for (j = 0; j <
height; j++) {
365 memmove(rgb_dst, rgb_src,
width * 3);
366 dst +=
c->pal_stride;
367 src +=
c->pal_stride;
368 rgb_dst +=
c->rgb_stride;
369 rgb_src +=
c->rgb_stride;
377 ptrdiff_t mask_stride,
int x,
int y,
382 uint8_t *rgb_dst =
c->rgb_pic +
x * 3 + y *
c->rgb_stride;
385 mask +=
x + y * mask_stride;
387 for (j = 0; j <
height; j++) {
391 !
c->rgb_pic &&
mask[
i] != 0x80 &&
mask[
i] != 0xFF))
394 if (
mask[
i] == 0x02) {
396 }
else if (
mask[
i] == 0x04) {
399 }
else if (
mask[
i] != 0x80) {
414 rgb_dst +=
c->rgb_stride;
421 int version,
int full_model_syms)
432 full_model_syms,
version ? 1 : 0);
454 if ((
base + 1) / 2 - 2 <= 0)
475 int i, j, pix, rgb_pix;
476 ptrdiff_t
stride =
c->pal_stride;
477 ptrdiff_t rgb_stride =
c->rgb_stride;
479 uint8_t *rgb_dst =
c->rgb_pic +
x * 3 + y * rgb_stride;
484 rgb_pix =
c->pal[pix];
486 memset(dst, pix,
width);
488 for (j = 0; j <
width * 3; j += 3)
514 (
c->rgb_pic &&
mode != 0x01 &&
mode != 0x02 &&
mode != 0x04 ||
515 !
c->rgb_pic &&
mode != 0x80 &&
mode != 0xFF))
520 else if (
mode == 0x04)
522 else if (
mode != 0x80)
530 c->pal_stride,
c->mask,
591 "Insufficient extradata size: expected %"PRIu32
" got %d\n",
614 "Header version doesn't match codec tag\n");
619 if ((
unsigned)
c->free_colours > 256) {
621 "Incorrect number of changeable palette entries: %d\n",
645 "Insufficient extradata size %d for v2\n",
654 if (
c->full_model_syms < 2 ||
c->full_model_syms > 256) {
656 "Incorrect number of used colours %d\n",
664 c->full_model_syms = 256;
667 for (
i = 0;
i < 256;
i++)
680 if (
c->slice_split) {
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static av_cold void slicecontext_init(SliceContext *sc, int version, int full_model_syms)
static const int sec_order_sizes[4]
int16_t weights[MODEL_MAX_SYMS+1]
static av_always_inline int decode_pixel(ArithCoder *acoder, PixContext *pctx, uint8_t *ngb, int num_ngb, int any_ngb)
static int motion_compensation(MSS12Context const *c, int x, int y, int width, int height)
static int decode_pixel_in_context(ArithCoder *acoder, PixContext *pctx, uint8_t *src, ptrdiff_t stride, int x, int y, int has_right)
int(* get_model_sym)(struct ArithCoder *c, Model *m)
static av_always_inline float av_int2float(uint32_t i)
Reinterpret a 32-bit integer as a float.
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 x
static void pixctx_reset(PixContext *ctx)
static double val(void *priv, double ch)
static void model_rescale_weights(Model *m)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const uint16_t mask[17]
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static int decode_region_intra(SliceContext *sc, ArithCoder *acoder, int x, int y, int width, int height)
void ff_mss12_model_update(Model *m, int val)
static int decode_region_masked(MSS12Context const *c, ArithCoder *acoder, uint8_t *dst, ptrdiff_t stride, uint8_t *mask, ptrdiff_t mask_stride, int x, int y, int width, int height, PixContext *pctx)
uint8_t idx2sym[MODEL_MAX_SYMS+1]
#define AV_EF_EXPLODE
abort decoding on minor error detection
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static int decode_pivot(SliceContext *sc, ArithCoder *acoder, int base)
static int decode_region_inter(SliceContext *sc, ArithCoder *acoder, int x, int y, int width, int height)
static int model_calc_threshold(Model *m)
static av_cold void model_init(Model *m, int num_syms, int thr_weight)
#define i(width, name, range_min, range_max)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static void copy_rectangles(MSS12Context const *c, int x, int y, int width, int height)
#define av_malloc_array(a, b)
av_cold int ff_mss12_decode_end(MSS12Context *c)
main external API structure.
static void model_reset(Model *m)
static av_cold void pixctx_init(PixContext *ctx, int cache_size, int full_model_syms, int special_initial_cache)
int ff_mss12_decode_rect(SliceContext *sc, ArithCoder *acoder, int x, int y, int width, int height)
int coded_width
Bitstream width / height, may be different from width/height e.g.
int(* get_number)(struct ArithCoder *c, int n)
void ff_mss12_slicecontext_reset(SliceContext *sc)
int width
picture width / height.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
av_cold int ff_mss12_decode_init(MSS12Context *c, int version, SliceContext *sc1, SliceContext *sc2)
int16_t cum_prob[MODEL_MAX_SYMS+1]
static int decode_region(ArithCoder *acoder, uint8_t *dst, uint8_t *rgb_pic, int x, int y, int width, int height, ptrdiff_t stride, ptrdiff_t rgb_stride, PixContext *pctx, const uint32_t *pal)