Go to the documentation of this file.
63 12, 12, 15, 19, 25, 34, 40, 48,
64 12, 12, 18, 22, 27, 44, 47, 46,
65 17, 18, 21, 26, 35, 46, 52, 47,
66 18, 20, 24, 28, 40, 61, 59, 51,
67 20, 24, 32, 43, 50, 72, 72, 63,
68 25, 31, 42, 48, 58, 72, 81, 75,
69 38, 46, 54, 61, 71, 84, 88, 85,
70 50, 61, 65, 68, 79, 78, 86, 91,
74 12, 16, 24, 47, 99, 99, 99, 99,
75 16, 21, 26, 66, 99, 99, 99, 99,
76 24, 26, 56, 99, 99, 99, 99, 99,
77 47, 66, 99, 99, 99, 99, 99, 99,
78 99, 99, 99, 99, 99, 99, 99, 99,
79 99, 99, 99, 99, 99, 99, 99, 99,
80 99, 99, 99, 99, 99, 99, 99, 99,
81 99, 99, 99, 99, 99, 99, 99, 99,
85 0, 1, 8, 9, 16, 2, 3, 10,
86 17, 24, 32, 25, 18, 11, 4, 5,
87 12, 19, 26, 33, 40, 48, 41, 34,
88 27, 20, 13, 6, 7, 14, 21, 28,
89 35, 42, 49, 56, 57, 50, 43, 36,
90 29, 22, 15, 23, 30, 37, 44, 51,
91 58, 59, 52, 45, 38, 31, 39, 46,
92 53, 60, 61, 54, 47, 55, 62, 63,
99 for (
int i = 0;
i < 64;
i++) {
100 table[
i] = av_clip((quant_tab[
i] *
factor + 0x32) / 100, 1, 0x7fff);
119 const int tC =
t8 + tA;
120 const int tD = (
int)((tB +
t9) * 473
U) >> 8;
121 const int tE = (((
int)(
t9 * -669
U) >> 8) - tC) + tD;
122 const int tF = ((
int)((tA -
t8) * 362
U) >> 8) - tE;
123 const int t10 = (((
int)(tB * 277
U) >> 8) - tD) + tF;
137 for (
int i = 0;
i < 8;
i++) {
157 for (
int i = 0;
i < 8;
i++) {
159 for (
int j = 0; j < 8; j++)
160 dst[j] = av_clip_uint8((
block[j] >> 5) + 128);
169 for (
int i = 0;
i < 8;
i++) {
189 for (
int i = 0;
i < 8;
i++) {
191 for (
int j = 0; j < 8; j++)
192 dst[j] = av_clip_uint8((
block[j] >> 5) +
src[j]);
203 const int t2 =
t1 * 473 >> 8;
205 const int t4 = (
t1 * 362 >> 8) -
t3;
206 const int t5 = ((
t1 * 277 >> 8) -
t2) +
t4;
220 for (
int i = 0;
i < 2;
i++) {
221 if ((
block[0x08 +
i]) == 0) {
234 for (
int i = 0;
i < 8;
i++) {
236 for (
int j = 0; j < 8; j++)
237 dst[j] = av_clip_uint8((
block[0] >> 5) + 128);
240 for (
int j = 0; j < 8; j++)
241 dst[j] = av_clip_uint8((
block[j] >> 5) + 128);
252 for (
int i = 0;
i < 2;
i++) {
253 if ((
block[0x08 +
i]) == 0) {
266 for (
int i = 0;
i < 8;
i++) {
268 for (
int j = 0; j < 8; j++)
269 dst[j] = av_clip_uint8((
block[0] >> 5) +
src[j]);
272 for (
int j = 0; j < 8; j++)
273 dst[j] = av_clip_uint8((
block[j] >> 5) +
src[j]);
285 for (
int i = 0;
i < 8;
i++) {
286 for (
int j = 0; j < 8; j++)
287 dst[j] = av_clip_uint8(
block +
src[j]);
295 int *
block,
int *pfill,
303 s->bdsp.fill_block_tab[1](dst, 128, linesize, 8);
308 block[0] = ((pfill[0] * qtab[0]) >> 5) + 128;
309 s->bdsp.fill_block_tab[1](dst,
block[0], linesize, 8);
315 block[0] = pfill[0] * qtab[0];
324 block[0] = pfill[0] * qtab[0];
325 for (
int i = 1;
i < 64;
i++)
336 int *
block,
int *pfill,
349 block[0] = (pfill[0] * qtab[0]) >> 5;
356 block[0] = pfill[0] * qtab[0];
365 block[0] = pfill[0] * qtab[0];
366 for (
int i = 1;
i < 64;
i++)
377 memset(coeffs, 0, nb_codes *
sizeof(*coeffs));
379 for (
int i = 0;
i < nb_codes;) {
388 if (
x < (1 <<
value) / 2) {
391 x = -(1 << (
value - 1)) - (
x & ((1 <<
value) - 1 >> 1));
418 linesize[0] =
frame->linesize[0];
419 linesize[1] =
frame->linesize[0];
420 linesize[2] =
frame->linesize[0];
421 linesize[3] =
frame->linesize[0];
422 linesize[4] =
frame->linesize[1];
423 linesize[5] =
frame->linesize[2];
425 for (
int y = 0; y < avctx->
height; y += 16) {
427 int pfill[3][1] = { {0} };
439 for (
int x = 0;
x < avctx->
width;
x += 16) {
440 dst[0] =
frame->data[0] + linesize[0] * y +
x;
441 dst[1] =
frame->data[0] + linesize[0] * y +
x + 8;
442 dst[2] =
frame->data[0] + linesize[0] * (y + 8) +
x;
443 dst[3] =
frame->data[0] + linesize[0] * (y + 8) +
x + 8;
444 dst[4] =
frame->data[1] + linesize[4] * (y >> 1) + (
x >> 1);
445 dst[5] =
frame->data[2] + linesize[5] * (y >> 1) + (
x >> 1);
447 for (
int b = 0;
b < 6;
b++) {
452 pfill[(
b >= 4) + (
b >= 5)],
453 dst[
b], linesize[
b]);
470 const int mask_size = ((avctx->
height >> 4) * (avctx->
width >> 4) * 2 + 7) / 8;
484 linesize[0] =
frame->linesize[0];
485 linesize[1] =
frame->linesize[0];
486 linesize[2] =
frame->linesize[0];
487 linesize[3] =
frame->linesize[0];
488 linesize[4] =
frame->linesize[1];
489 linesize[5] =
frame->linesize[2];
508 for (
int y = 0; y < avctx->
height; y += 16) {
510 int pfill[3][1] = { {0} };
531 for (
int x = 0;
x < avctx->
width;
x += 16) {
537 dst[0] =
frame->data[0] + linesize[0] * y +
x;
538 dst[1] =
frame->data[0] + linesize[0] * y +
x + 8;
539 dst[2] =
frame->data[0] + linesize[0] * (y + 8) +
x;
540 dst[3] =
frame->data[0] + linesize[0] * (y + 8) +
x + 8;
541 dst[4] =
frame->data[1] + linesize[4] * (y >> 1) + (
x >> 1);
542 dst[5] =
frame->data[2] + linesize[5] * (y >> 1) + (
x >> 1);
544 if ((
flags >> (cnt)) & 1) {
555 src[0] = prev->
data[0] + in_linesize[0] * py + px;
556 src[1] = prev->
data[0] + in_linesize[0] * py + px + 8;
557 src[2] = prev->
data[0] + in_linesize[0] * (py + 8) + px;
558 src[3] = prev->
data[0] + in_linesize[0] * (py + 8) + px + 8;
559 src[4] = prev->
data[1] + in_linesize[4] * (py >> 1) + (px >> 1);
560 src[5] = prev->
data[2] + in_linesize[5] * (py >> 1) + (px >> 1);
562 if ((
flags >> (cnt + 4)) & 1) {
563 for (
int b = 0;
b < 6;
b++)
566 for (
int b = 0;
b < 6;
b++) {
571 pfill[(
b >= 4) + (
b >= 5)],
573 src[
b], in_linesize[
b]);
579 for (
int b = 0;
b < 6;
b++) {
584 pfill[(
b >= 4) + (
b >= 5)],
585 dst[
b], linesize[
b]);
614 s->inter_quant =
s->intra_quant +
get_sbits(gb, 8);
623 frame->key_frame =
s->is_inter == 0;
625 if (
frame->key_frame) {
633 if (!
s->prev_frame->data[0]) {
653 0, 1, 4, 5, 6, 0xE, 0x1E, 0x3E, 0x7E, 0xFE, 0x1FE, 0x1FF,
657 2, 2, 3, 3, 3, 4, 5, 6, 7, 8, 9, 9,
700 s->mvectors_size = 0;
unsigned int mvectors_size
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static void idct2_add(uint8_t *dst, int stride, const uint8_t *src, int in_linesize, int *block)
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
static av_cold int init(AVCodecContext *avctx)
static int get_bits_left(GetBitContext *gb)
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 const int8_t mv[256][2]
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about which is also called distortion Distortion can be quantified by almost any quality measurement one chooses the sum of squared differences is used but more complex methods that consider psychovisual effects can be used as well It makes no difference in this discussion First step
@ AVCOL_RANGE_JPEG
the normal 2^n-1 "JPEG" YUV ranges
static const uint8_t luma_tab[]
static const uint16_t table[]
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
static void copy_block8(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride, int h)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static void skip_bits(GetBitContext *s, int n)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int decode_intra(AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame)
static av_cold void init_static_data(void)
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 int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static const uint8_t chroma_tab[]
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
static int ff_thread_once(char *control, void(*routine)(void))
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const uint16_t cbp_codes[]
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static const uint16_t mask[17]
#define INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size)
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
static unsigned int get_bits_le(GetBitContext *s, int n)
static int get_sbits(GetBitContext *s, int n)
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static void decode_flush(AVCodecContext *avctx)
static const uint8_t cbp_bits[]
static void flush(AVCodecContext *avctx)
enum AVColorRange color_range
MPEG vs JPEG YUV range.
static int decode_intra_block(AVCodecContext *avctx, int mode, GetByteContext *gbyte, int16_t *qtab, int *block, int *pfill, uint8_t *dst, int linesize)
static unsigned int get_bits1(GetBitContext *s)
static void idct2_put(uint8_t *dst, int stride, int *block)
static const uint8_t zigzag[]
static av_cold int decode_close(AVCodecContext *avctx)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#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.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
static void idct_put(uint8_t *dst, int stride, int *block)
#define bytestream2_get_ne16
int16_t interq_tab[2][64]
#define i(width, name, range_min, range_max)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
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...
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 default value
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static void get_qtable(int16_t *table, int quant, const uint8_t *quant_tab)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
int16_t intraq_tab[2][64]
#define FF_ARRAY_ELEMS(a)
main external API structure.
static av_const int sign_extend(int val, unsigned bits)
static int decode_coeffs(GetBitContext *gb, int16_t *coeffs, int nb_codes)
static const int factor[16]
static void idct_1d(int *blk, int step)
static int decode_inter(AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame, AVFrame *prev)
static av_cold int decode_init(AVCodecContext *avctx)
This structure stores compressed data.
int width
picture width / height.
static void idct_add(uint8_t *dst, int stride, const uint8_t *src, int in_linesize, int *block)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define flags(name, subs,...)
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
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 void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx)
VLC_TYPE(* table)[2]
code, bits
static void idct2_1d(int *blk, int step)
const uint16_t ff_aanscales[64]
static void update_inter_block(uint8_t *dst, int stride, const uint8_t *src, int in_linesize, int block)
static int decode_inter_block(AVCodecContext *avctx, int mode, GetByteContext *gbyte, int16_t *qtab, int *block, int *pfill, uint8_t *dst, int linesize, const uint8_t *src, int in_linesize)