Go to the documentation of this file.
50 #define CHECK_PIXEL_PTR(n) \
51 if ((pixel_ptr + n > pixel_limit) || (pixel_ptr + n < 0)) { \
52 av_log (s->avctx, AV_LOG_ERROR, "Problem: pixel_ptr = %d, pixel_limit = %d\n",\
53 pixel_ptr + n, pixel_limit); \
61 int row_inc =
s->frame->linesize[0];
64 int pixel_limit =
s->frame->linesize[0] *
s->avctx->height;
78 while (lines_to_change) {
79 skip = bytestream2_get_byte(&
s->g);
80 rle_code = (int8_t)bytestream2_get_byte(&
s->g);
86 pixel_ptr = row_ptr + 2 * 8 * (skip & 0x7f);
88 pixel_ptr += 2 * 8 * skip;
100 pi0 = bytestream2_get_byte(&
s->g);
101 pi1 = bytestream2_get_byte(&
s->g);
105 rgb[pixel_ptr++] = (pi0 >> 7) & 0x01;
106 rgb[pixel_ptr++] = (pi0 >> 6) & 0x01;
107 rgb[pixel_ptr++] = (pi0 >> 5) & 0x01;
108 rgb[pixel_ptr++] = (pi0 >> 4) & 0x01;
109 rgb[pixel_ptr++] = (pi0 >> 3) & 0x01;
110 rgb[pixel_ptr++] = (pi0 >> 2) & 0x01;
111 rgb[pixel_ptr++] = (pi0 >> 1) & 0x01;
112 rgb[pixel_ptr++] = pi0 & 0x01;
113 rgb[pixel_ptr++] = (pi1 >> 7) & 0x01;
114 rgb[pixel_ptr++] = (pi1 >> 6) & 0x01;
115 rgb[pixel_ptr++] = (pi1 >> 5) & 0x01;
116 rgb[pixel_ptr++] = (pi1 >> 4) & 0x01;
117 rgb[pixel_ptr++] = (pi1 >> 3) & 0x01;
118 rgb[pixel_ptr++] = (pi1 >> 2) & 0x01;
119 rgb[pixel_ptr++] = (pi1 >> 1) & 0x01;
120 rgb[pixel_ptr++] = pi1 & 0x01;
128 int x = bytestream2_get_byte(&
s->g);
129 rgb[pixel_ptr++] = (
x >> 7) & 0x01;
130 rgb[pixel_ptr++] = (
x >> 6) & 0x01;
131 rgb[pixel_ptr++] = (
x >> 5) & 0x01;
132 rgb[pixel_ptr++] = (
x >> 4) & 0x01;
133 rgb[pixel_ptr++] = (
x >> 3) & 0x01;
134 rgb[pixel_ptr++] = (
x >> 2) & 0x01;
135 rgb[pixel_ptr++] = (
x >> 1) & 0x01;
136 rgb[pixel_ptr++] =
x & 0x01;
143 int lines_to_change,
int bpp)
147 int row_inc =
s->frame->linesize[0];
150 int pixel_limit =
s->frame->linesize[0] *
s->avctx->height;
151 int num_pixels = (bpp == 4) ? 8 : 16;
153 while (lines_to_change--) {
154 pixel_ptr = row_ptr + (num_pixels * (bytestream2_get_byte(&
s->g) - 1));
157 while ((rle_code = (int8_t)bytestream2_get_byte(&
s->g)) != -1) {
162 pixel_ptr += (num_pixels * (bytestream2_get_byte(&
s->g) - 1));
164 }
else if (rle_code < 0) {
166 rle_code = -rle_code;
169 for (
i = num_pixels-1;
i >= 0;
i--) {
170 pi[num_pixels-1-
i] = (bytestream2_peek_byte(&
s->g) >> ((
i*bpp) & 0x07)) & ((1<<bpp)-1);
175 memcpy(&rgb[pixel_ptr], &pi, num_pixels);
176 pixel_ptr += num_pixels;
184 int x = bytestream2_get_byte(&
s->g);
185 rgb[pixel_ptr++] = (
x >> 4) & 0x0f;
186 rgb[pixel_ptr++] =
x & 0x0f;
188 int x = bytestream2_get_byte(&
s->g);
189 rgb[pixel_ptr++] = (
x >> 6) & 0x03;
190 rgb[pixel_ptr++] = (
x >> 4) & 0x03;
191 rgb[pixel_ptr++] = (
x >> 2) & 0x03;
192 rgb[pixel_ptr++] =
x & 0x03;
205 int row_inc =
s->frame->linesize[0];
208 int pixel_limit =
s->frame->linesize[0] *
s->avctx->height;
210 while (lines_to_change--) {
211 pixel_ptr = row_ptr + (4 * (bytestream2_get_byte(&
s->g) - 1));
214 while ((rle_code = (int8_t)bytestream2_get_byte(&
s->g)) != -1) {
219 pixel_ptr += (4 * (bytestream2_get_byte(&
s->g) - 1));
221 }
else if (rle_code < 0) {
223 rle_code = -rle_code;
226 pi1 = bytestream2_get_byte(&
s->g);
227 pi2 = bytestream2_get_byte(&
s->g);
228 pi3 = bytestream2_get_byte(&
s->g);
229 pi4 = bytestream2_get_byte(&
s->g);
234 rgb[pixel_ptr++] = pi1;
235 rgb[pixel_ptr++] = pi2;
236 rgb[pixel_ptr++] = pi3;
237 rgb[pixel_ptr++] = pi4;
245 pixel_ptr += rle_code;
256 int row_inc =
s->frame->linesize[0];
259 int pixel_limit =
s->frame->linesize[0] *
s->avctx->height;
261 while (lines_to_change--) {
262 pixel_ptr = row_ptr + (bytestream2_get_byte(&
s->g) - 1) * 2;
265 while ((rle_code = (int8_t)bytestream2_get_byte(&
s->g)) != -1) {
270 pixel_ptr += (bytestream2_get_byte(&
s->g) - 1) * 2;
272 }
else if (rle_code < 0) {
274 rle_code = -rle_code;
275 rgb16 = bytestream2_get_be16(&
s->g);
280 *(uint16_t *)(&rgb[pixel_ptr]) = rgb16;
288 rgb16 = bytestream2_get_be16(&
s->g);
289 *(uint16_t *)(&rgb[pixel_ptr]) = rgb16;
300 int rle_code, rle_code_half;
302 int row_inc =
s->frame->linesize[0];
306 int pixel_limit =
s->frame->linesize[0] *
s->avctx->height;
308 while (lines_to_change--) {
309 pixel_ptr = row_ptr + (bytestream2_get_byte(&
s->g) - 1) * 3;
312 while ((rle_code = (int8_t)bytestream2_get_byte(&
s->g)) != -1) {
317 pixel_ptr += (bytestream2_get_byte(&
s->g) - 1) * 3;
319 }
else if (rle_code < 0) {
321 rle_code = -rle_code;
323 b = bytestream2_get_byte(&
s->g);
329 rgb[pixel_ptr + 2] =
b;
335 rle_code_half = rle_code / 2;
337 while (rle_code_half--) {
343 if (rle_code % 2 != 0){
345 rgb[pixel_ptr + 2] = bytestream2_get_byte(&
s->g);
356 int rle_code, rle_code_half;
358 int row_inc =
s->frame->linesize[0];
361 int pixel_limit =
s->frame->linesize[0] *
s->avctx->height;
363 while (lines_to_change--) {
364 pixel_ptr = row_ptr + (bytestream2_get_byte(&
s->g) - 1) * 4;
367 while ((rle_code = (int8_t)bytestream2_get_byte(&
s->g)) != -1) {
372 pixel_ptr += (bytestream2_get_byte(&
s->g) - 1) * 4;
374 }
else if (rle_code < 0) {
376 rle_code = -rle_code;
389 rle_code_half = rle_code / 2;
390 while (rle_code_half--) {
395 if (rle_code % 2 != 0){
448 void *
data,
int *got_frame,
461 if (avpkt->
size < 8) {
467 size = bytestream2_get_be32(&
s->g) & 0x3FFFFFFF;
473 header = bytestream2_get_be16(&
s->g);
477 if (avpkt->
size < 14) {
481 start_line = bytestream2_get_be16(&
s->g);
483 height = bytestream2_get_be16(&
s->g);
485 if (
height >
s->avctx->height - start_line) {
496 row_ptr =
s->frame->linesize[0] * start_line;
546 s->frame->palette_has_changed = 1;
557 if (!
s->frame->data[0])
static void qtrle_decode_8bpp(QtrleContext *s, int row_ptr, int lines_to_change)
#define CHECK_PIXEL_PTR(n)
static av_cold int init(AVCodecContext *avctx)
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
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.
static void qtrle_decode_32bpp(QtrleContext *s, int row_ptr, int lines_to_change)
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
static void RENAME() duplicate(uint8_t src[], int stride)
Duplicate the given 8 src pixels ? times upward.
#define bytestream2_get_ne64
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
static void qtrle_decode_16bpp(QtrleContext *s, int row_ptr, int lines_to_change)
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 void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static av_cold int qtrle_decode_init(AVCodecContext *avctx)
#define bytestream2_get_ne32
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
static void flush(AVCodecContext *avctx)
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#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.
#define bytestream2_get_ne16
static const uint8_t header[24]
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
#define i(width, name, range_min, range_max)
static int qtrle_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define AV_PIX_FMT_RGB555
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.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Identical in function to ff_get_buffer(), except it reuses the existing buffer if available.
int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
Set various frame properties from the codec context / packet data.
main external API structure.
static void qtrle_decode_flush(AVCodecContext *avctx)
int discard_damaged_percentage
The percentage of damaged samples to discard a frame.
static void qtrle_decode_2n4bpp(QtrleContext *s, int row_ptr, int lines_to_change, int bpp)
static av_cold int qtrle_decode_end(AVCodecContext *avctx)
This structure stores compressed data.
static void qtrle_decode_24bpp(QtrleContext *s, int row_ptr, int lines_to_change)
static void qtrle_decode_1bpp(QtrleContext *s, int row_ptr, int lines_to_change)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.