Go to the documentation of this file.
45 #define BITMAPINFOHEADER_SIZE 0x28
46 #define TDSF_HEADER_SIZE 0x56
47 #define TDSB_HEADER_SIZE 0x08
114 if (!
ctx->refframe || !
ctx->jpgframe)
122 if (!
ctx->jpeg_avctx)
138 #define APPLY_ALPHA(src, new, alpha) \
139 src = (src * (256 - alpha) + new * alpha) >> 8
146 int x =
ctx->cursor_x -
ctx->cursor_hot_x;
147 int y =
ctx->cursor_y -
ctx->cursor_hot_y;
148 int w =
ctx->cursor_w;
149 int h =
ctx->cursor_h;
155 if (
x +
w >
ctx->width)
157 if (y +
h >
ctx->height)
167 cursor += -y *
ctx->cursor_stride;
174 for (j = 0; j <
h; j++) {
175 for (
i = 0;
i <
w;
i++) {
182 cursor +=
ctx->cursor_stride;
190 int i, j, k,
ret, cursor_fmt;
193 ctx->cursor_hot_x = bytestream2_get_le16(&
ctx->gbc);
194 ctx->cursor_hot_y = bytestream2_get_le16(&
ctx->gbc);
195 ctx->cursor_w = bytestream2_get_le16(&
ctx->gbc);
196 ctx->cursor_h = bytestream2_get_le16(&
ctx->gbc);
199 cursor_fmt = bytestream2_get_le32(&
ctx->gbc);
203 "Invalid cursor position (%d.%d outside %dx%d).\n",
207 if (
ctx->cursor_w < 1 ||
ctx->cursor_w > 256 ||
208 ctx->cursor_h < 1 ||
ctx->cursor_h > 256) {
210 "Invalid cursor dimensions %dx%d.\n",
211 ctx->cursor_w,
ctx->cursor_h);
214 if (
ctx->cursor_hot_x >
ctx->cursor_w ||
215 ctx->cursor_hot_y >
ctx->cursor_h) {
217 ctx->cursor_hot_x,
ctx->cursor_hot_y);
230 switch (cursor_fmt) {
232 for (j = 0; j <
ctx->cursor_h; j++) {
233 for (
i = 0;
i <
ctx->cursor_w;
i += 32) {
234 uint32_t
bits = bytestream2_get_be32(&
ctx->gbc);
235 for (k = 0; k < 32; k++) {
236 dst[0] = !!(
bits & 0x80000000);
241 dst +=
ctx->cursor_stride -
ctx->cursor_w * 4;
245 for (j = 0; j <
ctx->cursor_h; j++) {
246 for (
i = 0;
i <
ctx->cursor_w;
i += 32) {
247 uint32_t
bits = bytestream2_get_be32(&
ctx->gbc);
248 for (k = 0; k < 32; k++) {
249 int mask_bit = !!(
bits & 0x80000000);
250 switch (dst[0] * 2 + mask_bit) {
273 dst +=
ctx->cursor_stride -
ctx->cursor_w * 4;
281 if (cursor_fmt & 8) {
282 for (j = 0; j <
ctx->cursor_h; j++) {
283 for (
i = 0;
i <
ctx->cursor_w;
i++) {
284 int val = bytestream2_get_be32(&
ctx->gbc);
290 dst +=
ctx->cursor_stride -
ctx->cursor_w * 4;
293 for (j = 0; j <
ctx->cursor_h; j++) {
294 for (
i = 0;
i <
ctx->cursor_w;
i++) {
295 int val = bytestream2_get_be32(&
ctx->gbc);
301 dst +=
ctx->cursor_stride -
ctx->cursor_w * 4;
316 out[0] = av_clip_uint8(
Y + ( 91881 *
V + 32768 >> 16));
317 out[1] = av_clip_uint8(
Y + (-22554 *
U - 46802 *
V + 32768 >> 16));
318 out[2] = av_clip_uint8(
Y + (116130 *
U + 32768 >> 16));
323 const uint8_t *srcy,
int srcy_stride,
329 for (col = 0; col <
width; col++)
331 srcu[col >> 1] - 128, srcv[col >> 1] - 128);
335 srcu += srcuv_stride * (
line & 1);
336 srcv += srcuv_stride * (
line & 1);
342 int x,
int y,
int w,
int h)
351 jpkt.
size = tile_size;
362 "JPEG decoding error (%d).\n",
ret);
373 ctx->refframe->linesize[0],
374 ctx->jpgframe->data[0],
ctx->jpgframe->linesize[0],
375 ctx->jpgframe->data[1],
ctx->jpgframe->data[2],
376 ctx->jpgframe->linesize[1],
w,
h);
390 for (
i = 0;
i < number_tiles;
i++) {
397 bytestream2_get_le32(&
ctx->gbc) !=
MKTAG(
'T',
'D',
'S',
'B') ||
403 tile_size = bytestream2_get_le32(&
ctx->gbc);
407 tile_mode = bytestream2_get_le32(&
ctx->gbc);
409 x = bytestream2_get_le32(&
ctx->gbc);
410 y = bytestream2_get_le32(&
ctx->gbc);
411 w = bytestream2_get_le32(&
ctx->gbc) -
x;
412 h = bytestream2_get_le32(&
ctx->gbc) - y;
414 if (
x >=
ctx->width || y >=
ctx->height) {
416 "Invalid tile position (%d.%d outside %dx%d).\n",
417 x, y,
ctx->width,
ctx->height);
420 if (
x +
w >
ctx->width || y +
h >
ctx->height) {
422 "Invalid tile size %dx%d\n",
w,
h);
427 if (!
ctx->tilebuffer)
432 if (tile_mode ==
MKTAG(
'G',
'E',
'P',
'J')) {
437 }
else if (tile_mode ==
MKTAG(
' ',
'W',
'A',
'R')) {
440 ctx->refframe->linesize[0] * y,
441 ctx->refframe->linesize[0],
ctx->tilebuffer,
456 int ret,
w,
h, init_refframe = !
ctx->refframe->data[0];
464 w = bytestream2_get_le32(&
ctx->gbc);
465 h = -bytestream2_get_le32(&
ctx->gbc);
467 if (bytestream2_get_le16(&
ctx->gbc) != 1 ||
468 bytestream2_get_le16(&
ctx->gbc) != 24)
482 ctx->refframe->width =
ctx->width =
w;
483 ctx->refframe->height =
ctx->height =
h;
500 int action = bytestream2_get_le32(&
ctx->gbc);
504 if (action == 2 || action == 3) {
506 ctx->cursor_x = bytestream2_get_le32(&
ctx->gbc);
507 ctx->cursor_y = bytestream2_get_le32(&
ctx->gbc);
528 int ret, tag_header, keyframe = 0;
538 dlen =
ctx->deflatelen;
541 ret = uncompress(
ctx->deflatebuffer, &dlen, avpkt->
data, avpkt->
size);
556 tag_header = bytestream2_get_le32(&
ctx->gbc);
558 if (tag_header ==
MKTAG(
'T',
'D',
'S',
'F')) {
565 number_tiles = bytestream2_get_le32(&
ctx->gbc);
568 keyframe = bytestream2_get_le32(&
ctx->gbc) == 0x30;
576 tag_header = bytestream2_get_le32(&
ctx->gbc);
580 if (tag_header ==
MKTAG(
'D',
'T',
'S',
'M')) {
582 int tag_size = bytestream2_get_le32(&
ctx->gbc);
609 frame->key_frame = 1;
#define AV_LOG_WARNING
Something somehow does not look correct.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
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
#define APPLY_ALPHA(src, new, alpha)
static void tdsc_yuv2rgb(uint8_t *out, int Y, int U, int V)
int av_frame_get_buffer(AVFrame *frame, int align)
Allocate new buffer(s) for audio or video data.
#define MKTAG(a, b, c, d)
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
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.
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
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
int flags
AV_CODEC_FLAG_*.
static double val(void *priv, double ch)
int dct_algo
DCT algorithm, see FF_DCT_* below.
static int tdsc_parse_tdsf(AVCodecContext *avctx, int number_tiles)
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold int tdsc_init(AVCodecContext *avctx)
static void tdsc_paint_cursor(AVCodecContext *avctx, uint8_t *dst, int stride)
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
int flags
Flags modifying the (de)muxer behaviour.
int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Return decoded output data from a decoder.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static int tdsc_parse_dtsm(AVCodecContext *avctx)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer.
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
@ AV_PICTURE_TYPE_I
Intra.
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
AVCodecContext * jpeg_avctx
#define AV_EF_EXPLODE
abort decoding on minor error detection
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
int flags2
AV_CODEC_FLAG2_*.
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.
int ff_codec_open2_recursive(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Call avcodec_open2 recursively by decrementing counter, unlocking mutex, calling the function and the...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
int av_reallocp(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory through a pointer to a pointer.
static int tdsc_decode_tiles(AVCodecContext *avctx, int number_tiles)
int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
Supply raw packet data as input to a decoder.
#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_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
int idct_algo
IDCT algorithm, see FF_IDCT_* below.
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
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
static int tdsc_load_cursor(AVCodecContext *avctx)
AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
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
static int tdsc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
main external API structure.
static int tdsc_decode_jpeg_tile(AVCodecContext *avctx, int tile_size, int x, int y, int w, int h)
@ AV_PICTURE_TYPE_P
Predicted.
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
#define avpriv_request_sample(...)
static const int16_t alpha[]
This structure stores compressed data.
static av_always_inline void tdsc_blit(uint8_t *dst, int dst_stride, const uint8_t *srcy, int srcy_stride, const uint8_t *srcu, const uint8_t *srcv, int srcuv_stride, int width, int height)
int width
picture width / height.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
static av_cold int tdsc_close(AVCodecContext *avctx)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define BITMAPINFOHEADER_SIZE
The official guide to swscale for confused that consecutive non overlapping rectangles of slice_bottom special converter These generally are unscaled converters of common like for each output line the vertical scaler pulls lines from a ring buffer When the ring buffer does not contain the wanted line
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.