Go to the documentation of this file.
77 for (
i = dx +
h;
i > dx;
i--) {
78 nsptr = sptr +
i *
stride + dy * 3;
79 npfptr = pfptr +
i *
stride + dy * 3;
80 for (j = 0; j <
w * 3; j++) {
81 diff |= npfptr[j] ^ nsptr[j];
95 deflateEnd(&
s->zstream);
112 "Input dimensions too large, input must be max 4095x4095 !\n");
117 memset(&
s->zstream, 0,
sizeof(z_stream));
119 s->last_key_frame = 0;
121 s->image_width = avctx->
width;
122 s->image_height = avctx->
height;
125 s->encbuffer =
av_mallocz(
s->image_width *
s->image_height * 3);
127 if (!
s->tmpblock || !
s->encbuffer) {
137 int buf_size,
int block_width,
int block_height,
138 uint8_t *previous_frame,
int *I_frame)
142 int h_blocks, v_blocks, h_part, v_part,
i, j;
148 put_bits(&pb, 4, block_width / 16 - 1);
150 put_bits(&pb, 4, block_height / 16 - 1);
155 h_blocks =
s->image_width / block_width;
156 h_part =
s->image_width % block_width;
157 v_blocks =
s->image_height / block_height;
158 v_part =
s->image_height % block_height;
161 for (j = 0; j < v_blocks + (v_part ? 1 : 0); j++) {
163 int y_pos = j * block_height;
164 int cur_blk_height = (j < v_blocks) ? block_height : v_part;
167 for (
i = 0;
i < h_blocks + (h_part ? 1 : 0);
i++) {
168 int x_pos =
i * block_width;
169 int cur_blk_width = (
i < h_blocks) ? block_width : h_part;
176 s->image_height - (y_pos + cur_blk_height + 1),
177 x_pos, cur_blk_height, cur_blk_width,
180 if (res || *I_frame) {
181 unsigned long zsize = 3 * block_width * block_height;
182 ret = compress2(ptr + 2, &zsize,
s->tmpblock,
183 3 * cur_blk_width * cur_blk_height, 9);
188 "error while compressing block %dx%d\n",
i, j);
190 bytestream_put_be16(&ptr, zsize);
191 buf_pos += zsize + 2;
192 ff_dlog(
s->avctx,
"buf_pos = %d\n", buf_pos);
195 bytestream_put_be16(&ptr, 0);
211 const AVFrame *pict,
int *got_packet)
214 const AVFrame *
const p = pict;
218 int opt_w = 4, opt_h = 4;
223 if (!
s->previous_frame) {
231 pfptr =
s->previous_frame - (
s->image_height - 1) * p->
linesize[0];
233 pfptr =
s->previous_frame;
249 memcpy(
s->previous_frame, p->
data[0],
s->image_height * p->
linesize[0]);
251 memcpy(
s->previous_frame,
257 #if FF_API_CODED_FRAME
266 #if FF_API_CODED_FRAME
#define FF_ENABLE_DEPRECATION_WARNINGS
AVPixelFormat
Pixel format.
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
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
This structure describes decoded (raw) audio or video data.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int key_frame
1 -> keyframe, 0-> not
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int flashsv_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
static enum AVPixelFormat pix_fmts[]
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
@ AV_PICTURE_TYPE_I
Intra.
AVCodec ff_flashsv_encoder
static int copy_region_enc(uint8_t *sptr, uint8_t *dptr, int dx, int dy, int h, int w, int stride, uint8_t *pfptr)
enum AVPictureType pict_type
Picture type of the frame.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only
static av_cold int flashsv_encode_init(AVCodecContext *avctx)
int flags
A combination of AV_PKT_FLAG values.
#define i(width, name, range_min, range_max)
const char * name
Name of the codec implementation.
static av_cold int flashsv_encode_end(AVCodecContext *avctx)
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
attribute_deprecated AVFrame * coded_frame
the picture in the bitstream
main external API structure.
#define FF_DISABLE_DEPRECATION_WARNINGS
@ AV_PICTURE_TYPE_P
Predicted.
int frame_number
Frame counter, set by libavcodec.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static av_always_inline int diff(const uint32_t a, const uint32_t b)
This structure stores compressed data.
int width
picture width / height.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
Check AVPacket size and/or allocate data.
static int encode_bitstream(FlashSVContext *s, const AVFrame *p, uint8_t *buf, int buf_size, int block_width, int block_height, uint8_t *previous_frame, int *I_frame)